﻿/* -----------------------------
   1. CSS Variables (Custom Properties)
----------------------------- */
:root {
  /* Dark Theme Colors */
  --primary-color: #ff5c00;
  --primary-hover: #fc8846;
  --text-bialy: #ffffff;
  --text-light: #c9c9c9;
  --text-lighter: #b0bec5;
  --text-dark: #808080;
  --bg-dark: #2a353d;
  --bg-darker: #212a34;
  --bg-darkest: #0f1318;
  --border-color: #4b5c64;
  --nav-calendar-bg: rgba(7, 186, 255, 0.14);

  /* Status Colors */
  --status-free: #00b500;
  --status-repair: #ff8100;
  --status-rented: #fd0019;
  --status-reserved: #07baff;

  /* Spacing */
  --spacing-xs: 5px;
  --spacing-sm: 6px;
  --spacing-md: 20px;
  --spacing-lg: 30px;

  /* Border Radius */
  --border-radius: 4px;
  --border-radius-lg: 6px;
}

body.light-theme {
  --primary-color: #ff5c00;
  --primary-hover: #fb752a;
  --text-bialy: #2a2a2a;
  --text-light: #525252;
  --text-lighter: #7b7b7b;
  --text-dark: #101010;
  --bg-dark: #fdfdfd;
  --bg-darker: #e9e9e9;
  --bg-darkest: #d3d3d3;
  --border-color: #bcbcbc;
  --nav-calendar-bg: rgba(7, 186, 255, 0.1);
}

/* -----------------------------
   2. Reset & Base Styles
----------------------------- */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-darkest);
  color: var(--text-dark);
  accent-color: var(--primary-color);
  transition:
    background 0.3s ease,
    color 0.3s ease;
}

body::before {
  content: "";
  /* fixed: tło nie jedzie ze scrollem listy w main.zalogowany */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    var(--bg-darkest) 0%,
    var(--bg-darker) 50%,
    var(--bg-darkest) 100%
  );
  /*filter: blur(30px);*/
  /*animation: waveFlow1 60s ease-in-out infinite;*/
  /*transform: skewY(-10deg);*/
  z-index: -1;
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><circle cx="50" cy="50" r="1" fill="rgb(75, 92, 100)"/></svg>');
  background-size: 15px 15px;
  opacity: 0.6;
  z-index: -1;
}

body.light-theme::after {
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><circle cx="50" cy="50" r="1" fill="rgb(188, 188, 188)"/></svg>');
}

/* -----------------------------
   2a. Paski przewijania - "pomarańczowa szyna CNS"
   Domyślne paski przeglądarki są jasne i odcinały się od ciemnego tła.
   Kolory bierzemy ze zmiennych, więc jasny motyw przełącza je razem z resztą.
----------------------------- */

/* Firefox pozwala ustawić tylko grubość i dwa kolory. Obie właściwości są
   dziedziczone, więc wpis na html obejmuje też przewijane ramki w środku.
   UWAGA: w Chrome samo podanie scrollbar-color wyłącza całe stylowanie
   ::-webkit-scrollbar i wraca systemowy pasek ze strzałkami. Dlatego blok jest
   zamknięty w @supports, którego Chrome nie spełnia (zna ::-webkit-scrollbar),
   a Firefox tak. */
@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-darker);
  }
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

/* Strzałki na końcach paska. Odkąd Chrome stosuje nasze reguły, systemowych
   już nie rysuje, więc trójkąty wstawiamy jako tło SVG. Kolor musi być wpisany
   liczbą, bo w adresie data: nie działa var() - #ff5c00 to --primary-color,
   identyczny w obu motywach. */
::-webkit-scrollbar-button {
  display: block;
  height: 11px;
  width: 11px;
  background-color: var(--bg-darker);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 7px 7px;
}

::-webkit-scrollbar-button:vertical:decrement {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path d='M5 2 L9 8 H1 Z' fill='%23ff5c00'/></svg>");
}

::-webkit-scrollbar-button:vertical:increment {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path d='M5 8 L1 2 H9 Z' fill='%23ff5c00'/></svg>");
}

::-webkit-scrollbar-button:horizontal:decrement {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path d='M2 5 L8 1 V9 Z' fill='%23ff5c00'/></svg>");
}

::-webkit-scrollbar-button:horizontal:increment {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'><path d='M8 5 L2 9 V1 Z' fill='%23ff5c00'/></svg>");
}

/* Bez tego Chrome dorysowuje po dwa przyciski na każdym końcu paska */
::-webkit-scrollbar-button:vertical:start:increment,
::-webkit-scrollbar-button:vertical:end:decrement,
::-webkit-scrollbar-button:horizontal:start:increment,
::-webkit-scrollbar-button:horizontal:end:decrement {
  display: none;
}

::-webkit-scrollbar-track {
  background: var(--bg-darker);
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.45);
  border-radius: var(--border-radius);
}

::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  /* Ramka w kolorze szyny razem z background-clip robi odstęp wokół uchwytu,
     dzięki czemu wygląda jak wsunięty w prowadnicę. Przy pasku 11 px zostaje
     na uchwyt 7 px - grubsza ramka zjadłaby go prawie całego. */
  border: 2px solid var(--bg-darker);
  background-clip: padding-box;
  border-radius: 8px;
}

/* Hover zostaje przy --primary-color (#ff5c00), nie --primary-hover (#fc8846) —
   inaczej przy przewijaniu list (marka, rok…) pasek robi się „rozjaśniony”. */
::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary-color);
}

/* Narożnik między paskiem pionowym i poziomym */
::-webkit-scrollbar-corner {
  background: var(--bg-darker);
}

.blokada-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(20, 20, 20, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99998;
  pointer-events: auto;
  overflow: hidden;
}

/* Dodaj pseudo-element do efektu tła z SVG */
.blokada-overlay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Ccircle cx='50' cy='50' r='1' fill='rgb(75, 92, 100)'/%3E%3C/svg%3E");
  background-size: 15px 15px;
  opacity: 0.6;
  z-index: -1;
}

.blokada-overlay {
  transition: opacity 0.3s ease;
  opacity: 1;
}

.blokada-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.blokada-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 3rem 2rem 2rem 2rem;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 99999;
  color: #fff;
  font-family: "Segoe UI", Arial, sans-serif;
}
.blokada-message h1 {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.blokada-message p {
  font-size: 1.12rem;
  margin-bottom: 1.8rem;
}

.selected_kalendarz {
  width: 100%;
}

h2 {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 1.6em;
  margin-top: 30px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
}

h3 {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 1.2em;
  padding-bottom: 10px;
}

a {
  text-decoration: none;
  font-size: 0.875rem;
  color: var(--text-dark);
}

/* -----------------------------
   3. Layout Components
----------------------------- */
.top {
  background-color: var(--bg-darker);
  padding: 8px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid var(--border-color);
}

.top_prawa {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.top .wyszukiwarka {
  display: flex;
  align-items: center;
  position: relative;
  width: 240px;
  flex: 0 0 240px;
  margin: 0;
}

.top .wyszukiwarka .mdi-magnify {
  position: absolute;
  left: 12px;
  z-index: 1;
  font-size: 18px;
  color: var(--text-bialy);
  pointer-events: none;
}

.top .wyszukiwarka .wyszukiwarka_wygaszony {
  background-color: #171d24;
  width: 100%;
  height: 100%;
  min-height: 46px;
  margin: 0;
  padding: 0 34px 0 38px;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 0 0 1px var(--border-color);
}

.pole_szukajki_z_x input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.kasuj_szukajke {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-light);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kasuj_szukajke[hidden] {
  display: none !important;
}

.kasuj_szukajke:hover {
  color: var(--text-bialy);
}

.top .session-timer {
  margin-left: 0;
  align-self: stretch;
}

.top .session-timer-panel {
  height: 100%;
}

.top .session-timer-chip {
  height: 100%;
  min-height: 46px;
}

.top .session-timer.is-open .session-timer-panel {
  height: auto;
}

.top .user-info {
  margin-right: 0;
  background: #171d24;
  border-radius: 18px;
  box-shadow: 0 0 0 1px var(--border-color);
  min-height: 46px;
  padding: 0 14px 0 8px;
}

.top .user-info > .nav-link {
  display: flex;
  align-items: center;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.top .navbar-profile {
  padding: 0;
  height: 100%;
  min-height: 46px;
}

.top .navbar-profile .mdi-account-circle {
  width: 32px !important;
  height: 32px !important;
  margin-right: 10px !important;
  font-size: 24px !important;
}

body.light-theme .top .wyszukiwarka .wyszukiwarka_wygaszony,
body.light-theme .top .user-info,
body.light-theme .logo_naglowek_plytka {
  background: var(--bg-darker);
}

/* Licznik do wygaśnięcia sesji (bezczynność) */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.session-timer {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  user-select: none;
  margin-left: 12px;
}

.session-timer-panel {
  position: relative;
  background: #171d24;
  border-radius: 18px;
  box-shadow: 0 0 0 1px var(--border-color);
}

.session-timer.is-open {
  z-index: 30;
}

.session-timer.is-open .session-timer-panel {
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  z-index: 20;
  min-width: 248px;
  padding: 14px;
}

.session-timer-progress {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.session-timer-progress-track {
  stroke: none;
}

.session-timer-progress-bar {
  stroke: #ff5c00;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 100 100;
  transition:
    stroke 0.4s ease,
    stroke-dasharray 0.45s ease;
  filter: drop-shadow(0 0 2px rgba(255, 92, 0, 0.55));
}

.session-timer--low .session-timer-progress-bar {
  animation: sessionProgressPulseLow 1.15s ease-in-out infinite;
}

.session-timer--warn .session-timer-progress-bar {
  animation: sessionProgressPulseWarn 0.85s ease-in-out infinite;
}

@keyframes sessionProgressPulseLow {
  0%,
  100% {
    filter: drop-shadow(0 0 2px rgba(253, 0, 25, 0.55));
    opacity: 1;
  }
  50% {
    filter: drop-shadow(0 0 5px rgba(253, 0, 25, 0.75));
    opacity: 0.88;
  }
}

@keyframes sessionProgressPulseWarn {
  0%,
  100% {
    filter: drop-shadow(0 0 2px rgba(253, 0, 25, 0.6));
    opacity: 1;
  }
  50% {
    filter: drop-shadow(0 0 7px rgba(253, 0, 25, 0.9));
    opacity: 0.82;
  }
}

.session-timer--low .session-timer-progress-bar,
.session-timer--warn .session-timer-progress-bar,
.session-timer--danger .session-timer-progress-bar {
  stroke: #fd0019;
}

.session-timer-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 22px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  appearance: none;
}

.session-timer-clock {
  display: inline-flex;
  align-items: center;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.session-timer-digit {
  width: 17px;
  height: 28px;
  display: inline-block;
  position: relative;
  overflow: hidden;
}

.session-timer-strip {
  position: absolute;
  inset: 0;
  display: block;
  will-change: transform;
  transition: transform 240ms ease-in-out;
}

.session-timer-cell {
  height: 28px;
  width: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

body.light-theme .session-timer-panel {
  background: var(--bg-darker);
}

body.light-theme .session-timer-cell {
  color: var(--primary-color);
  text-shadow: none;
}

.session-timer-colon {
  color: var(--primary-color);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  transform: translateY(-1px);
}

.session-timer-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1px;
  line-height: 1.15;
  text-align: left;
  font-family: Arial, Helvetica, sans-serif;
}

.session-timer-weekday {
  font-size: 10px;
  color: #8a9aa3;
  text-transform: lowercase;
}

.session-timer-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--status-reserved);
}

.session-timer-now {
  font-size: 11px;
  color: #8a9aa3;
}

body.light-theme .session-timer-weekday {
  color: #6b7a82;
}

body.light-theme .session-timer-date {
  color: #1a1a1a;
}

body.light-theme .session-timer-now {
  color: #8a9aa3;
}

body.light-theme .session-timer-progress-track {
  stroke: none;
}

.session-timer-cal {
  padding: 8px 18px 14px;
}

.session-timer-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.session-timer-cal-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  text-transform: capitalize;
}

body.light-theme .session-timer-cal-title {
  color: #1a1a1a;
}

.session-timer-cal-prev,
.session-timer-cal-next {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c9c9c9;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.session-timer-cal-prev:hover,
.session-timer-cal-next:hover {
  color: var(--primary-color);
  background: rgba(255, 92, 0, 0.12);
}

.session-timer-cal-week,
.session-timer-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.session-timer-cal-week span {
  font-size: 10px;
  font-weight: 700;
  color: #8a9aa3;
  padding: 4px 0;
}

.session-timer-cal-day {
  width: 100%;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font-size: 12px;
  cursor: pointer;
}

.session-timer-cal-day:hover {
  background: rgba(255, 92, 0, 0.16);
}

.session-timer-cal-day--muted {
  color: #5c6b73;
}

.session-timer-cal-day--today {
  background: #ff5c00;
  color: #ffffff;
  font-weight: 700;
}

.session-timer-cal-day--today:hover {
  background: #ff5c00;
}

.session-timer-cal-day--wybrany:not(.session-timer-cal-day--today) {
  box-shadow: inset 0 0 0 1px #ff5c00;
}

body.light-theme .session-timer-cal-day {
  color: #1a1a1a;
}

body.light-theme .session-timer-cal-day--muted {
  color: #9aa8b0;
}

.session-timer--warn {
  border-color: rgba(255, 129, 0, 0.9);
}

@keyframes sessionDangerPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(253, 0, 25, 0.55);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 0 10px rgba(253, 0, 25, 0),
      0 0 18px 2px rgba(253, 0, 25, 0.45);
    transform: scale(1.05);
  }
}

.session-timer--danger .session-timer-panel {
  transform-origin: center;
  animation: sessionDangerPulse 0.7s ease-in-out infinite;
}

.logo {
  display: block;
  margin: 0 auto;
  width: 300px;
  max-width: 100%;
}

.logo_naglowek {
  width: 200px;
  padding-left: 0;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: visible;
}

.logo_naglowek_plytka {
  display: flex;
  align-items: center;
  /*background: #171d24;*/
  border-radius: 18px;
  box-shadow: 0 0 0 1px var(--border-color);
  padding: 4px 10px;
  margin-left: -40px;
}

.logo_naglowek svg,
.logo_naglowek img {
  height: 57px;
  width: auto;
  display: block;
  margin-left: 0;
}

.logo_naglowek img {
  filter: brightness(1.45) contrast(1.15) saturate(1.08);
}

main.zalogowany {
  margin-left: 200px;
  padding: 20px;
  padding-top: 90px;
  padding-bottom: 100px;
  color: var(--text-lighter);
  min-height: 100vh;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition:
    margin-left 0.3s ease,
    padding-top 0.3s ease;
  overflow-y: auto;
}

footer {
  background-color: var(--bg-darker);
  color: var(--text-lighter);
  text-align: center;
  padding: 15px;
  margin-top: 50px;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.1);
}

footer a {
  color: var(--primary-color);
}

footer a:hover {
  color: var(--primary-hover);
}

.pulpit-container {
  padding: 0 0px;
  margin: 0 auto;
  max-width: 725px; /* Ograniczenie szerokości w widoku jednokolumnowym */
}
.pulpit-container > section {
  margin-bottom: 20px;
}

/* -----------------------------
   4. Forms & Inputs
----------------------------- */
.nasz_formularz,
.nasz_formularz_500,
.nasz_formularz_karta_uzytkownika,
.nasz_formularz_ubezpieczalnie {
  /*margin: 60px 0;*/
  color: var(--text-light);
  background-color: var(--bg-dark);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius-lg);
  box-shadow: 7px 7px 10px rgba(0, 0, 0, 0.3);
  animation: slideDown 1s ease-out forwards;
  max-width: 500px;
}

.nasz_formularz {
  max-width: 725px;
}

.nasz_formularz_500 {
  max-width: 500px;
}

.nasz_formularz_karta_uzytkownika {
  width: 760px;
  margin: 60px 0px;
}

.nasz_formularz_logowanie {
  position: relative;
  width: 320px;
  margin: 50px auto;
  background-color: var(--text-light);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: slideDown 1s ease-out forwards;
  display: grid;
  justify-content: center;
  z-index: 2;
}

.form-group {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
}

.form-group-item {
  flex: 1;
  min-width: 45%;
  box-sizing: border-box;
}

.form-group-item_50 {
  flex: 1;
  width: 48%;
  box-sizing: border-box;
}

.form-group-zmiana_haslo {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin: 0 0 20px 0;
}

.form-group-2obrys_w_karcie {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin: 30px 0 20px 0;
}

.form-group-2obrys_w_karcie_dark {
  background-color: var(--bg-darker);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin: 30px 0 20px 0;
  box-shadow: 7px 7px 10px rgba(0, 0, 0, 0.3);
}

.form-group-container {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.form-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 15px;
}

.input-group {
  flex: 1;
  margin: 0;
}

.input-group select,
.input-group input[type="text"] {
  width: 100%;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
textarea,
select {
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: var(--spacing-sm);
  margin: 10px 0;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.875rem;
  background-color: var(--bg-darker);
  color: var(--text-light);
  transition: all 0.3s ease-in-out;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.readonly-value {
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: var(--spacing-sm);
  margin: 10px 0;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.875rem;
  color: var(--text-light);
  transition: all 0.3s ease-in-out;
  display: inline-block;
  background-color: var(--bg-darker);
}

.uwagi-text {
  min-height: 100px;
  text-align: left;
}

.ikony_kontener {
  text-align: left;
  padding: 5px 0px 0px 0px;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Wyrównanie do lewej */
  gap: 4px; /* Odstęp między ikonami */
}

.ikony_kontener .mdi-alert {
  font-size: 28px;
  color: var(--primary-color);
  cursor: help; /* Zmienia kursor, aby sugerować, że element ma tooltip */
  animation: blink 1s infinite;
}

.ikony_kontener .mdi-note-text {
  font-size: 28px;
  color: var(--primary-color);
  cursor: help;
}

.info_rok_produkcji {
  background-color: rgb(15 19 24 / 50%);
  margin: 0px 0px 0px 0px;
  padding: 10px 3px 10px 3px;
  border-radius: 2px;
  /* text-align: center; */
  /* font-weight: bold; */
  font-size: 0.84em;
}

textarea {
  resize: vertical;
  height: 100px;
}

select {
  line-height: 2;
  /* Systemowy akcent (np. jasny pomarańcz Windows) nie ma nadpisywać CNS */
  accent-color: var(--primary-color);
  /* Własna strzałka w kolorze --primary-color zamiast systemowej (często jaśniejszej) */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1.5 L6 6.5 L11 1.5' fill='none' stroke='%23ff5c00' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 11px 8px;
  padding-right: 28px;
}

select option {
  background-color: var(--bg-darker);
  color: var(--text-light);
  padding: 8px;
  line-height: 1.5;
}

.date-inputs {
  display: flex;
  gap: 10px;
}

.date-inputs select {
  min-width: 70px;
  padding-right: 28px;
  background-color: var(--bg-dark);
  /* Ta sama strzałka #ff5c00 co globalny select — bez systemowego „jasnego” pomarańczu */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.radio-option {
  color: var(--primary-color);
  margin: var(--spacing-md);
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-direction: column;
}

.radio-option label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.radio-option input[type="radio"],
.input-group input[type="checkbox"] {
  margin: 0;
}

.input-group.gps-container {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.input-group.gps-container label {
  margin: 0;
}

.input-group.gps-container input[type="checkbox"] {
  margin: 0;
  transform: scale(1.2);
  cursor: pointer;
  margin-top: 5px;
}

.password-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input {
  padding-right: 40px;
  width: 100%;
  box-sizing: border-box;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-dark);
  z-index: 1;
}

.toggle-password:hover {
  color: var(--primary-color);
}

.progress {
  width: 100%;
  height: 5px;
  background-color: var(--bg-darker);
  border-radius: 10px;
  margin-bottom: var(--spacing-md);
}

.progress-bar {
  margin-right: 5px;
  height: 5px;
  width: 50%;
  border-radius: 5px;
  transition:
    width 2s ease-in-out,
    background-image 1s ease-in-out;
}

.progress-bar:last-child {
  margin-right: 0;
}

fieldset {
  border: 1px solid var(--border-color);
  padding: var(--spacing-md);
  border-radius: var(--border-radius-lg);
}

legend {
  font-size: 2em;
  padding: 6px;
  color: var(--primary-color);
  font-weight: bold;
  margin-bottom: 10px;
  text-align: center;
}

.nasz_formularz_logowanie_logo {
  width: 90%;
  min-width: 60%;
  padding: 30px;
}

.nasz_formularz_logowanie_txt {
  color: var(--text-dark);
  font-size: 0.875rem;
  margin-top: 10px;
  text-align: left;
}

.forgot-password-link {
  display: inline-block;
  text-decoration: none;
  font-size: 0.875rem;
  text-align: center;
  transition: color 0.3s ease;
}

.forgot-password-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.zapomnialem_hasla_box {
  margin: auto;
  padding: 3% 0;
  color: var(--text-dark);
}

.tytul_karty_poj_nazwa {
  color: var(--primary-color);
  font-weight: bold;
  font-size: 2.4em;
  display: flex;
  padding: 30px;
  justify-content: center;
  margin-bottom: 50px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  background-color: var(--bg-darker);
}

.nazwa-pola-txt,
.tyt_txt_karta_poj {
  color: var(--primary-color);
  font-size: 14px;
  padding: 0 0 0 10px;
}

.text-rodo {
  text-align: justify;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: var(--spacing-sm);
  margin: 40px 0px 0px 0px;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.775rem;
  color: var(--border-color);
}

.disabled-input {
  opacity: 0.3;
  pointer-events: none;
}

input[type="file"] {
  display: none;
}

/* -----------------------------
   5. Navigation & Menu
----------------------------- */
nav {
  background-color: var(--bg-dark);
  width: 200px;
  position: fixed;
  top: 78px;
  bottom: 0;
  padding-top: var(--spacing-md);
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease-in-out;
  /* Zapobiega "wystawaniu" tekstu poza menu w trakcie animacji */
  overflow-x: hidden;
}

/* Podczas wczytywania (ustawiania stanu z localStorage) nie animujemy – usuwa "losowe" zwijanie/rozwijanie */
nav.no-transition,
nav.no-transition * {
  transition: none !important;
}

nav a {
  display: block;
  padding: 15px;
  text-decoration: none;
  background-color: var(--bg-darker);
  margin: 10px 5px;
  border-radius: var(--border-radius);
  font-weight: 600;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
  color: var(--text-light);
}

/* Specjalne przyciski menu: kalendarze (Napraw/Rezerwacji) */
nav a.nav-link-calendar {
  background-color: var(--nav-calendar-bg);
}

/* Linki menu jako flex (ikona + tekst) */
nav .nav-link {
  display: flex;
  align-items: center;
}

.menu-item-text {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  max-width: 220px;
  opacity: 1;
  /* Rozwijanie: najpierw poszerza się menu, potem pojawia tekst */
  transition:
    max-width 0.3s ease-in-out,
    opacity 0.15s ease 0.15s;
}

nav a:hover {
  background-color: var(--primary-color);
  color: var(--text-bialy);
  font-size: 0.875rem;
}

nav a.aktywny_program {
  background: linear-gradient(to right, var(--primary-color), var(--bg-dark));
  color: var(--text-bialy);
  margin: 10px 5px;
  border: 1px solid var(--primary-color);
}

.navbar-nav i {
  font-size: 24px;
  margin-right: 8px;
  color: var(--primary-color);
}

.navbar-nav .nav-item i {
  margin-right: 8px;
  font-size: 20px;
}

nav a:hover i,
nav a.aktywny_program i {
  color: var(--text-bialy);
}

.navbar-nav i:hover {
  transform: scale(1.2);
  transition: transform 0.3s;
}

/* Cienka przerwa między grupami menu (przegląd / flota / kalendarze / admin) */
.navbar-nav .nav-item-grupa {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-info {
  font-size: 0.875rem;
  color: var(--text-lighter);
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  margin-right: 0;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  list-style: none;
  z-index: 1000;
  max-width: 250px;
}

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--text-lighter);
  border-radius: 2px;
  margin: 0px;
}

.dropdown-menu a:hover {
  background: var(--primary-color);
  color: var(--text-bialy);
  margin: 0px;
}

.dropdown-menu i {
  margin-right: 8px;
}

.dropdown-menu.show {
  display: block;
  animation: fadeIn 0.2s ease;
}

body.light-theme .dropdown-menu a {
  color: var(--text-dark);
}
body.light-theme .dropdown-menu a:hover {
  color: var(--text-bialy);
}
body.light-theme .dropdown-menu a i.text-warning {
  color: #d39e00;
}
body.light-theme .dropdown-menu a i.text-primary {
  color: var(--primary-color);
}
body.light-theme .dropdown-menu a i.text-success {
  color: #28a745;
}

/* Dropdown menu dla kalendarza w nawigacji */
.nav-item.dropdown {
  position: relative;
}

.nav-item.dropdown .dropdown-toggle {
  cursor: pointer;
}

.nav-item.dropdown:hover .kalendarz-submenu,
.nav-item.dropdown .kalendarz-submenu.show {
  display: block;
}

.kalendarz-submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  min-width: 220px;
  z-index: 1000;
  margin-top: 5px;
}

.kalendarz-submenu .dropdown-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text-lighter);
  transition: all 0.2s;
  border-bottom: 1px solid var(--border-color);
}

.kalendarz-submenu .dropdown-item:last-child {
  border-bottom: none;
}

.kalendarz-submenu .dropdown-item:hover {
  background-color: var(--primary-color);
  color: var(--text-bialy);
}

.kalendarz-submenu .dropdown-item.active {
  background-color: rgba(25, 118, 210, 0.2);
  color: var(--primary-color);
  font-weight: 600;
}

.kalendarz-submenu .dropdown-item i {
  margin-right: 10px;
  font-size: 18px;
}

body.light-theme .kalendarz-submenu {
  background-color: #fff;
  border-color: #e0e0e0;
}

body.light-theme .kalendarz-submenu .dropdown-item {
  color: #333;
  border-bottom-color: #e0e0e0;
}

body.light-theme .kalendarz-submenu .dropdown-item:hover {
  background-color: #1976d2;
  color: #fff;
}

body.light-theme .kalendarz-submenu .dropdown-item.active {
  background-color: #e3f2fd;
  color: #1976d2;
}

.wyszukiwarka_wygaszony {
  color: var(--text-lighter);
}

.wyszukiwarka_wygaszony::placeholder {
  color: var(--text-lighter);
  opacity: 1;
}

.navbar-profile {
  display: flex;
  align-items: center;
  padding: 8px;
  transition: background-color 0.3s ease;
}

.navbar-profile:hover .fa-chevron-down {
  color: var(--primary-color);
  transform: rotate(180deg);
}

.fa-chevron-down {
  margin-left: 8px;
  color: var(--text-light);
  transition: all 0.3s ease;
}

.fa-chevron-down.rotated {
  transform: rotate(180deg);
  color: var(--text-bialy);
}

.rotated {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.menu-toggle-btn {
  background-color: var(--bg-darker);
  border: none;
  color: var(--text-light);
  width: 60px;
  height: 40px;
  font-size: 20px;
  cursor: pointer;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0px 5px 0px auto;
  transition: margin 0.3s ease-in-out;
  padding: 23px;
}

.menu-toggle-btn:hover {
  background-color: var(--primary-color);
  color: var(--text-bialy);
}

nav.minimized {
  width: 70px;
}

nav.minimized .menu-item-text {
  max-width: 0;
  opacity: 0;
  /* Zwijanie: tekst znika od razu, a menu zwęża się płynnie */
  transition:
    max-width 0.3s ease-in-out,
    opacity 0.05s ease;
}

nav.minimized .nav-link {
  justify-content: center;
}

/* W zwiniętym menu ikona traci prawy margines (po ukrytym tekście),
   dzięki czemu jest idealnie na środku — jak przycisk trzech kresek */
nav.minimized .nav-link i {
  margin-right: 0;
}

main.zalogowany.minimized {
  margin-left: 70px;
}

/* ===== KOMUNIKAT: WYLOGOWANIE Z POWODU BEZCZYNNOŚCI (LOGIN) ===== */
.timeout-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px;
  margin-bottom: 18px;
  border-radius: 6px;
  border: 1px solid rgb(236 105 16);
  background: rgb(255 125 0 / 14%);
  color: #aa1200;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.timeout-alert__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: rgb(236 105 16);
  border: 1px solid rgb(155 40 3);
  color: #cfc0b0;
}

.timeout-alert__title {
  font-weight: 800;
  margin-bottom: 2px;
  line-height: 1.2;
}

.timeout-alert__text {
  font-weight: 600;
  line-height: 1.25;
  opacity: 0.95;
}

/* -----------------------------
   6. Tables
----------------------------- */
table {
  width: 100%;
  border-spacing: 0;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-collapse: collapse;
  border: none;
}

table th {
  padding: 12px 15px;
  text-align: left;
  font-size: 0.875rem;
  color: var(--text-bialy);
  background-color: var(--bg-darker);
  font-weight: bold;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  position: relative;
  padding-right: 20px;
  white-space: nowrap;
  border: none;
}

table td {
  padding: 12px 15px;
  text-align: left;
  font-size: 0.875rem;
  background-color: var(--bg-dark);
  color: var(--text-light);
  border: none;
}

table tr:nth-child(even) td {
  background-color: var(--bg-darker);
}

table tr:hover td {
  background-color: rgb(252, 136, 70, 0.2);
}

table th:first-child,
table td:first-child {
  border-left-radius: var(--border-radius);
}

table th:last-child,
table td:last-child {
  border-right-radius: var(--border-radius);
}

table tr:last-child td:first-child {
  border-bottom-left-radius: var(--border-radius);
}

table tr:last-child td:last-child {
  border-bottom-right-radius: var(--border-radius);
}

table tr:not(:first-child) {
  border-top: 1px solid var(--border-color);
}

table td:not(:first-child) {
  border-left: 1px solid var(--border-color);
}

table td a {
  color: var(--primary-color);
  text-decoration: none;
}

table td a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.scrollable-table-wrapper {
  max-height: 645px;
  overflow-y: hidden;
  position: relative;
  transition: overflow-y 0.3s ease;
}

.scrollable-table-wrapper::-webkit-scrollbar {
  width: 4px;
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* Ten pasek jest szeroki na 4 px, więc strzałki z globalnej reguły by się na
   nim nie zmieściły */
.scrollable-table-wrapper::-webkit-scrollbar-button {
  display: none;
}

.scrollable-table-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 10px;
  /* Ten pasek ma tylko 4 px, więc odstęp z globalnej reguły zjadłby cały
     uchwyt - tutaj świadomie go zdejmujemy */
  border: 0;
}

.scrollable-table-wrapper::-webkit-scrollbar-track {
  background-color: var(--bg-dark);
  box-shadow: none;
}

.scrollable-table-wrapper:hover {
  overflow-y: auto;
}

.scrollable-table-wrapper:hover::-webkit-scrollbar {
  opacity: 1;
}

.sort-arrows {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 16px;
  color: #596574;
  transition:
    transform 0.3s ease,
    color 0.3s ease;
}

.sort-arrows i {
  font-size: 16px;
  transition:
    transform 0.3s ease,
    color 0.3s ease;
}

.sorting_asc .mdi-chevron-up,
.sorting_desc .mdi-chevron-down {
  color: var(--primary-color);
  font-size: 18px;
}

.sorting_disabled .mdi-chevron-up,
.sorting_disabled .mdi-chevron-down {
  color: #596574;
}

/* -----------------------------
   7. Buttons
----------------------------- */
input[type="button"] {
  display: inline-block;
  width: 100%;
  padding: 10px 20px;
  text-align: center;
  cursor: pointer;
  border-radius: var(--border-radius);
  box-sizing: border-box;
}

.btn-dodaj,
.btn-grey,
.btn-grey_zapisz,
.btn-usun,
.file-upload-btn {
  border-radius: var(--border-radius);
  border: none;
  box-sizing: border-box;
  color: white;
  cursor: pointer;
  margin: 10px 0;
  /*max-width: 180px;*/
  padding: 10px;
  text-align: center;
  transition: all 0.3s ease-in-out;
  width: 100%;
}

.btn-dodaj {
  background-color: var(--primary-color);
  font-size: 0.875rem;
}

.btn-dodaj:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.btn-grey,
.file-upload-btn {
  background-color: #3a4c55;
}

.btn-grey:hover,
.file-upload-btn:hover {
  background-color: #4d6069;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.btn-grey_zapisz {
  background-color: #3a4c55;
  /*font-size: 16px;*/
}

.btn-grey_zapisz:hover {
  font-weight: 600;
  color: #212a34;
  background-color: #00b500;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.btn-usun {
  background-color: #3a4c55;
  color: #212a34;
  font-size: 16px;
  font-weight: 600;
}

.btn-usun:hover {
  background-color: #ff0000;
  transform: translateY(-2px);
}

.form-buttons {
  display: flex;
  justify-content: space-around;
  gap: 15px;
  margin-top: 20px;
}

.glitch-btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--primary-color);
  color: #000;
  text-decoration: none;
  border-radius: 5px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  z-index: 3;
}

.glitch-btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.powrot-link {
  display: inline-block;
  padding: 10px 20px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 5px;
  transition: all 0.3s ease;
  z-index: 3;
  animation: glitch-text-animation 2s infinite;
}

.powrot-link:hover {
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* -----------------------------
   8. Messages & Status Indicators
----------------------------- */
.status-wolny {
  color: var(--status-free);
}

.status-wypozyczony {
  color: var(--status-rented);
  font-weight: bold;
}

.status-zarezerwowany {
  color: var(--status-reserved);
}

.status-w_naprawie {
  color: var(--status-repair);
}

/* Style dla pojazdów z przekroczonym terminem zwrotu */
.overdue-rental {
  background-color: #fff3cd !important;
  border-left: 4px solid #ff5c00;
}

.overdue-icon {
  font-size: 1.2em;
  margin-right: 5px;
  vertical-align: middle;
}

.overdue-badge {
  display: inline-block;
  background-color: #dc3545;
  color: #fff;
  font-size: 0.75em;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-zalogowany {
  color: var(--status-free);
}

.status-zablokowany {
  color: var(--status-rented);
  font-weight: bold;
}

.edytowany-status {
  color: var(--text-dark);
  cursor: not-allowed;
}

.error-message {
  color: var(--status-rented);
  font-size: 14px;
  text-align: center;
  margin-top: 10px;
}

.error {
  font-size: 0.9em;
  margin-top: 5px;
}

.success-message,
.sukces-komunikat,
.success-legend,
.komunikat-wyszukiwania {
  color: var(--status-free);
}

.message-container {
  margin-bottom: 15px;
}

.success-fieldset {
  border: 1px solid var(--status-free) !important;
}

.error-fieldset {
  border: 1px solid var(--status-rented) !important;
}

.error-legend {
  color: var(--status-rented) !important;
}

.sukces-komunikat,
.error-komunikat {
  padding: 15px;
  margin: 10px 0px 40px 0;
  border-radius: 4px;
  text-align: center;
  font-weight: 600;
}

.sukces-komunikat {
  background-color: rgb(0 181 0 / 10%);
  border: 1px solid var(--status-free) !important;
}

.error-komunikat {
  background-color: rgb(255 0 0 / 20%);
  border: 1px solid var(--status-rented);
}

/* Flash (sekcja A mockupu): baner OK / Error / Help pod tytułem formularza */
.flash-komunikat {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin: 0 0 16px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  text-align: left;
  max-width: 1180px;
}

.flash-komunikat--ok {
  border-color: var(--status-free);
  background: rgb(0 181 0 / 10%);
  color: var(--status-free);
}

.flash-komunikat--err {
  border-color: var(--status-rented);
  background: rgb(253 0 25 / 12%);
  color: var(--status-rented);
}

.flash-komunikat--help {
  border-color: var(--primary-color);
  background: rgb(255 92 0 / 8%);
  color: var(--primary-color);
}

.flash-komunikat__ikona {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid currentColor;
  position: relative;
}

.flash-komunikat--ok .flash-komunikat__ikona::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.flash-komunikat--err .flash-komunikat__ikona::before,
.flash-komunikat--err .flash-komunikat__ikona::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 3px;
  width: 2px;
  height: 10px;
  background: currentColor;
  border-radius: 1px;
}

.flash-komunikat--err .flash-komunikat__ikona::before {
  transform: rotate(45deg);
}

.flash-komunikat--err .flash-komunikat__ikona::after {
  transform: rotate(-45deg);
}

.flash-komunikat--help .flash-komunikat__ikona::after {
  content: "i";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
  border: none;
}

.flash-komunikat--ok .flash-komunikat__opis,
.flash-komunikat--err .flash-komunikat__opis,
.flash-komunikat--help .flash-komunikat__opis {
  color: inherit;
  opacity: 0.92;
}

.flash-komunikat__tresc {
  flex: 1;
  min-width: 0;
}

.flash-komunikat__tytul {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: inherit;
}

.flash-komunikat__opis {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-light);
}

body.light-theme .flash-komunikat__opis {
  color: var(--text-dark);
}

.ikony_wypozyczenia_toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 6px;
}

.etykieta_ikony_wyp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.88rem;
}

.etykieta_ikony_wyp input {
  margin: 0;
}

.lista_ikon_tablicy {
  margin-top: 6px;
}

.lista_ikon_tablicy summary {
  cursor: pointer;
  padding: 8px 10px;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-light);
  font-size: 0.88rem;
}

.lista_ikon_tablicy_licznik {
  color: var(--primary-color);
  font-weight: 700;
  margin-left: 6px;
}

.lista_ikon_tablicy_pozycje {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.lista_ikon_tablicy .etykieta_ikony_wyp {
  padding: 4px 0;
}

.wybor_logo_klienta {
  margin-top: 6px;
}

.rzad_wyboru_logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rzad_wyboru_logo select {
  flex: 1;
  min-width: 0;
}

.podglad_ikony_klienta {
  flex-shrink: 0;
  border-radius: 4px;
}

.siatka_logo_klienta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  max-height: 160px;
  overflow-y: auto;
  padding: 4px 0;
}

.kafelek_logo_klienta {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  min-width: 56px;
  font-size: 0.72rem;
  color: var(--text-light);
}

.kafelek_logo_klienta.aktywny,
.kafelek_logo_klienta:hover {
  border-color: var(--primary-color);
  background: rgb(255 92 0 / 8%);
}

.kafelek_logo_klienta span {
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.box_komunikatu {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 500px;
  transform: translate(-50%, -50%);
  background-color: var(--bg-darker);
  color: var(--text-light);
  text-align: center;
  padding: 30px 40px;
  border: 1px solid var(--primary-color);
  border-radius: 12px;
  max-width: 600px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  animation: fadeIn 0.5s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 99999;
}

.box_komunikatu h2 {
  font-size: 2.5em;
  color: var(--primary-color);
  margin-bottom: 20px;
  text-transform: uppercase;
  position: relative;
  animation: glitch-text-animation 2s infinite;
  text-shadow: 0 0 10px var(--primary-color);
}

.box_komunikatu p {
  font-size: 16px;
  line-height: 1.5;
  animation: glitch-text-animation 2.5s infinite;
}

.box_komunikatu-2 {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 500px;
  transform: translate(-50%, -50%);
  background-color: var(--bg-darker);
  color: var(--text-light);
  text-align: center;
  padding: 30px 40px;
  border: 1px solid var(--primary-color);
  border-radius: 12px;
  max-width: 600px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 99999;
}

.box_komunikatu-2 h2 {
  font-size: 2.5em;
  color: var(--primary-color);
  margin-bottom: 20px;
  text-transform: uppercase;
  position: relative;
}

.blurred {
  filter: blur(5px);
  pointer-events: none;
}

.komunikat_dodawania {
  font-size: 16px;
  color: var(--bg-dark);
  background-color: var(--border-color);
  padding: 10px;
  border-radius: 5px;
  margin-top: 10px;
}

.komunikat_dodania-ok {
  color: var(--status-free);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  padding: var(--spacing-md);
  margin: 40px auto;
  border-top: 4px solid var(--status-free);
  border-bottom: 4px solid var(--status-free);
  border-radius: 10px;
  width: auto;
  max-width: 80%;
  text-transform: uppercase;
}

.imieNazwiskoUzytkownika {
  color: var(--text-bialy);
  font-weight: bold;
  font-size: 2.2em;
  display: inline-block;
  padding: 10px;
}

.typ_konta {
  color: var(--text-lighter);
  font-weight: bold;
  font-size: 1em;
}

.history-box {
  min-width: 250px;
  color: var(--text-light);
  padding: 0 0 0 30px;
  border-radius: var(--border-radius);
}

/* -----------------------------
   9. Animations & Special Effects
----------------------------- */
@keyframes waveFlow1 {
  0% {
    transform: skewY(-10deg) translateY(-10%);
    opacity: 0.6;
  }
  50% {
    transform: skewY(-10deg) translateY(10%);
    opacity: 0.9;
  }
  100% {
    transform: skewY(-10deg) translateY(-10%);
    opacity: 0.6;
  }
}

@keyframes slideDown {
  0% {
    transform: translateY(-1%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes glitch-text-animation {
  0%,
  10% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transform: translateX(0) translateY(0);
    text-shadow: none;
  }
  2% {
    transform: translateX(-4px) skewX(-2deg) translateY(-2px);
    text-shadow:
      -4px 0 #ff0000,
      4px 0 #00ff00,
      0 -4px #0000ff;
  }
  4% {
    transform: translateX(4px) skewX(2deg) translateY(2px);
    text-shadow:
      -4px 0 #ffff00,
      4px 0 #ff00ff,
      0 4px #00ffff;
  }
  6% {
    transform: translateX(-3px) skewX(-1deg) translateY(0);
    text-shadow:
      -3px 0 #00ff00,
      3px 0 #ff0000,
      0 -3px #0000ff;
  }
  8% {
    transform: translateX(3px) skewX(1deg) translateY(-1px);
    text-shadow:
      -3px 0 #ff00ff,
      3px 0 #ffff00,
      0 3px #00ffff;
  }
}

.glitch-container {
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.glitch-box {
  padding: 30px;
  border-radius: 15px;
  background-color: transparent;
  color: #fff;
  font-family: "Arial Black", sans-serif;
  position: relative;
  overflow: hidden;
}

.glitch-title {
  font-size: 2.5em;
  margin: 0;
  text-transform: uppercase;
  animation: glitch-text-animation 2s infinite;
  position: relative;
  z-index: 2;
  color: #fff;
}

.glitch-text {
  font-size: 1.2em;
  margin: 10px 0;
  animation: glitch-text-animation 2.5s infinite;
  position: relative;
  z-index: 2;
  color: #fff;
}

/* -----------------------------
   10. Media Queries
----------------------------- */
@media (max-width: 768px) {
  .dropdown-menu {
    width: 100%;
    max-width: 250px;
    right: 10px;
  }
  .form-group {
    flex-direction: column;
    gap: 20px;
  }
  .form-group-item {
    min-width: 100%;
  }
  .top input[type="text"],
  .top input[type="submit"] {
    width: 100%;
  }
  nav {
    width: 100%;
  }
  .wyszukiwarka {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (min-width: 901px) {
  .pulpit-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(700px, 1fr));
    gap: 20px;
    max-width: 3440px;
  }
  .pulpit-container > h2 {
    grid-column: 1 / -1;
    margin-bottom: -10px;
  }
  .pulpit-container > .radial-charts {
    grid-column: 1 / -1;
  }
}

/* -----------------------------
   11. Print Styles (Optional)
----------------------------- */
@media print {
  .no-print {
    display: none;
  }
  body {
    background: none;
    color: #000;
  }
  main {
    margin: 0;
    padding: 0;
  }
}

/* -----------------------------
   12. Tabs
----------------------------- */
.tabs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
}

.tab-link {
  padding: 10px;
  cursor: pointer;
  color: #ffa877;
  background-color: #ff5c00;
  margin-right: 10px;
  margin-bottom: 20px;
  border-radius: 0px 0px 6px 6px;
  transform: translateY(-2px);
  transition: all 0.3s ease-in-out;
}

.tab-link.active {
  background-color: #ff5c00;
  color: white;
  box-shadow: 0px 6px 5px rgba(0, 0, 0, 0.2);
  transform: translateY(0px);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.selected {
  background: linear-gradient(to top, #1670ce, #007dff);
  color: #9cdeff;
  font-weight: bold;
  text-shadow: 0px 0px 2px black;
}

/* Dzień zwrotu (nakładka na zakres .selected) */
.selected-return {
  box-shadow:
    0 0 0 2px #007dff inset,
    0 0 0 1px rgba(0, 0, 0, 0.25);
}

/* Jeśli dzień zwrotu jest też w zakresie (.selected), nie zmieniaj tła – tylko ramkę */
.selected.selected-return {
  box-shadow:
    0 0 0 2px #007dff inset,
    0 0 0 1px rgba(0, 0, 0, 0.25);
}

/* -----------------------------
   13. Charts & Statistics
----------------------------- */
.stats-container {
  max-width: 725px;
  margin: 60px 0;
  display: flex;
  color: var(--text-light);
  background-color: var(--bg-dark);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: slideDown 1s ease-out forwards;
}

.stats-container legend {
  font-size: 24px;
  color: var(--primary-color);
  padding: 0 10px;
}

.stats-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 20px;
}

.dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  color: #666;
  font-size: 24px;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 8px 16px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
}

.dropdown-item:hover {
  background-color: #f5f5f5;
}

.radial-charts {
  display: flex;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  gap: 5px;
}

.radial-chart {
  flex: 1;
  display: flex;
  align-items: center;
  background-color: var(--bg-darker);
  padding: 15px;
  border-radius: var(--border-radius);
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.3);
  margin: 50px 0px 0px 0px;
}

.chart-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  color: #93e41c;
  flex-shrink: 0;
}

.chart-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chart-info h3 {
  margin: 0;
  font-size: 1em;
  font-weight: bold;
  color: var(--primary-color);
  padding-bottom: 0;
}

.chart-info p {
  margin: 0;
  font-weight: normal;
  font-size: 1.1em;
}

.chart-details {
  margin-top: 5px;
  font-size: 0.9em;
  color: #b0b0b0;
}

.chart-details p {
  font-size: 0.9em;
  font-weight: normal;
  margin: 0;
}

.change-indicator .material-icons-outlined {
  font-size: 1em;
  vertical-align: text-bottom;
  margin-right: 2px;
}

.increase,
.decrease,
.bosks_procentys {
  width: 60px;
  height: 37px;
  border-radius: 7px;
  padding: 6px;
}

.increase {
  color: #93e41c;
  background: rgba(0, 210, 91, 0.11);
}

.decrease {
  background: rgba(252, 66, 74, 0.11);
  color: #ff0000;
}

.bosks_procentys {
  background: rgba(0, 210, 91, 0.11);
  color: #00d25b;
}

.peity-donut {
  display: none;
}

.peity {
  width: 100%;
  height: 100%;
}

.chart-days {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  font-weight: bold;
  color: #fff;
}

.bar-chart {
  padding: 20px 0px 0px 0px;
  background-color: var(--bg-dark);
  border-radius: 12px;
  overflow-x: auto;
}

.bar-chart svg text {
  font-family: "Helvetica, Arial, sans-serif";
  fill: #9ba7b2;
}

.bar-chart svg .xaxis-label {
  font-size: 12px;
}

.bar-chart svg .yaxis-label {
  font-size: 11px;
}

#rentalChart {
  max-width: 100%;
}

.tooltip {
  position: absolute;
  background-color: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
  z-index: 10;
}

.chart-container-svg {
  background-color: #2a2a38;
  border-radius: 15px;
  padding: 20px;
  margin: 25px auto;
  max-width: 680px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid #3a3a4c;
}

.chart-subtitle-svg {
  color: #b0b0b0;
  text-align: center;
  font-size: 0.85em;
  margin-bottom: 15px;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.month-label,
.year-label,
.day-label,
.bar-label {
  opacity: 0;
}

.month-label {
  fill: var(--primary-color);
  font-size: 14px;
  font-weight: bold;
}

.year-label {
  fill: #9a9a9a;
  font-size: 11px;
}

.day-label {
  fill: #999;
  font-size: 10px;
}

.bar-label {
  fill: var(--text-light);
  font-weight: lighter;
  font-size: 11px;
  pointer-events: none;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.chart-bar {
  transition:
    opacity 0.3s ease-out,
    transform 0.3s ease-out;
  cursor: pointer;
  transform-box: fill-box;
}

.chart-bar.is-dimmed {
  opacity: 0.25;
}

#svg-tooltip {
  position: absolute; /* Kluczowe do pozycjonowania */
  display: none; /* Domyślnie ukryty */
  background-color: rgba(25, 28, 36, 0.95); /* Ciemne tło z przezroczystością */
  color: #fff;
  padding: 10px 10px 10px 10px;
  border-radius: 8px;
  font-size: 14px;
  pointer-events: none; /* Ważne, aby tooltip nie blokował myszki */
  z-index: 1000;
  border: 1px solid var(--primary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  line-height: 1.5;

  /* === NOWE ZMIANY === */
  max-width: 600px; /* Maksymalna szerokość dymka */
  word-wrap: break-word; /* Zapewnia, że długie słowa bez spacji będą łamane */
}

#svg-tooltip strong {
  display: block;
  margin-bottom: 0px;
  font-size: 16px;
  font-weight: bold;
  color: var(--primary-color);
}

.tooltip-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.legend-btn {
  background-color: #4a4a58;
  color: #fff;
  border: 1px solid #6a6a78;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  margin: 0 5px;
  transition: all 0.25s ease-out;
}

.legend-btn:not(.inactive):hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.legend-btn.inactive {
  opacity: 0.4;
}

.legend-btn[data-series="rented"].active {
  background: linear-gradient(90deg, #1e88e5, var(--bg-dark));
  border-color: #1e88e5;
}

.legend-btn[data-series="repair"].active {
  background: linear-gradient(90deg, var(--primary-color), var(--bg-dark));
  border-color: var(--primary-color);
}

.legend-series {
  display: flex;
  align-items: center;
}

.legend-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
}

.legend-text {
  font-size: 14px;
  color: var(--text-lighter);
}

.chart-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  text-align: center;
}

.sort-controls-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.sort-controls-container > div {
  display: flex;
  flex-direction: column;
}

.sort-toggle-group {
  display: inline-flex;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 20px;
  border: 1px solid #4a4a58;
}

.sort-toggle-btn {
  background: transparent;
  color: #a0a0b0;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  border-radius: 20px;
}

.sort-toggle-btn .material-icons-outlined {
  font-size: 18px;
}

.sort-toggle-btn.is-active {
  background-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sort-toggle-btn:not(.is-active):hover {
  color: #fff;
}

.chart-type-controls {
  display: inline-flex;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 20px;
  border: 1px solid #4a4a58;
}

.chart-type-btn {
  background: transparent;
  color: #a0a0b0;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  border-radius: 20px;
}

.chart-type-btn.is-active {
  background-color: #007bff;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chart-type-btn:not(.is-active):hover {
  color: #fff;
}

.chart-menu {
  position: absolute;
  top: 10px;
  right: 10px;
}

/* Przycisk trzech kropek na wykresach/boksach — bez tła, kompaktowy,
   żeby nie zasłaniał zawartości (np. procentów w boksach KPI) */
.chart-menu .menu-toggle-btn {
  background: transparent;
  width: auto;
  height: auto;
  padding: 4px;
  color: var(--text-light);
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.chart-menu .menu-toggle-btn .material-icons-outlined {
  font-size: 18px;
}

/* Kropki w pełni widoczne dopiero po najechaniu na boks/wykres lub przy otwartym menu */
.radial-chart:hover .chart-menu .menu-toggle-btn,
.form-group-2obrys_w_karcie_dark:hover .chart-menu .menu-toggle-btn,
.chart-menu.active .menu-toggle-btn {
  opacity: 1;
}

.chart-menu .menu-toggle-btn:hover {
  background: transparent;
  color: var(--primary-color);
}

/* Rozwijana lista "Ukryj" — mocniejszy cień, czytelna na tle wykresu */
.chart-menu .dropdown-menu {
  min-width: 120px;
  border: 1px solid var(--border-color);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

/* Odsunięcie procentu zmiany w boksach KPI od prawej krawędzi (i od menu) */
.pulpit-container.panel_statystyk .kpi_zmiana {
  margin-right: 8px;
}

.chart-menu.active .dropdown-menu {
  display: block;
}

@keyframes drawBar {
  from {
    transform: scaleX(2);
  }
  to {
    transform: scaleX(1);
  }
}
@keyframes fadeInBlur {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}
.bar-rented,
.bar-repair {
  transform-origin: left;
  transition:
    x 0.4s cubic-bezier(0.23, 1, 0.32, 1),
    width 0.4s cubic-bezier(0.23, 1, 0.32, 1),
    opacity 0.3s ease;
}
.animated-bar,
.animated-text,
.bar-bg {
  animation-fill-mode: forwards;
}
.animated-bar {
  animation-name: drawBar;
  animation-duration: 0.9s;
  animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
}
.animated-text {
  animation-name: fadeInBlur;
  animation-duration: 0.7s;
  animation-timing-function: ease-out;
}
.bar-bg {
  fill: rgba(70, 70, 90, 0.2);
  animation-name: fadeInBlur;
  animation-duration: 0.5s;
}
.animated-bar-vertical {
  transform-origin: bottom;
  animation: growBar 0.9s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}
@keyframes growBar {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}
.chart-line {
  animation: dash 1.5s ease-out forwards;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}
@keyframes dash {
  to {
    stroke-dashoffset: 0;
  }
}
.chart-point {
  animation: fadeIn 0.5s ease-out forwards;
  opacity: 0;
}

/* -----------------------------
   14. Vehicle Display Boxes
----------------------------- */
.pojazdy-container {
  /* Punkt zaczepienia dla warstwy cienia pod obracającym się kafelkiem.
     isolation zamyka ją w tym kontenerze - z-index: -1 nie ucieknie wtedy
     pod tło elementów nadrzędnych, a zostanie pod kafelkami. */
  position: relative;
  isolation: isolate;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 20px;
  justify-content: center;
}

.box_pojazdu {
  position: relative;
  background: url(../zdjecia/TloRamki-2048x546-2.png);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: left;
  border: 1px solid #3a4c55;
  width: 320px;
  padding: 10px 4px 10px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 4px 4px 7px rgba(0, 0, 0, 0.4);

  /* Usuwamy border-radius, bo zastępujemy go clip-path */
  border-radius: var(--border-radius);

  /* Zaokrąglone trzy rogi + ścięty prawy dolny */
  clip-path: polygon(
    0 0,
    /* lewy górny */ 100% 0,
    /* prawy górny */ 100% calc(100% - 20px),
    /* początek ścięcia */ calc(100% - 20px) 100%,
    /* koniec ścięcia */ 0 100%,
    /* lewy dolny */ 0 0 /* z powrotem do początku */
  );
}

/* clip-path ucina border na skosie, więc krawędź narożnika dorysowujemy sami.
   Kwadrat 20x20 wysunięty o 1px pokrywa się z linią ścięcia z clip-path. */
.box_pojazdu::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 20px;
  height: 20px;
  pointer-events: none;
  background: linear-gradient(
    to bottom right,
    transparent calc(50% - 1px),
    #3a4c55 calc(50% - 1px),
    #3a4c55 50%,
    transparent 50%
  );
}

.box_pojazdu:hover {
  transform: translateY(-3px);
  box-shadow: 8px 8px 7px rgba(0, 0, 0, 0.4);
}

/* Zwrot bliski: cienka jasna ramka + ciasny puls jak we wzorze B.
   Blask na otoczce, skos zostaje na kafelku (clip-path).
   Otoczka rozciąga się w rzędzie, żeby kafelek nie kuczał przy braku danych. */
.otoczka_kafelka_zwrotu {
  display: flex;
  flex: 0 0 auto;
  align-self: stretch;
  animation: pulsObwodkiZwrotuJutro 1.8s ease-in-out infinite;
}

.box_pojazdu.kafelek_zwrot_jutro {
  border-color: #ff5c00;
}

.box_pojazdu.kafelek_zwrot_jutro::after {
  background: linear-gradient(
    to bottom right,
    transparent calc(50% - 1px),
    #ff5c00 calc(50% - 1px),
    #ff5c00 50%,
    transparent 50%
  );
}

.box_pojazdu .obwodka_zwrotu_jutro {
  display: none;
}

@keyframes pulsObwodkiZwrotuJutro {
  0%,
  100% {
    filter: drop-shadow(0 0 3px rgba(255, 94, 0, 0.6));
  }
  50% {
    filter: drop-shadow(0 0 4px rgb(255, 94, 0));
  }
}

.box_pojazdu .plakietka_zwrot_jutro {
  position: absolute;
  top: 2px;
  right: 4px;
  z-index: 7;
  max-width: 86px;
  padding: 0px 15px;
  border-radius: 3px;
  background: var(--primary-color);
  color: #3a4652;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: normal;
  pointer-events: none;
}

/* Kafelek, który zmienił stan po odświeżeniu tablicy: pełny obrót wokół osi
   poziomej (jak przewracana kartka) w ciągu ok. 1,4 s, a potem spokojne
   zanikanie pomarańczowej obwódki przez kolejne dwie sekundy.
   Podświetlenie rysujemy wewnątrz kafelka (inset), bo clip-path ucina
   wszystko, co wychodzi poza jego krawędź. */
.box_pojazdu.kafelek_zmieniony {
  animation: obrotZmienionegoKafelka 3.6s ease-in-out 1;
}

@keyframes obrotZmienionegoKafelka {
  0% {
    transform: perspective(1200px) rotateX(0deg);
  }
  38%,
  100% {
    transform: perspective(1200px) rotateX(360deg);
  }
}

/* Obwódka jest osobną warstwą NAD treścią kafelka. Cień wewnętrzny malował się
   pod ikonami i plakietkami, więc znikał za nimi. Skos w prawym dolnym
   narożniku dorysowujemy tłem, bo clip-path ucina tam prostą krawędź. */
.box_pojazdu.kafelek_zmieniony::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 6;
  pointer-events: none;

  /* Bez animacji warstwa jest niewidoczna - inaczej obwódka zostawałaby
     na kafelku po zakończeniu obrotu, aż do kolejnego odświeżenia */
  opacity: 0;
  border: 3px solid var(--status-free);
  /* Prawy dolny róg bez zaokrąglenia - tam kończy się ścięcie z clip-path */
  border-radius: var(--border-radius) var(--border-radius) 0
    var(--border-radius);
  /* Kwadrat 20x20 dokładnie jak ścięcie, linia po jego wewnętrznej stronie,
     żeby clip-path jej nie odciął i żeby domykała obie krawędzie obwódki.
     background-origin musi być border-box, bo domyślnie tło liczy się od
     wewnętrznej krawędzi ramki i skos byłby wsunięty o jej grubość. */
  background-image: linear-gradient(
    to bottom right,
    transparent calc(50% - 4px),
    var(--status-free) calc(50% - 4px),
    var(--status-free) 50%,
    transparent 50%
  );
  background-origin: border-box;
  background-size: 20px 20px;
  background-position: right bottom;
  background-repeat: no-repeat;
  /* Dwie osobne animacje: pierwsza trzyma obwódkę na pełnej mocy przez 20,6 s,
     druga startuje dokładnie po niej i przez 5 s gasi ją równomiernie do zera.
     Rozbicie na dwie pozwala zmieniać oba czasy niezależnie, bez przeliczania
     progów w klatkach kluczowych. Całość trwa więc 25,6 s. */
  animation:
    obwodkaZmienionegoKafelka 10.6s linear 1,
    zanikObwodkiKafelka 5s linear 10.6s 1 forwards;
  box-shadow: inset 0 0 15px 5px var(--status-free);
}

@keyframes obwodkaZmienionegoKafelka {
  from,
  to {
    opacity: 1;
  }
}

/* forwards w deklaracji wyżej zostawia zero po zakończeniu - bez tego warstwa
   wróciłaby do bazowego opacity i mrugnęłaby na koniec */
@keyframes zanikObwodkiKafelka {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Cień na "podłodze" pod obracającym się kafelkiem. Musi być osobną warstwą w
   kontenerze, bo cień samego kafelka obraca się razem z nim, a clip-path
   spłaszcza scenę 3D, więc kontr-obrót wewnątrz kafelka nie zadziała.
   Pozycję, rozmiar oraz usunięcie po animacji obsługuje JS w tablica.php. */
.cien_obrotu_kafelka {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  border-radius: var(--border-radius);
  background: rgba(0, 0, 0, 0.5);
  filter: blur(7px);
  animation: cienObrotuKafelka 1.7s ease-in-out 1;
}

/* Obrót kafelka trwa pierwsze 1,37 s, więc "kant" wypada około 32% i 63% tej
   osi czasu - z doliczonym opóźnieniem 0,12 s, żeby cień reagował chwilę po
   kafelku. W tych momentach plama zwęża się i ciemnieje, potem znów rozlewa. */
@keyframes cienObrotuKafelka {
  0% {
    transform: translate(4px, 4px) scaleY(1);
    opacity: 0;
  }
  6% {
    transform: translate(4px, 4px) scaleY(1);
    opacity: 0.85;
  }
  32% {
    transform: translate(4px, 2px) scaleY(0.32);
    opacity: 1;
  }
  47% {
    transform: translate(4px, 4px) scaleY(0.92);
    opacity: 0.85;
  }
  63% {
    transform: translate(4px, 2px) scaleY(0.32);
    opacity: 1;
  }
  84% {
    transform: translate(4px, 4px) scaleY(1);
    opacity: 0.85;
  }
  100% {
    transform: translate(4px, 4px) scaleY(1);
    opacity: 0;
  }
}
.box_content {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) minmax(0, 30%);
  grid-template-rows: 1fr auto;
  align-items: stretch;
}
.kolumna_lewa {
  grid-row: 1 / -1;
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.kolumna_srodkowa {
  width: auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.kolumna_prawa {
  width: auto;
  min-width: 0;
}
.info_kategoria {
  background-color: rgb(15 19 24 / 50%); /* Ustal domyślny kolor tła */
  margin: 5px 0px; /* Ustal margines między prostokątami */
  padding: 5px;
  border-radius: 4px;
  text-align: center;
  font-weight: bold;
  font-size: 2em;
}

.info_nr_katalogowy {
  background-color: rgb(15 19 24 / 50%); /* Ustal domyślny kolor tła */
  margin: 5px 0px; /* Ustal margines między prostokątami */
  padding: 5px;
  border-radius: 4px;
  text-align: center;
  font-weight: bold;
  font-size: 2em;
  color: var(--bg-darker);
}

.info_uwagi_kafelka {
  grid-column: 2 / -1;
  min-width: 0;
  height: 28px;
  margin: -6px 0 -7px 10px;
  padding: 0;
  font-size: 0.7rem;
  line-height: 28px;
  color: var(--status-reserved);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hr {
  border: none;
  height: 1px;
  background-color: var(--status-free);
  margin: -6px -12px 0px -12px;
  width: 176px;
}

.uwagi {
  margin-top: 10px;
}
.ikony_prawe {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: auto; /* Umożliwia wyrównanie ikon do dołu */
}

.box_header,
.box_footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.box_body {
  text-align: center;
  flex-grow: 1;
}

.nazwa_pojazdu {
  font-size: 1.8em; /* Początkowy rozmiar czcionki */
  font-weight: bold;
  padding: 2px 10px 10px 20px;
  white-space: normal; /* Umożliwia zawijanie tekstu */
  word-wrap: break-word; /* Umożliwia zawijanie słów */
  overflow: hidden; /* Ukrywa tekst, który wychodzi poza kontener */
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Ogranicza do 2 linii */
  -webkit-box-orient: vertical;
  text-overflow: ellipsis; /* Dodaje '...' jeśli tekst jest za długi */
  line-height: 1.2em; /* Wysokość linii */
  max-height: 2.8em; /* Maksymalna wysokość dla dwóch linii */
  text-shadow: 1px 1px 3px black;
}

.nr_rejestracyjny,
.marka_pojazdu {
  font-size: 1em;
  color: var(--text-dark);
}

.ikonka {
  height: 32px;
}

.ikonka_ubezpieczenia {
  width: 80px;
  margin-top: 10px;
}

/* -----------------------------
   15. Legend / Footer
----------------------------- */
.legenda {
  border-top: 1px solid #555;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 14px;
  z-index: 1000;
}

.legenda-kolor {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: inline-block;
}

.group-title {
  text-align: center;
  margin: 20px;
  color: var(--primary-color);
}

.legenda-item {
  display: flex;
  align-items: center;
  gap: 5px; /* Odstęp między opisem a licznikiem */
  border: 1px solid #555;
  border-radius: 4px;
}
.legenda-opis {
  padding: 5px 8px;
}
.legenda-licznik {
  color: white;
  padding: 5px;
  min-width: 30px;
  text-align: center;
  border-radius: 4px;
  font-weight: bold;
}

/* Ustawienie koloru tła dla każdego statusu w legendzie */
.legenda-licznik.status-wypozyczony {
  background-color: var(--status-rented);
  color: #fff !important; /* Używamy !important, aby mieć pewność, że tekst będzie biały */
}

.legenda-licznik.status-zarezerwowany {
  background-color: var(--status-reserved);
  color: #fff !important;
}

.legenda-licznik.status-wolny {
  background-color: var(--status-free);
  color: #000 !important; /* Czarny tekst dla lepszego kontrastu na jasnym zielonym tle */
}

.legenda-licznik.status-w-naprawie {
  background-color: var(--status-repair);
  color: #000 !important; /* Czarny tekst dla lepszego kontrastu na jasnym pomarańczowym tle */
}

/* Styl dla licznika sumy, aby pasował do reszty */
.legenda-licznik.status-suma {
  background-color: #3a4c55;
  color: #fff !important;
}

.etykieta {
  display: inline-block;
  white-space: nowrap; /* najważniejsze! */
  vertical-align: middle;
}

.popup {
  position: absolute;
  width: 600px;
  height: 300px;
  background-color: white;
  border: 1px solid #ccc;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  padding: 10px;
  overflow: auto; /* Umożliwia przewijanie, jeśli treść jest zbyt długa */
}
.popup_content {
  /* Dostosuj style wewnętrznego kontenera, jeśli to konieczne */
}
.popup_nazwa_pojazdu {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
}

/* -----------------------------
   16. Calendar Styles
----------------------------- */
/* Kontener kalendarza */
#calendar {
  background-color: var(--bg-dark);
  padding: 20px;
  border-radius: var(--border-radius-lg);
  box-shadow: 7px 7px 10px rgba(0, 0, 0, 0.3);
  margin: 20px 0;
  min-height: 600px;
}

/* Nagłówek kalendarza */
.fc-header-toolbar {
  padding: 10px !important;
  margin-bottom: 1.5em !important;
  background-color: var(--bg-darker);
  border-radius: var(--border-radius);
}

.fc-toolbar-title {
  color: var(--primary-color) !important;
  font-size: 1.5em !important;
  font-weight: 600 !important;
}

/* Przyciski w kalendarzu */
.fc-button {
  background-color: var(--bg-darker) !important;
  border-color: var(--border-color) !important;
  color: var(--text-light) !important;
  padding: 8px 16px !important;
  transition: all 0.3s ease !important;
}

.fc-button:hover {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: var(--text-bialy) !important;
}

.fc-button-active {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  color: var(--text-bialy) !important;
}

/* Style dla wydarzeń */
.fc-event {
  border: none !important;
  padding: 2px 5px !important;
  margin: 1px 0 !important;
  cursor: pointer !important;
  border-radius: var(--border-radius) !important;
}

.fc-event-title {
  font-weight: 500 !important;
  padding: 2px !important;
}

/* Kolory statusów napraw */
.repair-status-new {
  background-color: #90ee90 !important;
  border-color: #90ee90 !important;
  color: #000000 !important;
}

.repair-status-in-progress {
  background-color: #006400 !important;
  border-color: #006400 !important;
  color: var(--text-bialy) !important;
}

.repair-status-waiting {
  background-color: #808080 !important;
  border-color: #808080 !important;
  color: var(--text-bialy) !important;
}

.repair-status-delayed {
  background-color: #ff0000 !important;
  border-color: #ff0000 !important;
  color: var(--text-bialy) !important;
}

.repair-status-ready {
  background-color: #0000ff !important;
  border-color: #0000ff !important;
  color: var(--text-bialy) !important;
}

.repair-status-completed {
  background-color: #d3d3d3 !important;
  border-color: #d3d3d3 !important;
  color: #000000 !important;
}

/* Style dla modali */
.repair-modal {
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
}

.repair-modal .modal-header {
  background-color: var(--bg-darker);
  border-bottom: 1px solid var(--border-color);
  padding: 15px 20px;
}

.repair-modal .modal-title {
  color: var(--primary-color);
  font-weight: 600;
}

.repair-modal .modal-body {
  padding: 20px;
}

/* Style dla formularzy w modalach */
.repair-form .form-label {
  color: var(--text-light);
  margin-bottom: 5px;
}

.repair-form .form-control {
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  border-radius: var(--border-radius);
}

.repair-form .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(255, 92, 0, 0.25);
}

/* Style dla legendy i limitów */
.calendar-info-card {
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  margin-bottom: 20px;
}

.calendar-info-card .card-header {
  background-color: var(--bg-darker);
  border-bottom: 1px solid var(--border-color);
  padding: 15px 20px;
}

.calendar-info-card .card-title {
  color: var(--primary-color);
  margin: 0;
  font-size: 1.1em;
  font-weight: 600;
}

.calendar-info-card .card-body {
  padding: 15px 20px;
}

/* Status dot w legendzie */
.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  border: 1px solid var(--border-color);
}

/* Ikona wykrzyknika dla opóźnień */
.delay-warning {
  color: #ff0000;
  margin-left: 5px;
  animation: blink 1s infinite;
}

@keyframes blink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* Responsywność */
@media (max-width: 768px) {
  #calendar {
    padding: 10px;
    margin: 10px 0;
  }

  .fc-toolbar-title {
    font-size: 1.2em !important;
  }

  .fc-button {
    padding: 6px 12px !important;
    font-size: 0.9em !important;
  }

  .calendar-info-card {
    margin-bottom: 15px;
  }
}

/* Style dla historii napraw */
.repair-history {
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  background-color: var(--bg-darker);
  border-radius: var(--border-radius);
}

.repair-history-item {
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 5px;
}

.repair-history-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.repair-history-date {
  color: var(--primary-color);
  font-weight: 600;
}

.repair-history-status {
  margin-left: 10px;
  padding: 2px 6px;
  border-radius: var(--border-radius);
  font-size: 0.9em;
}

/* Toast notifications */
.calendar-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1060;
  min-width: 250px;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.calendar-toast.success {
  border-left: 4px solid var(--status-free);
}

.calendar-toast.error {
  border-left: 4px solid var(--status-rented);
}

.calendar-toast-header {
  padding: 10px 15px;
  background-color: var(--bg-darker);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-toast-body {
  padding: 15px;
  color: var(--text-light);
}

/* Style dla legendy statusów */
.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  padding: 15px;
  background-color: var(--bg-dark);
  border-radius: var(--border-radius);
  margin-bottom: 20px;
}

.status-legend-item {
  display: flex;
  align-items: center;
  padding: 5px 10px;
  background-color: var(--bg-darker);
  border-radius: var(--border-radius);
  min-width: 200px;
}

.status-text {
  color: var(--text-light);
  font-size: 0.9em;
}

/* Style dla limitów dziennych */
.daily-limits {
  margin-top: 20px;
}

.limits-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: space-between;
}

.limit-item {
  display: flex;
  align-items: center;
  padding: 8px 15px;
  background-color: var(--bg-darker);
  border-radius: var(--border-radius);
  min-width: 180px;
}

.limit-item .day {
  color: var(--primary-color);
  font-weight: 600;
  margin-right: 8px;
}

.limit-item .count {
  color: var(--text-light);
}

/* ===== BELKA FILTRÓW TABLICY POJAZDÓW (pasek + rozwijana szuflada) ===== */
.belka_tablicy {
  position: relative;
  padding: 10px 20px 0;
}

.belka_tablicy_pasek {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}

.wskazowka_kafelkow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 0;
  padding: 10px 12px 10px 14px;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
  border-radius: var(--border-radius-lg);
  color: var(--text-bialy);
  font-size: 0.9em;
  line-height: 1.4;
}

html.ukryj_wskazowke_kafelkow .wskazowka_kafelkow {
  display: none;
}

.wskazowka_kafelkow p {
  margin: 0;
  flex: 1;
}

.wskazowka_kafelkow_zamknij {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--primary-color);
  font-size: 1.4em;
  line-height: 1;
  cursor: pointer;
}

.belka_szukajka,
.belka_sortowanie,
.belka_przycisk_filtrow,
.belka_przycisk_maks,
.belka_przycisk_drukuj,
.belka_chip_terminy,
.kafelek_statusu {
  min-height: 46px;
  height: auto;
  box-sizing: border-box;
}

.belka_szukajka {
  position: relative;
  flex: 1 1 220px;
  max-width: 320px;
}

.belka_szukajka svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-dark);
  stroke-width: 2;
  pointer-events: none;
}

.belka_szukajka input {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 32px 0 34px;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  color: var(--text-bialy);
  font-size: 0.9em;
  box-sizing: border-box;
}

.belka_sortowanie {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
}

.belka_sortowanie .etykieta {
  color: var(--text-dark);
  font-size: 0.85em;
}

.belka_sortowanie select {
  margin: 0;
  padding: 0 6px;
  height: 100%;
  background-color: transparent;
  border: none;
  color: var(--primary-color);
  font-size: 0.9em;
  cursor: pointer;
}

.belka_kierunek {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background-color: transparent;
  border: none;
  border-radius: var(--border-radius);
  color: var(--primary-color);
  cursor: pointer;
}

.belka_kierunek:hover {
  background-color: rgba(255, 92, 0, 0.12);
}

.belka_kierunek svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Aktywny kierunek pełnym pomarańczem, nieaktywny przygaszony */
.belka_kierunek .strzalka_dol {
  opacity: 0.35;
}

.belka_kierunek.kierunek_malejaco .strzalka_gora {
  opacity: 0.35;
}

.belka_kierunek.kierunek_malejaco .strzalka_dol {
  opacity: 1;
}

.belka_przycisk_maks {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 46px;
  aspect-ratio: 1;
  padding: 0;
  background-color: transparent;
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius-lg);
  color: var(--primary-color);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.belka_przycisk_maks:hover {
  background-color: rgba(255, 92, 0, 0.12);
}

.belka_przycisk_drukuj {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: stretch;
  flex-shrink: 0;
  min-height: 46px;
  padding: 0 16px;
  background-color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius-lg);
  color: #fff;
  font-size: 0.9em;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-sizing: border-box;
}

.belka_przycisk_drukuj:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.belka_przycisk_drukuj svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  flex-shrink: 0;
}

.naglowek_wydruku_tablicy,
.tabela_wydruku_tablicy,
.tabela_wydruku_terminow,
.siatka_zrzutow_kafelkow {
  display: none;
}

.popup_druku_tablicy,
.popup_druku_tablicy h2,
.popup_druku_tablicy h3,
.popup_druku_tablicy label {
  text-transform: none;
}

.popup_druku_tablicy {
  width: 420px;
  max-width: calc(100vw - 32px);
  text-align: left;
  align-items: stretch;
  padding: 22px 24px;
}

.popup_druku_tablicy h2 {
  margin: 0 0 16px;
  font-size: 1.35em;
  text-align: center;
  line-height: 1.25;
}

.popup_druku_grupa {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: var(--bg-darkest);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
}

.popup_druku_grupa h3 {
  margin: 0 0 10px;
  font-size: 0.82em;
  font-weight: 700;
  color: var(--primary-color);
}

.popup_druku_grupa label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  cursor: pointer;
  font-size: 0.95em;
  color: var(--text-bialy);
  text-align: left;
}

.popup_druku_grupa label:last-child {
  margin-bottom: 0;
}

.popup_druku_akcje {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 6px;
}

.popup_druku_akcje .btn-grey,
.popup_druku_akcje .btn-dodaj {
  padding: 10px 24px;
  cursor: pointer;
}

.belka_przycisk_maks svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.belka_przycisk_maks .ikona_min,
body.tryb_pelnoekranowy .belka_przycisk_maks .ikona_maks {
  display: none;
}

body.tryb_pelnoekranowy .belka_przycisk_maks .ikona_min {
  display: block;
}

/* ===== TRYB PEŁNOEKRANOWY TABLICY (ukrywa nagłówek, menu i legendę) ===== */
body.tryb_pelnoekranowy .top,
body.tryb_pelnoekranowy nav,
body.tryb_pelnoekranowy footer.legenda {
  display: none;
}

body.tryb_pelnoekranowy main.zalogowany,
body.tryb_pelnoekranowy main.zalogowany.minimized {
  margin-left: 0;
  padding: 0;
}

body.tryb_pelnoekranowy .belka_tablicy {
  padding: 6px 10px 0;
}

body.tryb_pelnoekranowy .pojazdy-container {
  padding: 6px;
}

/* Zegarek przeniesiony z ukrytego nagłówka do belki - ustawiamy go przed kafelkami */
body.tryb_pelnoekranowy .belka_tablicy_pasek .session-timer {
  margin-left: auto;
  padding: 0;
  background: transparent;
  border: none;
  min-height: 46px;
  align-self: stretch;
}

body.tryb_pelnoekranowy .belka_tablicy_pasek .session-timer-panel {
  height: 100%;
  border-radius: 12px;
}

body.tryb_pelnoekranowy .belka_tablicy_pasek .session-timer.is-open {
  z-index: 80;
}

body.tryb_pelnoekranowy
  .belka_tablicy_pasek
  .session-timer.is-open
  .session-timer-panel {
  height: auto;
  background: #171d24;
  z-index: 80;
  padding: 14px;
}

body.tryb_pelnoekranowy
  .belka_tablicy_pasek
  .session-timer.is-open
  .session-timer-chip {
  height: auto;
}

body.tryb_pelnoekranowy .belka_tablicy_pasek .session-timer-chip {
  height: 100%;
  padding: 4px 12px;
  gap: 8px;
}

body.tryb_pelnoekranowy .belka_tablicy_pasek .session-timer-digit,
body.tryb_pelnoekranowy .belka_tablicy_pasek .session-timer-cell {
  width: 14px;
  height: 22px;
}

body.tryb_pelnoekranowy .belka_tablicy_pasek .session-timer-cell,
body.tryb_pelnoekranowy .belka_tablicy_pasek .session-timer-colon {
  font-size: 18px;
}

body.tryb_pelnoekranowy .belka_tablicy_pasek .session-timer-weekday {
  display: none;
}

body.tryb_pelnoekranowy .belka_tablicy_pasek .session-timer-date,
body.tryb_pelnoekranowy .belka_tablicy_pasek .session-timer-now {
  font-size: 10px;
  line-height: 1.15;
}

body.tryb_pelnoekranowy
  .belka_tablicy_pasek
  .session-timer
  + .belka_kafelki_statusow {
  margin-left: 0;
}

/* ===== OSTRZEŻENIE NA DWIE MINUTY PRZED WYŁĄCZENIEM TABLICY ===== */
.ostrzezenie_tablicy {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  /* Tło pulsuje, żeby rzucało się w oczy kątem oka, ale tablica zostaje widoczna pod spodem */
  animation: pulsOstrzezeniaTablicy 1.2s ease-in-out infinite;
}

.ostrzezenie_tablicy.widoczne {
  display: flex;
}

@keyframes pulsOstrzezeniaTablicy {
  0%,
  100% {
    background-color: rgba(90, 0, 8, 0.3);
  }
  50% {
    background-color: rgba(160, 0, 14, 0.78);
  }
}

.ostrzezenie_tresc {
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.ostrzezenie_ikona {
  width: 26vh;
  height: 26vh;
  fill: none;
  stroke: var(--status-rented);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 18px rgba(253, 0, 25, 0.85));
}

.ostrzezenie_ikona circle {
  fill: var(--status-rented);
  stroke: none;
}

.ostrzezenie_naglowek {
  font-size: clamp(22px, 3.4vw, 46px);
  font-weight: 800;
  letter-spacing: 1px;
}

.ostrzezenie_zegar {
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: clamp(48px, 9vw, 140px);
  font-weight: 800;
  line-height: 1;
  color: var(--primary-color);
}

.ostrzezenie_przyciski {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.ostrzezenie_przedluz {
  padding: 14px 26px;
  font-size: clamp(15px, 1.4vw, 20px);
  font-weight: 700;
  color: #fff;
  background-color: var(--primary-color);
  border: none;
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.ostrzezenie_przedluz:hover {
  background-color: var(--primary-hover);
}

.ostrzezenie_podpis {
  margin-top: 10px;
  font-size: 15px;
  opacity: 0.85;
}

.belka_przycisk_filtrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background-color: transparent;
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius-lg);
  color: var(--primary-color);
  font-size: 0.9em;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.belka_przycisk_filtrow:hover,
.belka_przycisk_filtrow[aria-expanded="true"] {
  background-color: rgba(255, 92, 0, 0.12);
}

.belka_przycisk_filtrow svg {
  width: 14px;
  height: 14px;
  fill: var(--primary-color);
}

.belka_licznik_filtrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background-color: var(--primary-color);
  border-radius: 10px;
  color: #fff;
  font-size: 0.72em;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.chip_filtra_pojazdow.belka_chip_terminy {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: 46px;
  padding: 0 16px;
  background-color: transparent;
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius-lg);
  color: var(--primary-color);
  font-size: 0.9em;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  box-sizing: border-box;
  transition: background-color 0.15s ease;
}

.chip_filtra_pojazdow.belka_chip_terminy:hover,
.chip_filtra_pojazdow.belka_chip_terminy.aktywny {
  background-color: rgba(255, 92, 0, 0.12);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.belka_kafelki_statusow {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.kafelek_statusu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 2px 8px;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  line-height: 1.15;
}

.kafelek_liczba {
  font-size: 1.1em;
  font-weight: 700;
}

.kafelek_opis {
  color: var(--text-dark);
  font-size: 0.7em;
}

.kafelek_statusu.status-wolny .kafelek_liczba {
  color: var(--status-free);
}

.kafelek_statusu.status-wypozyczony .kafelek_liczba {
  color: var(--status-rented);
}

.kafelek_statusu.status-w-naprawie .kafelek_liczba {
  color: var(--status-repair);
}

.kafelek_statusu.status-zarezerwowany .kafelek_liczba {
  color: var(--status-reserved);
}

.kafelek_statusu.status-terminy .kafelek_liczba {
  color: var(--primary-color);
}

.kafelek_statusu.status-terminy-aktywne {
  border-width: 2px;
  border-color: var(--primary-color);
  animation: pulsKafelkaTerminy 2.2s ease-in-out infinite;
}

@keyframes pulsKafelkaTerminy {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 92, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(255, 92, 0, 0.12);
  }
}

.kafelek_statusu.status-suma .kafelek_liczba {
  color: var(--text-light);
}

.szuflada_filtrow {
  display: none;
  margin-top: 10px;
  padding: 18px 20px;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-top: 2px solid var(--primary-color);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45);
}

.szuflada_filtrow.otwarta {
  display: block;
}

.szuflada_siatka {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 18px;
}

.szuflada_pole {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.szuflada_pole > span {
  color: var(--text-dark);
  font-size: 0.72em;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.szuflada_pole select {
  width: 100%;
  padding: 8px 10px;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--primary-color);
  font-size: 0.9em;
  cursor: pointer;
}

.szuflada_stopka {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin-top: 18px;
}

.szuflada_wyczysc {
  color: var(--text-dark) !important;
  font-size: 0.9em;
  text-decoration: none;
}

.szuflada_wyczysc:hover {
  color: var(--text-light) !important;
}

.szuflada_zastosuj {
  padding: 9px 26px;
  background-color: var(--primary-color);
  border: none;
  border-radius: var(--border-radius);
  color: #fff;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
}

.szuflada_zastosuj:hover {
  background-color: var(--primary-hover);
}

@media (max-width: 1200px) {
  .szuflada_siatka {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .belka_kafelki_statusow {
    flex: 1 1 100%;
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .belka_przycisk_drukuj {
    margin-left: auto;
  }
}

/* -----------------------------
   19. Formularz wypożyczenia - karta pojazdu obok formularza
   Dwie kolumny: po lewej dane pojazdu tylko do odczytu, po prawej praca do wykonania.
   Karta zostaje w polu widzenia przy wypełnianiu terminu, więc nie trzeba przewijać
   w górę po numer rejestracyjny czy przebieg.
----------------------------- */
.tytul_z_plakietka {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.tytul_z_plakietka h2 {
  border-bottom: none;
  margin-bottom: 0;
}

/* Formularze wypożyczenia i zwrotu potrzebują więcej miejsca niż typowe 725px
   z .nasz_formularz - obok pracy do wykonania stoi jeszcze karta pojazdu */
.formularz_dwie_kolumny {
  max-width: 1180px;
}

.uklad_wypozyczenia {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.karta_pojazdu_zwarta {
  position: sticky;
  top: 20px;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
}

.panel_wypozyczenia {
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
}

.tytul_sekcji_formularza {
  margin: 0 0 12px 0;
  color: var(--primary-color);
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* Dane pojazdu: etykieta nad wartością, dwie kolumny - komplet widać bez przewijania */
.siatka_danych {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.siatka_danych .pole_danych {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.etykieta_danych {
  color: var(--text-dark);
  font-size: 0.68em;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.wartosc_danych {
  color: var(--text-light);
  font-size: 0.9em;
  word-break: break-word;
}

.wartosc_mocna {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1em;
}

.wartosc_danych.termin_uwaga,
.nazwa-pola-txt.termin_uwaga {
  color: var(--primary-color);
  font-weight: 700;
}

.dopisek_terminu {
  display: block;
  margin-top: 4px;
  font-size: 0.82em;
  font-weight: 700;
  color: var(--primary-color);
}

.pole_po_imporcie,
.pole_po_imporcie .nazwa-pola-txt,
.pole_po_imporcie .wartosc_danych,
.wartosc_danych.pole_po_imporcie,
.nazwa-pola-txt.pole_po_imporcie,
.wartosc_import_nowa {
  color: var(--primary-color);
}

.pole_formularza.pole_po_imporcie input,
.pole_formularza.pole_po_imporcie select {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.pole_formularza.pole_po_imporcie {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.pole_formularza.pole_po_imporcie > .nazwa-pola-txt,
.pole_formularza.pole_po_imporcie > label.nazwa-pola-txt,
.pole_formularza.pole_po_imporcie > span.nazwa-pola-txt {
  order: 1;
}

.pole_formularza.pole_po_imporcie > .dymek_importu {
  order: 2;
}

.pole_formularza.pole_po_imporcie > input,
.pole_formularza.pole_po_imporcie > select,
.pole_formularza.pole_po_imporcie > .wartosc_danych,
.pole_formularza.pole_po_imporcie > .radio-option,
.pole_formularza.pole_po_imporcie > .error,
.pole_formularza.pole_po_imporcie > .dopisek_terminu {
  order: 3;
}

.dymek_importu {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 6px;
  padding: 6px 8px;
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  color: var(--primary-color);
  font-weight: 700;
  background: #fff;
  text-align: left;
  line-height: 1.3;
}

.dymek_importu_bylo {
  display: block;
  font-weight: 400;
  font-size: 0.85em;
  color: inherit;
  opacity: 0.8;
}

.karta_importu_pojazdu {
  border: 1px solid var(--ramka, #ddd);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 14px;
  background: #fff;
}

.karta_importu_pojazdu.karta_importu_konflikt {
  border-color: var(--primary-color);
}

.karta_importu_naglowek {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-bottom: 10px;
}

.karta_importu_status {
  font-weight: 700;
}

.pole_zmiany_importu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 10px;
}

.wartosc_import_nowa {
  font-weight: 700;
}

.wartosc_import_stara {
  font-size: 0.92em;
  opacity: 0.85;
}

.lista_linkow_importu {
  margin: 8px 0 0;
  padding-left: 20px;
}

.blok_importu_floty,
.nasz_formularz.blok_importu_floty {
  max-width: 1400px;
  width: 100%;
  margin: 0 0 22px 0;
  text-align: left;
}

.blok_importu_floty fieldset {
  text-align: left;
}

.blok_importu_floty legend {
  text-align: left;
  font-size: 1.25em;
  margin-bottom: 8px;
  padding-left: 0;
}

.blok_importu_floty .podpowiedz_pola,
.blok_importu_floty .nazwa-pola-txt {
  text-align: left;
}

.blok_importu_floty .rzad_pol {
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
}

.blok_importu_floty .pole_formularza {
  text-align: left;
}

.blok_importu_floty .pelne_pole {
  grid-column: 1 / -1;
}

.blok_importu_floty input[type="file"] {
  display: block;
  width: auto;
  max-width: 100%;
  margin: 6px 0 0 0;
  padding: 8px 10px;
  box-sizing: border-box;
  color: var(--text-light);
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  text-align: left;
}

.blok_importu_floty input[type="file"]::file-selector-button {
  margin-right: 12px;
  text-align: left;
}

.blok_importu_floty .btn-dodaj,
.blok_importu_floty .btn-grey {
  width: auto;
  display: inline-block;
  min-width: 220px;
  margin: 12px 8px 0 0;
}

/* Termin po dacie zwrotu - musi kłuć w oczy przy zwrocie po czasie */
.wartosc_alarm {
  color: #ff9d99;
  font-weight: 700;
  font-size: 1em;
}

/* Formularz zwrotu: kogo i czego dotyczy zamykane wypożyczenie. Dane tylko
   do odczytu, dlatego stoją w ramce, a nie między polami do wypełnienia. */
.blok_aktywnego_wypozyczenia {
  margin-bottom: 18px;
  padding: 10px 12px;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--primary-color);
  border-radius: var(--border-radius);
}

.siatka_danych_szeroka {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 760px) {
  .siatka_danych_szeroka {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.plakietki_pojazdu {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.plakietka_pojazdu {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  font-size: 0.75em;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-light);
}

.plakietka_ok {
  border-color: rgba(76, 175, 80, 0.6);
  background-color: rgba(76, 175, 80, 0.14);
  color: #9be29e;
}

.plakietka_uwaga {
  border-color: rgba(255, 179, 0, 0.6);
  background-color: rgba(255, 179, 0, 0.14);
  color: #ffd479;
}

.plakietka_alarm {
  border-color: rgba(229, 57, 53, 0.6);
  background-color: rgba(229, 57, 53, 0.16);
  color: #ff9d99;
}

.plakietka_info {
  border-color: rgba(0, 125, 255, 0.6);
  background-color: rgba(0, 125, 255, 0.14);
  color: #9cdeff;
}

.plakietka_zajety {
  border-color: var(--primary-color);
  background-color: rgba(255, 92, 0, 0.16);
  color: var(--primary-color);
}

/* Tytuł mniejszej sekcji wewnątrz karty: dane techniczne, termin */
.podtytul_formularza {
  margin: 16px 0 8px;
  color: var(--primary-color);
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.sekcja_danych_technicznych {
  margin-top: 14px;
  border-top: 1px solid var(--border-color);
  padding-top: 4px;
}

.uwagi_pojazdu_box {
  margin-top: 14px;
  padding: 9px 11px;
  background-color: var(--bg-dark);
  border-left: 3px solid var(--primary-color);
  border-radius: var(--border-radius);
  font-size: 0.82em;
  line-height: 1.5;
  color: var(--text-light);
}

.uwagi_pojazdu_box b {
  color: var(--primary-color);
}

/* Prawa kolumna */
.rzad_pol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

/* Godziny wydania, zwrotu i przebieg w jednym rzędzie pod kalendarzem */
.rzad_trzech {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}

.pole_formularza {
  min-width: 0;
}

.pole_formularza select,
.pole_formularza textarea {
  margin: 6px 0 0 0;
  background-color: var(--bg-dark);
}

/* Rozwinięta lista statusów: ciemne tło pod kolorami status-*, żeby zieleń, czerwień,
   błękit i pomarańcz były czytelne tak samo jak na listach pojazdów */
#statusSelect option,
#filtrStatusTablicy option,
.panel_wypozyczenia #status option {
  background-color: var(--bg-darker);
}

#statusSelect option[value=""],
#filtrStatusTablicy option[value=""] {
  color: var(--text-dark);
}

#filtrStatusTablicy option.status-wolny {
  color: var(--status-free);
}

#filtrStatusTablicy option.status-wypozyczony {
  color: var(--status-rented);
}

#filtrStatusTablicy option.status-zarezerwowany {
  color: var(--status-reserved);
}

#filtrStatusTablicy option.status-w_naprawie {
  color: var(--status-repair);
}

/* Etykiety pól w prawej kolumnie: jasne i przy samej krawędzi pola, bez pomarańczy -
   pomarańczowy zostawiamy dla tytułów sekcji i wartości, na które trzeba patrzeć */
.panel_wypozyczenia .nazwa-pola-txt,
.panel_formularza_nowego .nazwa-pola-txt {
  display: block;
  padding-left: 0;
  color: var(--text-light);
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* ===== Formularz nowego pojazdu: Koncepcja 2 — dwie kolumny ===== */
.formularz_nowego_pojazdu .panel_formularza_nowego {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.formularz_nowego_pojazdu .sekcja_formularza_nowego {
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
}

.formularz_nowego_pojazdu .sekcja_formularza_nowego .rzad_pol:last-child {
  margin-bottom: 0;
}

.formularz_nowego_pojazdu .podglad_nazwa_pojazdu {
  margin: 0 0 14px;
  font-size: 1.15em;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.3;
  word-break: break-word;
}

/* Status w lewym podglądzie karty — ta sama pastylka co na liście pojazdów */
.karta_pojazdu_zwarta .status_pastylka_podglad {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74em;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}

.karta_pojazdu_zwarta .status_pastylka_podglad.status-wolny {
  color: var(--status-free);
  background: rgba(0, 181, 0, 0.14);
  border-color: rgba(0, 181, 0, 0.4);
}

.karta_pojazdu_zwarta .status_pastylka_podglad.status-wypozyczony {
  color: var(--status-rented);
  background: rgba(253, 0, 25, 0.14);
  border-color: rgba(253, 0, 25, 0.4);
}

.karta_pojazdu_zwarta .status_pastylka_podglad.status-zarezerwowany {
  color: var(--status-reserved);
  background: rgba(7, 186, 255, 0.14);
  border-color: rgba(7, 186, 255, 0.4);
}

.karta_pojazdu_zwarta .status_pastylka_podglad.status-w_naprawie {
  color: var(--status-repair);
  background: rgba(255, 129, 0, 0.14);
  border-color: rgba(255, 129, 0, 0.4);
}

.karta_pojazdu_zwarta .status_pastylka_podglad.status-nieznany {
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-color);
}

.formularz_nowego_pojazdu .pole_formularza input[type="text"],
.formularz_nowego_pojazdu .pole_formularza input[type="number"],
.formularz_nowego_pojazdu .pole_formularza input[type="date"] {
  margin: 6px 0 0 0;
  background-color: var(--bg-dark);
  width: 100%;
  box-sizing: border-box;
  color: var(--text-bialy);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 8px 10px;
}

/* Karta pojazdu (tylko odczyt): wartości w prawej kolumnie jak pola formularza */
.formularz_nowego_pojazdu .pole_formularza > .wartosc_danych {
  display: block;
  margin: 6px 0 0 0;
  padding: 8px 10px;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-bialy);
  box-sizing: border-box;
  min-height: 1.2em;
}

.formularz_nowego_pojazdu .pole_formularza textarea {
  width: 100%;
  box-sizing: border-box;
}

.formularz_nowego_pojazdu .radio_skrzynia_nowy {
  flex-direction: row;
  gap: 16px;
  margin: 8px 0 0 0;
  color: var(--text-light);
}

.formularz_nowego_pojazdu .radio_skrzynia_nowy label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.formularz_nowego_pojazdu .check_gps_nowy,
.formularz_nowego_pojazdu .check_leasing_label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--text-light);
  font-size: 0.9em;
  cursor: pointer;
}

.formularz_nowego_pojazdu .pelne_pole {
  grid-column: 1 / -1;
}

.formularz_nowego_pojazdu .pasek_zapisu_plywajacy .podsumowanie_wypozyczenia {
  margin: 0;
  font-size: 0.9em;
  color: var(--text-light);
}

.rzad_klienta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rzad_klienta select {
  flex: 1 1 auto;
  min-width: 0;
}

.przycisk_obok_pola {
  display: inline-flex;
  align-items: center;
  width: auto;
  white-space: nowrap;
  margin: 6px 0 0 0;
  padding: 8px 12px;
}

/* Skróty okresu - liczą termin od zaznaczonego dnia albo od dziś */
.skroty_okresu {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.skrot_okresu {
  padding: 5px 12px;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-light);
  font-size: 0.78em;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}

.skrot_okresu:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.skrot_okresu.aktywny {
  border-color: var(--primary-color);
  color: var(--primary-color);
  font-weight: 700;
}

/* Ręcznie wpisana liczba dni przedłużenia - stoi w rzędzie skrótów, więc bierze
   tylko tyle miejsca, ile potrzebuje na trzy cyfry */
.pole_dni_przedluzenia {
  width: 90px;
  margin: 0;
  padding: 4px 8px;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-bialy);
  font-size: 0.78em;
  text-align: center;
}

/* Ramka kalendarza: tabela dni razem z legendą */
.ramka_kalendarza {
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 10px 12px 12px 12px;
}

/* Kontener tabeli dni nazywa się #kalendarz_terminu, a nie #calendar, bo dla tego
   drugiego aplikacja ma globalną regułę pod kalendarz FullCalendar: padding 20px,
   cień i min-height 600px. Dlatego tutaj nie trzeba niczego zdejmować. */
#kalendarz_terminu {
  width: 100%;
}

/* Kalendarz ma być siatką dni, nie tabelą z danymi. Ogólne reguły dla table
   dają tu obramowania komórek, paski na przemian i podświetlanie całych wierszy,
   dlatego wszystkie trzeba wyłączyć - stąd ta seria nadpisań. */
.formularz_dwie_kolumny table.selected_kalendarz {
  width: 100%;
  border-collapse: collapse;
  box-shadow: none;
  background: transparent;
  font-size: 0.82em;
}

.formularz_dwie_kolumny table.selected_kalendarz th,
.formularz_dwie_kolumny table.selected_kalendarz td {
  padding: 5px 0;
  text-align: center;
  background-color: transparent;
  border: none;
  border-radius: var(--border-radius);
  white-space: nowrap;
}

.formularz_dwie_kolumny table.selected_kalendarz th {
  color: var(--text-dark);
  font-size: 1.65em;
  font-weight: 600;
  padding: 3px 0;
}

.formularz_dwie_kolumny table.selected_kalendarz tr:nth-child(even) td,
.formularz_dwie_kolumny table.selected_kalendarz tr:hover td {
  background-color: transparent;
}

.formularz_dwie_kolumny table.selected_kalendarz tr:not(:first-child) {
  border-top: none;
}

.formularz_dwie_kolumny table.selected_kalendarz td:not(:first-child) {
  border-left: none;
}

/* Nagłówek miesiąca i strzałki nawigacji */
.formularz_dwie_kolumny table.selected_kalendarz td.calendar-header {
  color: var(--text-bialy);
  font-weight: 700;
  padding: 6px 0 8px 0;
  cursor: default;
  font-size: 1.3rem;
}

.formularz_dwie_kolumny table.selected_kalendarz td.prev-month,
.formularz_dwie_kolumny table.selected_kalendarz td.next-month {
  color: var(--primary-color);
  cursor: pointer;
  font-size: 1.05em;
}

.formularz_dwie_kolumny table.selected_kalendarz td.calendar-day:hover {
  background-color: rgba(255, 92, 0, 0.14);
}

/* Sobota i niedziela. Reguła stoi przed kolorami zaznaczenia i terminów zajętych,
   żeby weekend w wybranym okresie był pomarańczowy, a nie w kolorze weekendu. */
.formularz_dwie_kolumny .selected_kalendarz td.calendar-day.dzien_wolny {
  background-color: rgba(255, 255, 255, 0.05);
  color: #c9ab8f;
}

.formularz_dwie_kolumny table.selected_kalendarz th.naglowek_wolny {
  color: #c9ab8f;
}

.legenda_kalendarza {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 0.72em;
  color: var(--text-dark);
}

.legenda_kalendarza i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: -1px;
}

.probka_wybrany {
  background-color: var(--primary-color);
}

.probka_zajety {
  background-color: rgba(74, 144, 226, 0.5);
}

.probka_przeszlosc {
  background-color: #5d6b74;
}

.probka_dzien_zwrotu {
  background-color: transparent;
  box-shadow: inset 0 0 0 2px var(--text-bialy);
}

.podpowiedz_terminu {
  margin-top: 8px;
  margin-bottom: 10px;
  color: var(--primary-color);
  font-size: 0.8em;
  font-weight: 600;
}

.para_godzin {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

/* Godzina i minuta to krótkie listy - nie rozciągamy ich na całą szerokość pola */
.para_godzin select {
  margin: 0;
  flex: 0 1 80px;
  min-width: 0;
  background-color: var(--bg-dark);
}

.para_godzin .dwukropek {
  color: var(--text-dark);
}

.pole_formularza input[type="number"] {
  margin: 6px 0 0 0;
  background-color: var(--bg-dark);
}

/* Kolory dni zgodnie z legendą: wybrany okres pomarańczowy, terminy już zajęte
   niebieskie, przeszłość szara. Pierwszy i ostatni dzień okresu mają pełny kolor. */
.formularz_dwie_kolumny .selected_kalendarz td.calendar-day.selected {
  background: rgba(255, 92, 0, 0.22);
  color: var(--text-bialy);
  text-shadow: none;
}

.formularz_dwie_kolumny .selected_kalendarz td.calendar-day.brzeg_terminu {
  background: var(--primary-color);
  color: #fff;
  font-weight: 700;
}

.formularz_dwie_kolumny .selected_kalendarz td.calendar-day.zajety_termin {
  background: rgba(74, 144, 226, 0.2);
  color: #9dc4ef;
  text-decoration: line-through;
}

.formularz_dwie_kolumny
  .selected_kalendarz
  td.calendar-day.zajety_termin.selected {
  background: rgba(255, 92, 0, 0.22);
  color: var(--text-bialy);
  text-decoration: none;
}

.formularz_dwie_kolumny
  .selected_kalendarz
  td.calendar-day.zajety_termin.brzeg_terminu {
  background: var(--primary-color);
  color: #fff;
  text-decoration: none;
}

.formularz_dwie_kolumny .selected_kalendarz td.calendar-day.disabled {
  color: #5d6b74;
}

.formularz_dwie_kolumny .selected_kalendarz td.calendar-day.today {
  outline: 1px solid var(--primary-color);
}

/* Kalendarz zwrotu ma trzy warstwy: trwający okres wypożyczenia na niebiesko,
   dni dochodzące przedłużeniem na pomarańczowo (tak jak wybrany okres przy
   wypożyczeniu) i biała obwódka na dniu, który trafi do bazy jako zwrot. */
.formularz_dwie_kolumny .selected_kalendarz td.calendar-day.okres_wypozyczenia {
  background: rgba(74, 144, 226, 0.28);
  color: #cfe6ff;
  font-weight: 600;
}

.formularz_dwie_kolumny
  .selected_kalendarz
  td.calendar-day.podglad-przedluzenia {
  background: var(--primary-color);
  color: #fff;
  font-weight: 700;
}

.formularz_dwie_kolumny .selected_kalendarz td.calendar-day.selected-return {
  box-shadow: inset 0 0 0 2px var(--text-bialy);
  color: var(--text-bialy);
  font-weight: 700;
}

.ostrzezenie_terminu {
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(229, 57, 53, 0.6);
  border-left-width: 4px;
  border-radius: var(--border-radius);
  background-color: rgba(229, 57, 53, 0.12);
  color: #ffc9c6;
  font-size: 0.82em;
}

/* Pasek zapisu: wyliczenie po lewej, akcje po prawej */
.pasek_zapisu_formularza {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 12px 14px;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

/* Koncepcja 3: pasek unosi się nad treścią przy przewijaniu, nie belka na całą szerokość */
.pasek_zapisu_plywajacy {
  position: sticky;
  bottom: 14px;
  z-index: 40;
  margin-top: 20px;
  margin-bottom: 8px;
  padding: 10px 12px 10px 16px;
  background: linear-gradient(180deg, #27323b 0%, #1a222a 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

body.light-theme .pasek_zapisu_plywajacy {
  background: linear-gradient(180deg, #f7f7f7 0%, #e9e9e9 100%);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.pasek_zapisu_plywajacy.pasek_importu_gora {
  position: sticky;
  top: 12px;
  bottom: auto;
  margin-top: 0;
  margin-bottom: 16px;
  z-index: 50;
}

.formularz_nowego_pojazdu.formularz_importu_floty .karta_pojazdu_zwarta {
  top: 78px;
}

.pasek_zapisu_plywajacy.pasek_importu_konflikt {
  background: linear-gradient(180deg, #3a2228 0%, #241416 100%);
  border-color: var(--status-rented);
  box-shadow: 0 12px 28px rgba(253, 0, 25, 0.28);
}

.pasek_zapisu_plywajacy.pasek_importu_konflikt .podsumowanie_wypozyczenia {
  color: #ff9d99;
}

body.light-theme .pasek_zapisu_plywajacy.pasek_importu_konflikt {
  background: linear-gradient(180deg, #ffe8e6 0%, #ffd4d0 100%);
  border-color: var(--status-rented);
  box-shadow: 0 10px 22px rgba(253, 0, 25, 0.12);
}

/* ===== Lista pojazdów: Koncepcja 2 — belka filtrów + wiersze kartowe ===== */
.lista_pojazdow_karty {
  max-width: 1280px;
}

/* Panel jak .makieta w zaakceptowanej koncepcji — tło i ramka wokół całej listy */
.panel_listy_pojazdow {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-dark);
  padding: 16px;
}

.belka_listy_pojazdow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.szukajka_listy_pojazdow {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 320px;
  margin: 0;
  padding: 10px 12px 10px 34px;
  background-color: var(--bg-darker);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a9aa3' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  color: var(--text-bialy);
  font-size: 0.9em;
}

.filtry_listy_pojazdow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
}

.chip_filtra_pojazdow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-light);
  font-size: 0.78em;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}

.chip_filtra_pojazdow:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.chip_filtra_pojazdow.aktywny {
  border-color: var(--primary-color);
  color: var(--primary-color);
  font-weight: 700;
}

.chip_filtra_pojazdow .chip_licznik {
  /* Bez osobnego tła pod liczbą — jedna pastylka na całą etykietę + licznik */
  display: inline;
  min-width: 0;
  margin: 0;
  padding: 0 !important;
  border: none !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  text-align: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

.form_dodaj_pojazd_belka {
  margin: 0;
  flex-shrink: 0;
}

.form_dodaj_pojazd_belka .btn-dodaj {
  width: auto;
  margin: 0;
  padding: 9px 16px;
  white-space: nowrap;
}

.naglowek_listy_pojazdow {
  display: grid;
  grid-template-columns:
    70px minmax(140px, 1.35fr) 120px 120px minmax(120px, 1fr)
    120px 140px 90px;
  gap: 10px;
  align-items: center;
  padding: 0 12px 8px;
  color: var(--text-dark);
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.sort_kolumna {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-transform: none;
  letter-spacing: inherit;
  cursor: pointer;
  text-align: left;
  user-select: none;
}

/* Ikony FA schowane — jak w koncepcji: trójkąt ▲/▼ przez ::after */
.naglowek_listy_pojazdow .sort-arrows {
  display: none !important;
}

.naglowek_listy_pojazdow .sort_kolumna::after {
  content: "▲";
  font-size: 0.7em;
  line-height: 1;
  color: var(--text-dark);
  margin-left: 3px;
}

.naglowek_listy_pojazdow .sort_kolumna.sorting_asc::after {
  content: "▲";
  color: var(--primary-color);
}

.naglowek_listy_pojazdow .sort_kolumna.sorting_desc::after {
  content: "▼";
  color: var(--primary-color);
}

.sort_kolumna_statyczna {
  text-align: right;
}

.sort_kolumna_statyczna.sort_kolumna_srodek {
  text-align: center;
  width: 100%;
}

.lista_pojazdow_wiersze {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wiersz_pojazdu {
  display: grid;
  grid-template-columns:
    70px minmax(140px, 1.35fr) 120px 120px minmax(120px, 1fr)
    120px 140px 90px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.88em;
  color: var(--text-light);
}

.wiersz_pojazdu:hover {
  border-color: rgba(255, 92, 0, 0.45);
}

.wiersz_pojazdu.po_terminie,
.wiersz_pojazdu.overdue-rental {
  border-color: rgba(229, 57, 53, 0.5);
  box-shadow: inset 3px 0 0 #e53935;
}

.komorka_pojazdu {
  min-width: 0;
  word-break: break-word;
}

.komorka_nr {
  color: var(--text-dark);
  font-size: 0.95em;
}

.komorka_nazwa a {
  color: var(--primary-color);
  font-weight: 700;
  text-decoration: none;
}

.komorka_nazwa a:hover {
  text-decoration: underline;
}

.komorka_status a {
  text-decoration: none;
}

/* Statusy jak w koncepcji: pastylka z kolorem, obramowaniem i lekkim tłem */
.wiersz_pojazdu .komorka_status a,
.wiersz_pojazdu .komorka_status > span:not(.overdue-badge) {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74em;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
  text-decoration: none;
}

.wiersz_pojazdu .komorka_status.status-wolny a,
.wiersz_pojazdu .komorka_status a.status-wolny {
  color: var(--status-free);
  background: rgba(0, 181, 0, 0.14);
  border-color: rgba(0, 181, 0, 0.4);
}

.wiersz_pojazdu .komorka_status.status-wypozyczony a,
.wiersz_pojazdu .komorka_status a.status-wypozyczony {
  color: var(--status-rented);
  background: rgba(253, 0, 25, 0.14);
  border-color: rgba(253, 0, 25, 0.4);
}

.wiersz_pojazdu .komorka_status.status-zarezerwowany a,
.wiersz_pojazdu .komorka_status a.status-zarezerwowany {
  color: var(--status-reserved);
  background: rgba(7, 186, 255, 0.14);
  border-color: rgba(7, 186, 255, 0.4);
}

.wiersz_pojazdu .komorka_status.status-w_naprawie a,
.wiersz_pojazdu .komorka_status a.status-w_naprawie {
  color: var(--status-repair);
  background: rgba(255, 129, 0, 0.14);
  border-color: rgba(255, 129, 0, 0.4);
}

.wiersz_pojazdu .komorka_status .overdue-badge {
  margin-left: 4px;
  vertical-align: middle;
}

.meta_wiersza_pojazdu {
  display: block;
  margin-top: 2px;
  color: var(--text-dark);
  font-size: 0.85em;
}

.komorka_szczegoly {
  text-align: center;
}

.komorka_szczegoly a:not(.btn_edytuj_segment) {
  color: var(--primary-color);
  font-size: 0.9em;
}

.brak_wynikow_filtra {
  margin-top: 16px;
  color: var(--text-dark);
  font-size: 0.9em;
}

@media (max-width: 1100px) {
  .naglowek_listy_pojazdow {
    display: none;
  }

  .wiersz_pojazdu {
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
  }

  .komorka_szczegoly {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .wiersz_pojazdu {
    grid-template-columns: 1fr;
  }

  .szukajka_listy_pojazdow {
    max-width: none;
  }
}

/* ===== Lista klientów: Koncepcja 2 — belka + wiersze kartowe (jak pojazdy) ===== */
.lista_klientow_karty {
  max-width: 1480px;
}

.naglowek_listy_klientow {
  display: grid;
  grid-template-columns:
    minmax(120px, 1.1fr) 80px 100px 100px minmax(110px, 1fr)
    minmax(80px, 0.8fr) minmax(110px, 1fr) 90px 85px 90px;
  gap: 8px;
  align-items: center;
  padding: 0 12px 8px;
  color: var(--text-dark);
  font-size: 0.78em;
  font-weight: 600;
}

.naglowek_listy_klientow .sort-arrows {
  display: none !important;
}

.naglowek_listy_klientow .sort_kolumna::after {
  content: "▲";
  font-size: 0.7em;
  line-height: 1;
  color: var(--text-dark);
  margin-left: 3px;
}

.naglowek_listy_klientow .sort_kolumna.sorting_asc::after {
  content: "▲";
  color: var(--primary-color);
}

.naglowek_listy_klientow .sort_kolumna.sorting_desc::after {
  content: "▼";
  color: var(--primary-color);
}

.lista_klientow_wiersze {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wiersz_klienta {
  display: grid;
  grid-template-columns:
    minmax(120px, 1.1fr) 80px 100px 100px minmax(110px, 1fr)
    minmax(80px, 0.8fr) minmax(110px, 1fr) 90px 85px 90px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.86em;
  color: var(--text-light);
}

.wiersz_klienta:hover {
  border-color: rgba(255, 92, 0, 0.45);
}

.komorka_klienta {
  min-width: 0;
  word-break: break-word;
}

.komorka_nazwa_klienta a {
  color: var(--primary-color);
  font-weight: 700;
  text-decoration: none;
}

.komorka_nazwa_klienta a:hover {
  text-decoration: underline;
}

.komorka_email_klienta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.komorka_edytuj_klienta {
  text-align: center;
}

.komorka_edytuj_klienta a:not(.btn_edytuj_segment) {
  color: var(--primary-color);
  font-size: 0.9em;
  text-decoration: none;
}

.komorka_edytuj_klienta a:not(.btn_edytuj_segment):hover {
  text-decoration: underline;
}

.typ_pastylka_klienta {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74em;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}

.typ_pastylka_klienta.typ-prywatny {
  color: var(--status-free);
  background: rgba(0, 181, 0, 0.14);
  border-color: rgba(0, 181, 0, 0.4);
}

.typ_pastylka_klienta.typ-firmowy {
  color: var(--status-reserved);
  background: rgba(7, 186, 255, 0.14);
  border-color: rgba(7, 186, 255, 0.4);
}

.typ_pastylka_klienta.typ-nieznany {
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-color);
}

@media (max-width: 1100px) {
  .naglowek_listy_klientow {
    display: none;
  }

  .wiersz_klienta {
    grid-template-columns: 1fr 1fr;
  }

  .komorka_edytuj_klienta {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .wiersz_klienta {
    grid-template-columns: 1fr;
  }
}

/* ===== Lista użytkowników — siatka 6 kolumn na bazie stylów klientów ===== */
.lista_uzytkownikow_karty {
  max-width: 1200px;
}

.lista_uzytkownikow_karty .naglowek_listy_klientow,
.lista_uzytkownikow_karty .wiersz_klienta {
  grid-template-columns:
    minmax(140px, 1.2fr) 120px 110px minmax(140px, 1.1fr)
    minmax(140px, 1.2fr) 90px;
}

.lista_uzytkownikow_karty .stan_pastylka_uzytkownika {
  text-decoration: none !important;
}

.lista_uzytkownikow_karty .stan_pastylka_uzytkownika.stan-zalogowany {
  color: var(--status-free);
  background: rgba(0, 181, 0, 0.14);
  border-color: rgba(0, 181, 0, 0.4);
  cursor: pointer;
}

.lista_uzytkownikow_karty .stan_pastylka_uzytkownika.stan-wylogowany {
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-color);
}

.lista_uzytkownikow_karty .stan_pastylka_uzytkownika.stan-zablokowany {
  color: var(--status-rented);
  background: rgba(255, 59, 48, 0.14);
  border-color: rgba(255, 59, 48, 0.4);
}

@media (max-width: 900px) {
  .lista_uzytkownikow_karty .naglowek_listy_klientow {
    display: none;
  }

  .lista_uzytkownikow_karty .wiersz_klienta {
    grid-template-columns: 1fr 1fr;
  }

  .lista_uzytkownikow_karty .komorka_edytuj_klienta {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .lista_uzytkownikow_karty .wiersz_klienta {
    grid-template-columns: 1fr;
  }
}

/* ===== Karta użytkownika: Koncepcja 1 — podgląd + zakładki ===== */
.formularz_uzytkownika #dane_uzytkownika.tab-content.active,
.formularz_uzytkownika #haslo_uzytkownika.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.formularz_uzytkownika .pole_koloru_uzytkownika {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.formularz_uzytkownika .pole_koloru_uzytkownika input[type="color"] {
  width: 50px;
  height: 35px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: transparent;
  cursor: pointer;
}

.formularz_uzytkownika #color_preview {
  display: inline-block;
  min-width: 80px;
  padding: 6px 10px;
  border-radius: var(--border-radius);
  font-weight: 700;
  font-size: 0.85em;
  text-align: center;
  color: #fff;
  background: #6c757d;
}

.formularz_uzytkownika .podpowiedz_pola {
  display: block;
  margin-top: 6px;
  color: var(--text-dark);
  font-size: 0.8em;
}

.formularz_uzytkownika .pasek_koloru_uzytkownika {
  display: inline-block;
  width: 48px;
  height: 10px;
  margin-right: 8px;
  border-radius: 4px;
  vertical-align: middle;
  border: 1px solid var(--border-color);
}

.formularz_uzytkownika .lista_historii_uzytkownika_wiersze {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.formularz_uzytkownika .naglowek_historii_uzytkownika {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0 12px 8px;
  color: var(--text-dark);
  font-size: 0.78em;
  font-weight: 600;
}

.formularz_uzytkownika .naglowek_historii_uzytkownika .sort-arrows {
  display: none !important;
}

.formularz_uzytkownika .naglowek_historii_uzytkownika .sort_kolumna::after {
  content: "▲";
  font-size: 0.7em;
  margin-left: 3px;
  color: var(--text-dark);
}

.formularz_uzytkownika
  .naglowek_historii_uzytkownika
  .sort_kolumna.sorting_asc::after {
  content: "▲";
  color: var(--primary-color);
}

.formularz_uzytkownika
  .naglowek_historii_uzytkownika
  .sort_kolumna.sorting_desc::after {
  content: "▼";
  color: var(--primary-color);
}

.formularz_uzytkownika .wiersz_historii_uzytkownika {
  display: grid;
  grid-template-columns: 1fr;
  padding: 10px 12px;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.88em;
  color: var(--text-light);
}

.formularz_uzytkownika .wiersz_historii_uzytkownika:hover {
  border-color: rgba(255, 92, 0, 0.45);
}

.formularz_uzytkownika .komorka_historii_uzytkownika {
  display: flex;
  align-items: center;
  gap: 8px;
}

.formularz_uzytkownika .komorka_historii_uzytkownika .mdi {
  color: var(--primary-color);
  font-size: 1.1em;
}

.formularz_uzytkownika .stan_pastylka_uzytkownika {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74em;
  font-weight: 700;
  border: 1px solid transparent;
}

.formularz_uzytkownika .stan_pastylka_uzytkownika.stan-zalogowany {
  color: var(--status-free);
  background: rgba(0, 181, 0, 0.14);
  border-color: rgba(0, 181, 0, 0.4);
}

.formularz_uzytkownika .stan_pastylka_uzytkownika.stan-wylogowany {
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-color);
}

.formularz_uzytkownika .stan_pastylka_uzytkownika.stan-zablokowany {
  color: var(--status-rented);
  background: rgba(255, 59, 48, 0.14);
  border-color: rgba(255, 59, 48, 0.4);
}

/* 4 pastylki siły hasła — wypełniane po kolei (0% → 100% width, animacja) */
.formularz_uzytkownika .pasek_sily_pastylki {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  width: 100%;
  height: 8px;
  margin-top: 10px;
}

.formularz_uzytkownika .pastylka_sily {
  position: relative;
  min-width: 0;
  height: 8px;
  border-radius: 5px;
  background-color: var(--border-color);
  overflow: hidden;
}

.formularz_uzytkownika .pastylka_sily_wypelnienie {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 5px;
  transition:
    width 2s ease-in-out,
    background-image 1s ease-in-out;
}

/* Etykieta słowna pod pastylkami — kolor podąża za poziomem siły */
.formularz_uzytkownika .etykieta_sily_hasla {
  display: block;
  margin-top: 6px;
  font-size: 0.8em;
  font-weight: 700;
  color: var(--text-light);
}

.formularz_uzytkownika .etykieta_sily_hasla[data-poziom="1"] {
  color: #ff4d4d;
}

.formularz_uzytkownika .etykieta_sily_hasla[data-poziom="2"] {
  color: #ff8f00;
}

.formularz_uzytkownika .etykieta_sily_hasla[data-poziom="3"] {
  color: #f1c40f;
}

.formularz_uzytkownika .etykieta_sily_hasla[data-poziom="4"] {
  color: #00b500;
}

.formularz_uzytkownika #haslo_error {
  color: red !important;
  display: block;
  margin-top: 6px;
  font-weight: 700;
}

/* ===== Uprawnienia: Koncepcja 1 — role sticky + macierz ===== */
.formularz_uprawnien {
  max-width: 1400px;
}

.formularz_uprawnien .uklad_uprawnien {
  align-items: start;
}

.formularz_uprawnien .panel_rol_uprawnien {
  position: sticky;
  top: 12px;
}

.formularz_uprawnien .opis_panelu_rol {
  margin: 0 0 12px;
  font-size: 0.8em;
  color: var(--text-dark);
  line-height: 1.4;
}

.formularz_uprawnien .lista_rol_uprawnien {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.formularz_uprawnien .lista_rol_uprawnien .chip_filtra_pojazdow {
  width: 100%;
  justify-content: space-between;
  text-align: left;
}

.formularz_uprawnien .info_uprawnien_side {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  font-size: 0.78em;
  color: var(--text-dark);
  line-height: 1.45;
}

.formularz_uprawnien .info_uprawnien_side p {
  margin: 0 0 8px;
}

.formularz_uprawnien .panel_tresci_uprawnien {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* Macierz jak listy kartowe (użytkownicy / segmenty / pojazdy): osobne wiersze + pomarańczowa obwódka na hover */
.formularz_uprawnien .macierz_uprawnien_wrap {
  overflow-x: auto;
  max-width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.formularz_uprawnien .tabela_uprawnien {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  font-size: 0.86em;
  color: var(--text-light);
  box-shadow: none;
  border: none;
  background: transparent;
}

.formularz_uprawnien .tabela_uprawnien thead th {
  padding: 0 4px 8px;
  background: transparent;
  color: var(--text-dark);
  font-size: 0.78em;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.formularz_uprawnien .tabela_uprawnien thead th.kolumna_roli {
  padding: 0 6px 8px;
  width: auto;
}

.formularz_uprawnien .tabela_uprawnien th.kolumna_sekcja {
  position: sticky;
  left: 0;
  z-index: 3;
  text-align: left;
  width: 1%;
  min-width: 0;
  white-space: nowrap;
  padding-left: 12px;
  padding-right: 18px;
  background: transparent;
  color: var(--text-dark);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
  border: none;
}

.formularz_uprawnien .tabela_uprawnien tbody tr {
  border: none;
}

.formularz_uprawnien .tabela_uprawnien tbody td {
  padding: 10px 4px;
  vertical-align: middle;
  background-color: var(--bg-darker);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-left: none;
  border-right: none;
  border-radius: 0;
}

.formularz_uprawnien .tabela_uprawnien tbody td.kolumna_roli {
  padding: 10px 6px;
  width: auto;
}

.formularz_uprawnien .tabela_uprawnien tbody td:first-child {
  border-left: 1px solid var(--border-color);
  border-top-left-radius: var(--border-radius);
  border-bottom-left-radius: var(--border-radius);
}

.formularz_uprawnien .tabela_uprawnien tbody td:last-child {
  border-right: 1px solid var(--border-color);
  border-top-right-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
}

.formularz_uprawnien .tabela_uprawnien tbody td.kolumna_sekcja {
  position: sticky;
  left: 0;
  z-index: 2;
  text-align: left;
  width: 1%;
  min-width: 0;
  white-space: nowrap;
  padding-left: 12px;
  padding-right: 18px;
  color: var(--text-bialy);
  font-weight: 700;
  background-color: var(--bg-darker);
}

.formularz_uprawnien .tabela_uprawnien tbody tr.wiersz_grupy_uprawnien td {
  padding-top: 12px;
  padding-bottom: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-color);
  background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-darker));
}

.formularz_uprawnien
  .tabela_uprawnien
  tbody
  tr.wiersz_grupy_uprawnien
  td.kolumna_sekcja {
  white-space: nowrap;
}

.formularz_uprawnien .tabela_uprawnien tbody tr.wiersz_grupy_uprawnien:hover td,
.formularz_uprawnien
  .tabela_uprawnien
  tbody
  tr.wiersz_grupy_uprawnien:hover
  td:first-child,
.formularz_uprawnien
  .tabela_uprawnien
  tbody
  tr.wiersz_grupy_uprawnien:hover
  td:last-child {
  border-top-color: var(--border-color);
  border-bottom-color: var(--border-color);
  border-left-color: var(--border-color);
  border-right-color: var(--border-color);
}

.formularz_uprawnien .sekcja_z_ikona {
  display: inline-flex;
  align-items: flex-start;
  column-gap: 18px;
  color: var(--text-light);
}

.formularz_uprawnien .sekcja_tekst {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.formularz_uprawnien .sekcja_opis {
  display: block;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-muted, #9aa3ad);
  white-space: normal;
  max-width: 280px;
}

.formularz_uprawnien .sekcja_z_ikona .mdi {
  flex-shrink: 0;
  display: inline-block;
  width: 1.35em;
  font-size: 1.35em;
  line-height: 1;
  text-align: center;
  margin-top: 2px;
  color: #ff5c00;
}

.formularz_uprawnien .sekcja_z_ikona .mdi::before {
  color: #ff5c00;
}

.formularz_uprawnien .rola_pastylka_naglowek {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--status-reserved);
  background: rgba(7, 186, 255, 0.14);
  border: 1px solid rgba(7, 186, 255, 0.4);
  white-space: nowrap;
}

/* Bez zebry / wypełnienia hover — tylko obwódka jak .wiersz_klienta / .wiersz_segmentu */
.formularz_uprawnien .tabela_uprawnien tbody tr:nth-child(even) td,
.formularz_uprawnien
  .tabela_uprawnien
  tbody
  tr:nth-child(even)
  td.kolumna_sekcja,
.formularz_uprawnien .tabela_uprawnien tbody tr:hover td,
.formularz_uprawnien .tabela_uprawnien tbody tr:nth-child(even):hover td,
.formularz_uprawnien .tabela_uprawnien tbody tr:hover td.kolumna_sekcja,
.formularz_uprawnien
  .tabela_uprawnien
  tbody
  tr:nth-child(even):hover
  td.kolumna_sekcja {
  background-color: var(--bg-darker);
}

.formularz_uprawnien .tabela_uprawnien tbody tr:hover td {
  border-top-color: rgba(255, 92, 0, 0.45);
  border-bottom-color: rgba(255, 92, 0, 0.45);
}

.formularz_uprawnien .tabela_uprawnien tbody tr:hover td:first-child {
  border-left-color: rgba(255, 92, 0, 0.45);
}

.formularz_uprawnien .tabela_uprawnien tbody tr:hover td:last-child {
  border-right-color: rgba(255, 92, 0, 0.45);
}

.formularz_uprawnien .tabela_uprawnien tbody tr.wiersz_grupy_uprawnien td,
.formularz_uprawnien
  .tabela_uprawnien
  tbody
  tr.wiersz_grupy_uprawnien
  td.kolumna_sekcja,
.formularz_uprawnien .tabela_uprawnien tbody tr.wiersz_grupy_uprawnien:hover td,
.formularz_uprawnien
  .tabela_uprawnien
  tbody
  tr.wiersz_grupy_uprawnien:hover
  td.kolumna_sekcja {
  background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-darker));
}

.formularz_uprawnien .checkbox-cell {
  text-align: center;
}

.formularz_uprawnien .checkbox_uprawnienia {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
}

.formularz_uprawnien .checkbox_uprawnienia input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.formularz_uprawnien .checkbox_mark {
  display: inline-block;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border: 1.5px solid var(--border-color);
  border-radius: 3px;
  background-color: var(--bg-darker);
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease;
}

.formularz_uprawnien .checkbox_uprawnienia input:checked + .checkbox_mark {
  background-color: #ff5c00;
  border-color: #ff5c00;
}

.formularz_uprawnien
  .checkbox_uprawnienia
  input:checked
  + .checkbox_mark::after {
  content: "";
  display: block;
  width: 5px;
  height: 9px;
  margin: 1px auto 0;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.formularz_uprawnien
  .checkbox_uprawnienia
  input:focus-visible
  + .checkbox_mark {
  outline: 2px solid rgba(255, 92, 0, 0.55);
  outline-offset: 2px;
}

.formularz_uprawnien .lista_ustawien_uprawnien {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.formularz_uprawnien .wiersz_ustawienia_uprawnien {
  display: grid;
  grid-template-columns: minmax(120px, 0.6fr) minmax(200px, 1.4fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.formularz_uprawnien .etykieta_ustawienia {
  font-weight: 700;
  color: var(--text-bialy);
  font-size: 0.9em;
}

.formularz_uprawnien .pole_ustawienia select,
.formularz_uprawnien .pole_formularza input[type="time"],
.formularz_uprawnien .pole_formularza input[type="email"] {
  width: 100%;
  margin: 6px 0 0 0;
  padding: 8px 10px;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-bialy);
  box-sizing: border-box;
}

.formularz_uprawnien .podpowiedz_pola {
  display: block;
  margin-top: 10px;
  color: var(--text-dark);
  font-size: 0.8em;
  line-height: 1.4;
}

.formularz_uprawnien .podpowiedz_pola code {
  color: var(--text-light);
}

@media (max-width: 900px) {
  .formularz_uprawnien .uklad_uprawnien {
    grid-template-columns: 1fr;
  }

  .formularz_uprawnien .panel_rol_uprawnien {
    position: static;
  }

  .formularz_uprawnien .lista_rol_uprawnien {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .formularz_uprawnien .lista_rol_uprawnien .chip_filtra_pojazdow {
    width: auto;
  }

  .formularz_uprawnien .wiersz_ustawienia_uprawnien {
    grid-template-columns: 1fr;
  }
}

/* ===== Karta / edycja klienta: Koncepcja 3 — podgląd + zakładki ===== */
.formularz_klienta .inicjaly_klienta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 0 12px;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  color: var(--primary-color);
  font-size: 1.35em;
  font-weight: 700;
  letter-spacing: 1px;
  background: rgba(255, 92, 0, 0.08);
  overflow: hidden;
}

.formularz_klienta .inicjaly_klienta.z_logo {
  padding: 10px;
}

.formularz_klienta .inicjaly_klienta.z_logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Podgląd: jedna kolumna — telefon / e-mail / typ / NIP czytelniej jak na makiecie K3 */
.formularz_klienta .siatka_podglad_klienta {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.formularz_klienta .siatka_podglad_klienta .etykieta_danych {
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.72em;
}

/* Odstęp między sekcjami Dane osobowe / Kontakt / Firma (w zakładce gap znikał) */
.formularz_klienta #dane_klienta.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.formularz_klienta .panel_zakladek_klienta {
  min-width: 0;
}

.formularz_klienta .tabs_klienta {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
}

.formularz_klienta .tabs_klienta .tab-link {
  margin: 0;
  padding: 10px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-dark);
  font-size: 0.9em;
  cursor: pointer;
}

.formularz_klienta .tabs_klienta .tab-link.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: 700;
}

.formularz_klienta .panel_zakladek_klienta > .tab-content {
  display: none;
}

.formularz_klienta .panel_zakladek_klienta > .tab-content.active {
  display: block;
}

.formularz_klienta .brak_historii_klienta {
  margin: 8px 0;
  color: var(--text-dark);
  font-size: 0.9em;
}

/* Historia wypożyczeń klienta — wiersze kartowe jak lista klientów */
.formularz_klienta .lista_historii_klienta {
  min-width: 0;
}

.formularz_klienta .naglowek_historii_klienta {
  display: grid;
  grid-template-columns:
    minmax(110px, 1fr) minmax(120px, 1fr) minmax(110px, 1fr)
    minmax(140px, 1.3fr) 110px;
  gap: 8px;
  align-items: center;
  padding: 0 12px 8px;
  color: var(--text-dark);
  font-size: 0.78em;
  font-weight: 600;
}

.formularz_klienta .naglowek_historii_klienta .sort-arrows {
  display: none !important;
}

.formularz_klienta .naglowek_historii_klienta .sort_kolumna::after {
  content: "▲";
  font-size: 0.7em;
  line-height: 1;
  color: var(--text-dark);
  margin-left: 3px;
}

.formularz_klienta .naglowek_historii_klienta .sort_kolumna.sorting_asc::after {
  content: "▲";
  color: var(--primary-color);
}

.formularz_klienta
  .naglowek_historii_klienta
  .sort_kolumna.sorting_desc::after {
  content: "▼";
  color: var(--primary-color);
}

.formularz_klienta .lista_historii_klienta_wiersze {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.formularz_klienta .wiersz_historii_klienta {
  display: grid;
  grid-template-columns:
    minmax(110px, 1fr) minmax(120px, 1fr) minmax(110px, 1fr)
    minmax(140px, 1.3fr) 110px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.86em;
  color: var(--text-light);
}

.formularz_klienta .wiersz_historii_klienta:hover {
  border-color: rgba(255, 92, 0, 0.45);
}

.formularz_klienta .wiersz_historii_klienta.wiersz_anulowany {
  border-color: rgba(229, 57, 53, 0.45);
  box-shadow: inset 3px 0 0 #e53935;
  color: #ff9d99;
}

.formularz_klienta .komorka_historii_klienta {
  min-width: 0;
  word-break: break-word;
}

.formularz_klienta .komorka_pojazd_historii {
  color: var(--primary-color);
  font-weight: 700;
}

.formularz_klienta .status_pastylka_hist {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74em;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-light);
}

.formularz_klienta .status_pastylka_hist.status-anulowany {
  color: #ff9d99;
  background: rgba(229, 57, 53, 0.14);
  border-color: rgba(229, 57, 53, 0.4);
}

@media (max-width: 900px) {
  .formularz_klienta .naglowek_historii_klienta {
    display: none;
  }

  .formularz_klienta .wiersz_historii_klienta {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== Lista segmentów: Koncepcja 1 — belka + wiersze kartowe ===== */
.lista_segmentow_karty {
  max-width: 1100px;
}

.ikona_ubezpieczalni {
  overflow: hidden;
  padding: 4px;
}

.img_ikona_ubezpieczalni {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.img_ikona_ubezpieczalni_duza {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
}

.naglowek_listy_segmentow {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(180px, 1.4fr) 140px 120px;
  gap: 12px;
  align-items: center;
  padding: 0 12px 8px;
  color: var(--text-dark);
  font-size: 0.78em;
  font-weight: 600;
}

.naglowek_listy_segmentow .sort-arrows {
  display: none !important;
}

.naglowek_listy_segmentow .sort_kolumna::after {
  content: "▲";
  font-size: 0.7em;
  line-height: 1;
  color: var(--text-dark);
  margin-left: 3px;
}

.naglowek_listy_segmentow .sort_kolumna.sorting_asc::after {
  content: "▲";
  color: var(--primary-color);
}

.naglowek_listy_segmentow .sort_kolumna.sorting_desc::after {
  content: "▼";
  color: var(--primary-color);
}

.naglowek_listy_segmentow .sort_kolumna_srodek,
.naglowek_listy_segmentow .sort_kolumna_statyczna.sort_kolumna_srodek {
  justify-content: center;
  text-align: center;
  width: 100%;
}

.naglowek_listy_segmentow .sort_kolumna.sort_kolumna_srodek {
  display: inline-flex;
  justify-content: center;
}

.lista_segmentow_wiersze {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wiersz_segmentu {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(180px, 1.4fr) 140px 120px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.88em;
  color: var(--text-light);
}

.wiersz_segmentu:hover {
  border-color: rgba(255, 92, 0, 0.45);
}

.komorka_segmentu {
  min-width: 0;
  word-break: break-word;
}

.komorka_nazwa_segmentu {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-bialy);
  font-weight: 700;
}

.ikona_segmentu {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 92, 0, 0.45);
  background: rgba(255, 92, 0, 0.12);
  color: var(--primary-color);
}

.ikona_segmentu .mdi {
  font-size: 22px;
  line-height: 1;
  color: var(--primary-color);
}

.tekst_nazwy_segmentu {
  color: var(--text-bialy);
}

.komorka_opis_segmentu {
  color: var(--text-dark);
  font-size: 0.92em;
  line-height: 1.35;
}

.komorka_liczba_segmentu {
  text-align: center;
}

.komorka_liczba_segmentu .licznik_pojazdow_segmentu {
  display: block;
  font-weight: 700;
  font-size: 1.15em;
  color: var(--text-bialy);
  line-height: 1.2;
}

.komorka_liczba_segmentu .meta_licznika_segmentu {
  display: block;
  margin-top: 2px;
  font-size: 0.78em;
  color: var(--text-dark);
}

.komorka_edytuj_segmentu {
  text-align: center;
}

.btn_edytuj_segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 96px;
  padding: 6px 12px;
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius);
  background: transparent;
  color: var(--primary-color) !important;
  font-size: 0.82em;
  font-weight: 700;
  text-decoration: none !important;
  box-sizing: border-box;
}

.btn_edytuj_segment .mdi {
  font-size: 16px;
  line-height: 1;
  color: var(--primary-color);
}

.btn_edytuj_segment:hover {
  background: rgba(255, 92, 0, 0.12);
}

.formularz_segmentu .pole_formularza input[type="text"],
.formularz_segmentu .pole_formularza textarea {
  margin: 6px 0 0 0;
  background-color: var(--bg-dark);
  width: 100%;
  box-sizing: border-box;
  color: var(--text-bialy);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 8px 10px;
}

.formularz_segmentu .pole_formularza textarea {
  resize: vertical;
  min-height: 72px;
}

@media (max-width: 700px) {
  .naglowek_listy_segmentow {
    display: none;
  }

  .wiersz_segmentu {
    grid-template-columns: 1fr;
  }

  .komorka_liczba_segmentu,
  .komorka_edytuj_segmentu {
    text-align: left;
  }
}

.podsumowanie_wypozyczenia {
  font-weight: 700;
  font-size: 0.9em;
  line-height: 1.35;
}

.podsumowanie_wypozyczenia b {
  color: var(--primary-color);
}

.podsumowanie_wypozyczenia small {
  display: block;
  margin-top: 2px;
  color: var(--text-dark);
  font-size: 0.85em;
  font-weight: 400;
}

/* Krótki sygnał po dodaniu klienta z modala — zanim wróci wyliczenie kosztu */
.podsumowanie_wypozyczenia.potwierdzenie_klienta {
  color: #9be29e;
}

.podsumowanie_wypozyczenia.potwierdzenie_klienta b {
  color: #9be29e;
}

.przyciski_zapisu {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

.przyciski_zapisu input,
.przyciski_zapisu button,
.pasek_zapisu_plywajacy .przyciski_zapisu a.btn-grey,
.pasek_zapisu_plywajacy .przyciski_zapisu a.btn-dodaj,
.pasek_zapisu_plywajacy .przyciski_zapisu input.btn-dodaj {
  width: auto;
  min-width: 0;
  height: 38px;
  margin: 0;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1;
  box-sizing: border-box;
}

/* Pytanie o przebieg pojawia się w pasku zapisu zamiast przycisków akcji */
.potwierdzenie_zapisu {
  align-self: center;
  color: var(--text-light);
  font-size: 0.85em;
}

.potwierdzenie_zapisu b {
  color: var(--primary-color);
}

/* Wąskie ekrany: karta pojazdu wraca nad formularz i przestaje być przyklejona */
@media (max-width: 1100px) {
  .uklad_wypozyczenia {
    grid-template-columns: minmax(0, 1fr);
  }

  .karta_pojazdu_zwarta {
    position: static;
  }
}

@media (max-width: 760px) {
  .rzad_pol,
  .rzad_trzech {
    grid-template-columns: minmax(0, 1fr);
  }

  .pasek_zapisu_formularza {
    flex-direction: column;
    align-items: stretch;
  }

  .przyciski_zapisu {
    justify-content: flex-end;
  }
}

/* Modal klienta (Koncepcja 3): wyszukaj istniejącego albo dodaj nowego bez
   opuszczania formularza wypożyczenia */
.modal_klienta_tlo {
  position: fixed;
  inset: 0;
  /* Nad .top (z-index: 1000) — inaczej pasek wyszukiwania ucina modal od góry */
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
}

.modal_klienta_tlo.otwarty {
  display: flex;
}

.modal_klienta {
  width: min(520px, 100%);
  max-height: min(90vh, calc(100vh - 40px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
}

.modal_klienta_naglowek {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-dark);
}

.modal_klienta_naglowek h4 {
  margin: 0;
  color: var(--primary-color);
  font-size: 0.95em;
}

.modal_klienta_zamknij {
  background: none;
  border: none;
  color: var(--text-dark);
  font-size: 1.35em;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.modal_klienta_zakladki {
  display: flex;
  border-bottom: 1px solid var(--border-color);
}

.modal_klienta_zakladka {
  flex: 1;
  padding: 9px;
  text-align: center;
  font-size: 0.8em;
  color: var(--text-dark);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.modal_klienta_zakladka.aktywna {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: 700;
}

.modal_klienta_cialo {
  padding: 14px;
  overflow-y: auto;
  /* Przy wyśrodkowaniu i max-height: scroll wewnątrz formularza „Nowy klient” */
  flex: 1 1 auto;
  min-height: 0;
}

.modal_klienta_szukajka {
  width: 100%;
  margin: 0 0 10px 0;
  padding: 9px 12px 9px 32px;
  background-color: var(--bg-dark);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a9aa3' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-bialy);
  font-size: 0.85em;
}

.modal_klienta_lista {
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.modal_klienta_lista button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  text-align: left;
  font-size: 0.82em;
  color: var(--text-light);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(75, 92, 100, 0.5);
  cursor: pointer;
}

.modal_klienta_lista button:last-child {
  border-bottom: none;
}

.modal_klienta_lista button:hover,
.modal_klienta_lista button.wybrany {
  background: rgba(255, 92, 0, 0.12);
  color: var(--text-bialy);
}

.modal_klienta_lista .pusta {
  padding: 14px 10px;
  font-size: 0.82em;
  color: var(--text-dark);
}

.modal_klienta_pola {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

/* Bez min-width:0 komórka siatki nie kurczy się — tel/e-mail nachodziły na siebie */
.modal_klienta_pola > div {
  min-width: 0;
}

.modal_klienta_pola .pelne {
  grid-column: 1 / -1;
}

.modal_klienta_pola label {
  display: block;
  margin-bottom: 3px;
  font-size: 0.72em;
  font-weight: 700;
  color: var(--text-light);
}

.modal_klienta_pola input[type="text"],
.modal_klienta_pola input[type="email"],
.modal_klienta_pola input[type="tel"] {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 8px 10px;
  box-sizing: border-box;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-bialy);
  font-size: 0.85em;
}

.modal_klienta_firma_check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
  font-size: 0.85em;
  color: var(--text-light);
}

.modal_klienta_bledy {
  display: none;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(229, 57, 53, 0.6);
  border-left-width: 4px;
  border-radius: var(--border-radius);
  background-color: rgba(229, 57, 53, 0.12);
  color: #ffc9c6;
  font-size: 0.8em;
}

.modal_klienta_bledy.widoczne {
  display: block;
}

.modal_klienta_stopka {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.modal_klienta_stopka .btn-dodaj,
.modal_klienta_stopka .btn-grey {
  width: auto;
  margin: 0;
}

@media (max-width: 560px) {
  .modal_klienta_pola {
    grid-template-columns: 1fr;
  }
}

/* ===== Panel bazy danych: Koncepcja 2 — status + 2 kolumny + strefa przywracania ===== */
.panel_bazy {
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel_bazy_flash {
  padding: 10px 12px;
  border-radius: var(--border-radius);
  white-space: pre-wrap;
  font-size: 0.88em;
  line-height: 1.4;
}

.panel_bazy_flash_ok {
  border: 1px solid var(--status-free);
  color: var(--status-free);
  background: rgba(0, 181, 0, 0.08);
}

.panel_bazy_flash_err {
  border: 1px solid rgba(253, 0, 25, 0.45);
  color: #ffc9c6;
  background: rgba(253, 0, 25, 0.1);
}

.panel_bazy_status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  padding: 14px 16px;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.panel_bazy_status_lewa {
  min-width: 180px;
}

.panel_bazy_etykieta {
  display: block;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.panel_bazy_nazwa_db {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15em;
  color: var(--text-bialy);
}

.panel_bazy_nazwa_db .mdi {
  color: var(--primary-color);
  font-size: 1.2em;
}

.panel_bazy_status_chipy {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 320px;
}

.panel_bazy_chip {
  min-width: 140px;
  max-width: 280px;
  padding: 8px 12px;
  border: 1px solid rgba(7, 186, 255, 0.35);
  border-radius: var(--border-radius);
  background: rgba(7, 186, 255, 0.1);
}

.panel_bazy_chip_katalog {
  max-width: 360px;
}

.panel_bazy_chip_etykieta {
  display: block;
  font-size: 0.72em;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.panel_bazy_chip_wartosc,
.panel_bazy_meta_wartosc {
  display: block;
  font-size: 0.86em;
  font-weight: 600;
  color: var(--status-reserved);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel_bazy_chip_meta {
  margin-left: 6px;
  color: var(--text-light);
  font-weight: 700;
}

.panel_bazy_status_akcje {
  margin-left: auto;
}

.panel_bazy_btn_primary,
.panel_bazy_status_akcje .btn-dodaj,
.panel_bazy_akcje_rzad .btn-dodaj {
  width: auto;
  margin: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  font-size: 0.875rem;
}

.panel_bazy_btn_primary:hover,
.panel_bazy_status_akcje .btn-dodaj:hover,
.panel_bazy_akcje_rzad .btn-dodaj:hover {
  background-color: var(--primary-hover);
  color: #fff;
}

.panel_bazy_btn_outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid rgba(7, 186, 255, 0.55);
  border-radius: var(--border-radius);
  background: transparent;
  color: var(--status-reserved);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  width: auto;
}

.panel_bazy_btn_outline:hover {
  border-color: var(--status-reserved);
  background: rgba(7, 186, 255, 0.1);
}

.panel_bazy_btn_outline input[type="file"] {
  display: none;
}

.panel_bazy_import_inline {
  margin: 0;
}

.panel_bazy_ostatni {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  min-width: 0;
}

.panel_bazy_nazwa_pliku {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  color: var(--status-reserved);
  font-weight: 700;
  text-decoration: none;
  overflow: hidden;
}

.panel_bazy_nazwa_pliku:hover {
  text-decoration: underline;
  color: var(--status-reserved);
}

.panel_bazy_nazwa_pliku .mdi,
.panel_bazy_wiersz_plik > .mdi {
  flex-shrink: 0;
  color: var(--text-light);
  font-size: 1.15em;
}

.panel_bazy_nazwa_pliku span,
.panel_bazy_wiersz_plik .panel_bazy_nazwa_pliku {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel_bazy_ostatni_meta,
.panel_bazy_wiersz_meta {
  color: var(--text-dark);
  font-size: 0.8em;
}

.panel_bazy_kolumny {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.panel_bazy_karta {
  padding: 14px 16px;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.panel_bazy_karta .tytul_sekcji_formularza {
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel_bazy_karta .tytul_sekcji_formularza .mdi {
  color: var(--primary-color);
}

.panel_bazy_opis {
  margin: 0 0 12px;
  font-size: 0.8em;
  color: var(--text-dark);
  line-height: 1.4;
}

.panel_bazy_opis_uwaga {
  color: #ffc9c6;
}

.panel_bazy_akcje_rzad {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.panel_bazy_akcje_rzad form {
  margin: 0;
}

.panel_bazy_lista_tytul {
  margin: 0 0 8px;
  font-size: 0.86em;
  font-weight: 700;
  color: var(--text-bialy);
}

.panel_bazy_pusto {
  padding: 12px;
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-dark);
  font-size: 0.84em;
}

.panel_bazy_lista {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

.panel_bazy_wiersz {
  display: grid;
  grid-template-columns: minmax(120px, 1.6fr) 140px 72px 36px;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.82em;
  color: var(--text-light);
}

.panel_bazy_wiersz:hover {
  border-color: rgba(255, 92, 0, 0.45);
  background: var(--bg-dark);
}

.panel_bazy_wiersz_plik {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.panel_bazy_ikona_pobierz {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--status-reserved);
  text-decoration: none;
  border-radius: var(--border-radius);
}

.panel_bazy_ikona_pobierz .mdi {
  font-size: 1.35em;
  line-height: 1;
  color: var(--status-reserved);
}

.panel_bazy_ikona_pobierz:hover {
  background: rgba(7, 186, 255, 0.12);
  color: var(--status-reserved);
}

.panel_bazy_harmonogram_pola {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.panel_bazy_harmonogram_pola .pole_formularza {
  min-width: 140px;
}

.panel_bazy_harmonogram_pola input[type="number"] {
  width: 100px;
}

.panel_bazy_dni {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.panel_bazy_dzien {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-dark);
  color: var(--text-light);
  font-size: 0.82em;
  cursor: pointer;
}

.panel_bazy_dzien:has(input:checked) {
  border-color: rgba(255, 92, 0, 0.55);
  color: var(--primary-color);
}

.panel_bazy_podpowiedz {
  font-size: 0.78em;
  color: var(--text-dark);
}

.panel_bazy_strefa_przywracania {
  border-color: rgba(253, 0, 25, 0.45);
  border-left: 4px solid var(--status-rented);
}

.panel_bazy_strefa_przywracania .tytul_sekcji_formularza,
.panel_bazy_strefa_przywracania .tytul_sekcji_formularza .mdi {
  color: var(--status-rented);
}

.panel_bazy_btn_restore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 9px 12px;
  width: auto;
  align-self: flex-start;
  border: 1px solid rgba(253, 0, 25, 0.55);
  border-radius: var(--border-radius);
  background: transparent;
  color: var(--status-rented);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.panel_bazy_btn_restore:hover {
  background: rgba(253, 0, 25, 0.1);
}

.panel_bazy_przywracanie_kolumny {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.panel_bazy_przywracanie_box {
  padding: 12px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.panel_bazy_ostrzezenie {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(253, 0, 25, 0.4);
  border-radius: var(--border-radius);
  background: rgba(253, 0, 25, 0.08);
  color: var(--text-light);
  font-size: 0.82em;
  line-height: 1.4;
}

.panel_bazy_kod_confirm {
  font-weight: 700;
  color: var(--status-rented);
}

.panel_bazy_restore_form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.panel_bazy_restore_form .nazwa-pola-txt {
  margin-top: 4px;
}

.panel_bazy_restore_form select,
.panel_bazy_restore_form input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 980px) {
  .panel_bazy_kolumny,
  .panel_bazy_przywracanie_kolumny {
    grid-template-columns: 1fr;
  }

  .panel_bazy_status_akcje {
    margin-left: 0;
    width: 100%;
  }

  .panel_bazy_wiersz {
    grid-template-columns: 1fr auto;
    gap: 4px;
  }

  .panel_bazy_wiersz_meta {
    display: none;
  }
}

/* ===== Link do aplikacji: Koncepcja 2 — lewy poradnik + lista linków ===== */
.panel_link_aplikacji {
  max-width: 1200px;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.panel_link_side {
  position: sticky;
  top: 12px;
  padding: 16px;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.panel_link_side_ikona {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border-radius: var(--border-radius);
  background: rgba(255, 92, 0, 0.12);
  border: 1px solid rgba(255, 92, 0, 0.35);
}

.panel_link_side_ikona .mdi {
  font-size: 1.6em;
  color: var(--primary-color);
}

.panel_link_side .tytul_sekcji_formularza {
  margin: 0 0 8px;
}

.panel_link_side_lead {
  margin: 0 0 12px;
  font-size: 0.82em;
  line-height: 1.45;
  color: var(--text-dark);
}

.panel_link_kroki {
  margin: 0 0 12px;
  padding-left: 18px;
  color: var(--text-light);
  font-size: 0.84em;
  line-height: 1.5;
}

.panel_link_kroki li {
  margin-bottom: 6px;
}

.panel_link_nota {
  padding: 10px 12px;
  border-left: 3px solid var(--primary-color);
  background: rgba(255, 92, 0, 0.08);
  color: var(--text-light);
  font-size: 0.8em;
  line-height: 1.4;
}

.panel_link_tresci {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel_link_lista {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel_link_wiersz {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.panel_link_wiersz:hover,
.panel_link_wiersz_zalecany {
  border-color: rgba(255, 92, 0, 0.45);
}

.panel_link_pastylka {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72em;
  font-weight: 700;
  white-space: nowrap;
}

.panel_link_pastylka_zalecany {
  color: var(--primary-color);
  background: rgba(255, 92, 0, 0.14);
  border: 1px solid rgba(255, 92, 0, 0.45);
}

.panel_link_pastylka_lan {
  color: var(--status-reserved);
  background: rgba(7, 186, 255, 0.12);
  border: 1px solid rgba(7, 186, 255, 0.4);
}

.panel_link_pastylka_fallback {
  color: #ffc9c6;
  background: rgba(253, 0, 25, 0.1);
  border: 1px solid rgba(253, 0, 25, 0.4);
}

.panel_link_url_wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.panel_link_url_wrap .mdi {
  flex-shrink: 0;
  color: var(--text-light);
  font-size: 1.2em;
}

.panel_link_url {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--status-reserved);
  font-weight: 700;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.86em;
}

.panel_link_akcje {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.panel_link_btn_skopiuj {
  width: auto;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
}

.panel_link_btn_otworz {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: transparent;
  color: var(--text-light);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.panel_link_btn_otworz:hover {
  border-color: rgba(255, 92, 0, 0.45);
  color: var(--primary-color);
}

.panel_link_meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.panel_link_chip {
  min-width: 110px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(7, 186, 255, 0.35);
  border-radius: var(--border-radius);
  background: rgba(7, 186, 255, 0.1);
}

.panel_link_chip_szeroki {
  min-width: 200px;
  flex: 1 1 220px;
}

.panel_link_chip_etykieta {
  display: block;
  font-size: 0.7em;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.panel_link_chip_wartosc {
  display: block;
  font-size: 0.84em;
  font-weight: 700;
  color: var(--status-reserved);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel_link_feedback {
  min-height: 18px;
  font-size: 0.84em;
  font-weight: 600;
}

.panel_link_feedback_ok {
  color: var(--status-free);
}

.panel_link_feedback_err {
  color: #ff8a80;
}

.panel_link_stopka {
  padding-top: 4px;
}

.panel_link_powrot {
  width: auto;
  margin: 0;
  display: inline-flex;
  text-decoration: none;
}

@media (max-width: 900px) {
  .panel_link_aplikacji {
    grid-template-columns: 1fr;
  }

  .panel_link_side {
    position: static;
  }

  .panel_link_wiersz {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .panel_link_akcje {
    justify-content: flex-start;
  }
}

/* ===== Kontakt / wsparcie: Koncepcja 2 — jedna kolumna ===== */
.panel_kontakt {
  max-width: 860px;
  margin: 0 0 30px;
}

.panel_kontakt_karta {
  padding: 18px 20px;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.panel_kontakt_naglowek {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.panel_kontakt_ikona {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(7, 186, 255, 0.16);
  border: 1px solid rgba(7, 186, 255, 0.45);
}

.panel_kontakt_ikona .mdi {
  font-size: 1.55em;
  color: var(--status-reserved);
}

.panel_kontakt_tytul {
  margin: 0 0 4px;
  font-size: 1.15em;
  font-weight: 700;
  color: var(--text-bialy);
  letter-spacing: 0;
  text-transform: none;
}

.panel_kontakt_lead {
  margin: 0;
  font-size: 0.84em;
  line-height: 1.4;
  color: var(--text-dark);
}

.panel_kontakt .rzad_pol {
  margin-bottom: 12px;
}

.panel_kontakt .rzad_pol.panel_kontakt_rzad_tresc {
  grid-template-columns: 1fr;
}

.panel_kontakt .nazwa-pola-txt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.panel_kontakt .nazwa-pola-txt .mdi {
  color: var(--status-reserved);
  font-size: 1.15em;
  line-height: 1;
}

.panel_kontakt .pole_formularza input,
.panel_kontakt .pole_formularza textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-dark);
  color: var(--text-bialy);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 10px 12px;
}

.panel_kontakt .pole_formularza textarea {
  min-height: 160px;
  resize: vertical;
}

.panel_kontakt .pole_formularza_pelne {
  width: 100%;
  grid-column: 1 / -1;
}

.panel_kontakt_akcje {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 12px;
}

.panel_kontakt_btn {
  width: auto;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.panel_kontakt_btn_anuluj {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgba(255, 92, 0, 0.65);
  border-radius: var(--border-radius);
  background: transparent;
  color: var(--primary-color);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.panel_kontakt_btn_anuluj:hover {
  background: rgba(255, 92, 0, 0.1);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.panel_kontakt_stan {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: var(--border-radius);
  text-align: center;
}

.panel_kontakt_stan .mdi {
  font-size: 2.4em;
  display: block;
  margin-bottom: 6px;
}

.panel_kontakt_stan_ok {
  border: 1px solid var(--status-free);
  background: rgba(0, 181, 0, 0.08);
  color: var(--status-free);
}

.panel_kontakt_stan_err {
  border: 1px solid rgba(253, 0, 25, 0.45);
  background: rgba(253, 0, 25, 0.1);
  color: #ffc9c6;
}

.panel_kontakt_stan_tytul {
  margin: 0 0 6px;
  font-size: 1.05em;
  font-weight: 800;
}

.panel_kontakt_stan_opis {
  margin: 0;
  font-size: 0.86em;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-light);
}

.panel_kontakt_rodo {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-dark);
  color: var(--text-dark);
  font-size: 0.8em;
}

.panel_kontakt_rodo summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text-light);
  list-style: none;
}

.panel_kontakt_rodo summary .mdi {
  color: var(--status-reserved);
  font-size: 1.25em;
}

.panel_kontakt_rodo summary::-webkit-details-marker {
  display: none;
}

.panel_kontakt_rodo summary::after {
  content: "▼";
  margin-left: auto;
  font-size: 0.75em;
  color: var(--text-dark);
}

.panel_kontakt_rodo[open] summary::after {
  content: "▲";
}

.panel_kontakt_rodo_tresc {
  margin-top: 8px;
  line-height: 1.5;
  color: var(--text-dark);
}

@media (max-width: 640px) {
  .panel_kontakt .rzad_pol {
    grid-template-columns: 1fr;
  }
}

/* ===== Statystyki K1 — dopasowanie do wzoru (lewa grafika) ===== */

.pulpit-container.panel_statystyk {
  display: block !important;
  max-width: 1280px !important;
  width: 100%;
  padding: 0 10px 48px;
  margin: 0 auto;
  gap: 0;
  grid-template-columns: none !important;
}

@media (min-width: 901px) {
  .pulpit-container.panel_statystyk {
    display: block !important;
    max-width: 1280px !important;
    grid-template-columns: none !important;
  }
}

.pulpit-container.panel_statystyk > h2 {
  margin: 0 0 14px !important;
  color: #ff5c00;
  font-size: 1.45em;
  font-weight: 800;
}

/* Miejsce na menu "Ukryj" (kropki), żeby nie nachodziło na % zmiany */
.pulpit-container.panel_statystyk .radial-chart {
  padding-right: 38px;
}

.pulpit-container.panel_statystyk .radial-charts {
  margin-bottom: 14px;
}

.panel_statystyk .statystyki_naglowek {
  margin-bottom: 14px;
}

.panel_statystyk .statystyki_tytul {
  margin: 0 0 4px;
  color: #ff5c00;
  font-size: 1.45em;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel_statystyk .statystyki_podtytul {
  margin: 0 0 10px;
  color: #8a9aa3;
  font-size: 0.82em;
  font-weight: 600;
}

.panel_statystyk .statystyki_belka {
  position: sticky;
  top: 8px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 14px;
  background: #212a34;
  border: 1px solid #3a4652;
  border-radius: 6px;
}

.panel_statystyk .statystyki_okres {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.panel_statystyk .statystyki_okres_label {
  font-size: 0.88em;
  font-weight: 600;
  color: #8a9aa3;
}

.panel_statystyk .statystyki_okres_grupa {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.panel_statystyk .statystyki_okres_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 7px 14px;
  border: 1px solid #3a4652;
  border-radius: 6px;
  background: #1a222c;
  color: #c9c9c9;
  font-size: 0.84em;
  font-weight: 700;
  cursor: pointer;
  width: auto;
}

.panel_statystyk .statystyki_okres_btn:hover {
  border-color: #ff5c00;
  color: #ff5c00;
}

.panel_statystyk .statystyki_okres_btn.aktywny {
  border-color: #ff5c00;
  background: #ff5c00;
  color: #fff;
}

.panel_statystyk .statystyki_belka #printPDF {
  width: auto;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ff5c00;
  border-color: #ff5c00;
}

/* KPI — K1; reset kolizji ze starymi .radial-chart / .increase w pastele.css */
.panel_statystyk .radial-charts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
  border-radius: 0;
}

.panel_statystyk .radial-chart {
  position: relative;
  display: block;
  flex: none;
  align-items: stretch;
  margin: 0;
  padding: 10px 12px;
  background: #212a34;
  border: 1px solid #3a4652;
  border-radius: 6px;
  box-shadow: none;
  min-height: 0;
}

.panel_statystyk .radial-chart:hover {
  border-color: rgba(255, 92, 0, 0.55);
}

.panel_statystyk .kpi_cialo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel_statystyk .chart-wrapper {
  position: static;
  width: 52px;
  min-height: 58px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  border-radius: 0;
  background: transparent;
  color: #ff5c00;
}

.panel_statystyk .chart-wrapper .mdi {
  font-size: 48px;
  line-height: 1;
  color: #ff5c00;
}

.panel_statystyk .chart-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.panel_statystyk .chart-info h3.kpi_tytul {
  margin: 0;
  padding: 0;
  font-size: 0.72em;
  font-weight: 600;
  color: #8a9aa3;
  line-height: 1.2;
}

.panel_statystyk .kpi_wiersz_nazwa {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 8px;
  align-items: start;
  margin: 0;
  min-width: 0;
}

.panel_statystyk .kpi_nazwa {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  font-size: 1.05em;
  font-weight: 700;
  color: #ffffff;
  word-break: break-word;
  line-height: 1.25;
}

.panel_statystyk .kpi_zmiana {
  grid-column: 2;
  grid-row: 1;
  display: block;
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: none;
  font-size: 0.95em;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  text-align: right;
  align-self: start;
}

.panel_statystyk .kpi_zmiana.increase {
  color: var(--status-free);
  background: none;
}

.panel_statystyk .kpi_zmiana.decrease {
  color: var(--status-rented);
  background: none;
}

.panel_statystyk .kpi_zmiana.neutral {
  color: #8a9aa3;
  background: none;
}

.panel_statystyk .kpi_meta {
  margin: 0;
  font-size: 0.76em;
  font-weight: normal;
  color: var(--status-reserved);
}

/* Panele wykresów */
.panel_statystyk .statystyki_siatka_wykresow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
  align-items: stretch;
}

.panel_statystyk .statystyki_siatka_wykresow > .form-group-2obrys_w_karcie_dark,
.panel_statystyk .statystyki_wykres_pelny > .form-group-2obrys_w_karcie_dark,
.panel_statystyk .statystyki_aktywnosc > .form-group-2obrys_w_karcie_dark {
  margin: 0;
  min-width: 0;
  scroll-margin-top: 72px;
  display: flex;
  flex-direction: column;
}

.panel_statystyk .statystyki_wykres_pelny,
.panel_statystyk .statystyki_aktywnosc {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 14px;
}

.panel_statystyk .form-group-2obrys_w_karcie_dark {
  position: relative;
  background: #212a34 !important;
  border: 1px solid #3a4652 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  padding: 16px 18px !important;
}

.panel_statystyk .form-group-2obrys_w_karcie_dark:hover {
  border-color: rgba(255, 92, 0, 0.4) !important;
}

.panel_statystyk .form-group-2obrys_w_karcie_dark > legend {
  color: #ffffff !important;
  font-weight: 700;
  font-size: 1.02em;
  padding: 0;
  margin: 0 0 10px;
  border: none;
  float: none;
  width: auto;
}

.panel_statystyk .chart-subtitle-svg {
  display: none;
}

.panel_statystyk .statystyki_aktywnosc_tytul {
  margin: 2px 0 0;
  font-size: 0.76em;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8a9aa3;
}

.panel_statystyk .statystyki_pusto {
  padding: 36px 16px;
  text-align: center;
  border: 1px dashed #3a4652;
  border-radius: 6px;
  color: #8a9aa3;
  font-size: 0.9em;
  background: #1a222c;
}

/* SVG K1 — pełna szerokość */
/* Przewijanie długich list wykresów */
.panel_statystyk .statystyki_wykres_scroll {
  max-height: min(520px, 65vh);
  overflow-x: hidden;
  overflow-y: auto;
  margin-top: 4px;
  flex: 1;
}

.panel_statystyk .statystyki_wykres_scroll::-webkit-scrollbar {
  width: 8px;
}

.panel_statystyk .statystyki_wykres_scroll::-webkit-scrollbar-thumb {
  background: #3a4652;
  border-radius: 4px;
}

.panel_statystyk .chart-svg-k1 {
  width: 100%;
  height: auto;
  display: block;
}

.panel_statystyk .chart-svg-k1 .statystyki_siatka {
  stroke: #3a4652;
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.panel_statystyk .chart-svg-k1 .statystyki_os_tick,
.panel_statystyk .chart-svg-k1 .statystyki_os_tytul {
  fill: #8a9aa3;
}

.panel_statystyk .chart-svg-k1 .bar-label-k1 {
  fill: #e8e8e8;
  font-weight: 600;
}

.panel_statystyk .chart-svg-k1 .bar-track-k1 {
  fill: url(#statystyki-tor-kreski);
  stroke: #4b5c64;
  stroke-width: 1;
}

.panel_statystyk .chart-svg-k1 .bar-fill-k1 {
  fill: url(#statystyki-slupek-gradient);
}

/* Słupek po przekroczeniu progu (np. przebieg > limit km) */
.panel_statystyk .chart-svg-k1 .bar-fill-k1.bar-limit {
  fill: url(#statystyki-limit-gradient);
}

/* Słupek w strefie ostrzegawczej (powyżej 75% limitu) */
.panel_statystyk .chart-svg-k1 .bar-fill-k1.bar-warn {
  fill: url(#statystyki-ostrzezenie-gradient);
}

/* Legenda progu przy wykresie z limitem */
.panel_statystyk .statystyki_limit_legenda {
  margin: 2px 0 6px;
  font-size: 0.78em;
  color: var(--text-lighter, #8a9aa3);
}

.panel_statystyk .statystyki_limit_kwadrat {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 2px;
  vertical-align: baseline;
  background: var(--statystyki-grad-limit-koniec, #fd0019);
}

.panel_statystyk .statystyki_limit_kwadrat--ostrzezenie {
  background: var(--statystyki-grad-ostrzezenie-koniec, #f1c40f);
}

.panel_statystyk
  .statystyki_limit_legenda
  .statystyki_limit_kwadrat:not(:first-child) {
  margin-left: 14px;
}

.panel_statystyk .chart-svg-k1 .bar-value-k1 {
  fill: #ffffff;
  font-weight: 700;
}

.panel_statystyk .chart-svg-k1 .bar-label,
.panel_statystyk .chart-svg-k1 .bar-label-k1,
.panel_statystyk .chart-svg-k1 .bar-value-k1 {
  opacity: 1 !important;
}

/* Aktywność — poziome słupki skumulowane */
.panel_statystyk .statystyki_aktywnosc_kontrole {
  justify-content: center;
  align-items: center;
  gap: 0;
  margin: 0 0 10px;
}

.panel_statystyk .statystyki_aktywnosc_kontrole > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.panel_statystyk .statystyki_aktywnosc_kontrole .group-title {
  color: #8a9aa3;
  font-size: 0.78em;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel_statystyk .statystyki_aktywnosc_kontrole .sort-toggle-group {
  border-radius: 6px;
  border-color: #3a4652;
  background: #1a222c;
}

.panel_statystyk .statystyki_aktywnosc_kontrole .sort-toggle-btn {
  border-radius: 6px;
  color: #c9c9c9;
}

.panel_statystyk .statystyki_aktywnosc_kontrole .sort-toggle-btn.is-active {
  background: #ff5c00;
  color: #fff;
}

.panel_statystyk .chart-svg-aktywnosc-k1 {
  width: 100%;
  height: auto;
  display: block;
}

.panel_statystyk .chart-svg-aktywnosc-k1 .statystyki_siatka {
  stroke: #3a4652;
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.panel_statystyk .chart-svg-aktywnosc-k1 .statystyki_os_tick,
.panel_statystyk .chart-svg-aktywnosc-k1 .statystyki_os_tytul,
.panel_statystyk .chart-svg-aktywnosc-k1 .legend-label {
  fill: #8a9aa3;
}

.panel_statystyk .chart-svg-aktywnosc-k1 .legend-swatch-rented {
  fill: var(--statystyki-grad-slupek-koniec, #ff5c00);
}

.panel_statystyk .chart-svg-aktywnosc-k1 .legend-swatch-repair {
  fill: var(--statystyki-grad-naprawa-koniec, #5dade2);
}

.panel_statystyk .chart-svg-aktywnosc-k1 .bar-label-k1 {
  fill: #e8e8e8;
  font-weight: 600;
}

.panel_statystyk .chart-svg-aktywnosc-k1 .bar-track-k1 {
  fill: url(#statystyki-tor-kreski);
  stroke: #4b5c64;
  stroke-width: 1;
}

/* Kolory kreskowanego toru i gradientów słupków — zmienne motywu */
/* Gradienty: od ciemnego (start, lewa) do koloru wzorcowego (koniec, prawa) */
:root {
  --statystyki-tor-tlo: #1d2a38;
  --statystyki-tor-kreska: #31465c;
  --statystyki-grad-slupek-start: #c94a00;
  --statystyki-grad-slupek-koniec: #ff5c00;
  --statystyki-grad-naprawa-start: #2e6da4;
  --statystyki-grad-naprawa-koniec: #5dade2;
  --statystyki-grad-ostrzezenie-start: #b7950b;
  --statystyki-grad-ostrzezenie-koniec: #f1c40f;
  --statystyki-grad-limit-start: #a30010;
  --statystyki-grad-limit-koniec: var(--status-rented, #fd0019);
}

/* Jasny motyw — jaśniejszy kreskowany tor, gradienty bez zmian */
body.light-theme {
  --statystyki-tor-tlo: #e4e9ef;
  --statystyki-tor-kreska: #c9d3dd;
  --statystyki-grad-slupek-start: #c94a00;
  --statystyki-grad-slupek-koniec: #ff5c00;
  --statystyki-grad-naprawa-start: #2e6da4;
  --statystyki-grad-naprawa-koniec: #5dade2;
  --statystyki-grad-ostrzezenie-start: #b7950b;
  --statystyki-grad-ostrzezenie-koniec: #f1c40f;
  --statystyki-grad-limit-start: #a30010;
  --statystyki-grad-limit-koniec: var(--status-rented, #fd0019);
}

.panel_statystyk .chart-svg .statystyki-tor-tlo {
  fill: var(--statystyki-tor-tlo, #1d2a38);
}

.panel_statystyk .chart-svg .statystyki-tor-kreska {
  fill: var(--statystyki-tor-kreska, #31465c);
}

.panel_statystyk .chart-svg .statystyki-grad-slupek-start {
  stop-color: var(--statystyki-grad-slupek-start, #c94a00);
}

.panel_statystyk .chart-svg .statystyki-grad-slupek-koniec {
  stop-color: var(--statystyki-grad-slupek-koniec, #ff5c00);
}

.panel_statystyk .chart-svg .statystyki-grad-naprawa-start {
  stop-color: var(--statystyki-grad-naprawa-start, #2e6da4);
}

.panel_statystyk .chart-svg .statystyki-grad-naprawa-koniec {
  stop-color: var(--statystyki-grad-naprawa-koniec, #5dade2);
}

.panel_statystyk .chart-svg .statystyki-grad-ostrzezenie-start {
  stop-color: var(--statystyki-grad-ostrzezenie-start, #b7950b);
}

.panel_statystyk .chart-svg .statystyki-grad-ostrzezenie-koniec {
  stop-color: var(--statystyki-grad-ostrzezenie-koniec, #f1c40f);
}

.panel_statystyk .chart-svg .statystyki-grad-limit-start {
  stop-color: var(--statystyki-grad-limit-start, #a30010);
}

.panel_statystyk .chart-svg .statystyki-grad-limit-koniec {
  stop-color: var(--statystyki-grad-limit-koniec, #fd0019);
}

/* Gradienty segmentów aktywności */
.panel_statystyk .chart-svg-aktywnosc-k1 .bar-seg-rented {
  fill: url(#statystyki-slupek-gradient);
}

.panel_statystyk .chart-svg-aktywnosc-k1 .bar-seg-repair {
  fill: url(#statystyki-naprawa-gradient);
}

/* Cień i animacja narastania słupków */
.panel_statystyk .chart-svg-k1 .bar-fill-k1,
.panel_statystyk .chart-svg-aktywnosc-k1 .bar-seg-rented,
.panel_statystyk .chart-svg-aktywnosc-k1 .bar-seg-repair {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
  transform-box: fill-box;
  transform-origin: left center;
  animation: statystykiSlupekWzrost 0.9s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes statystykiSlupekWzrost {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.panel_statystyk .chart-svg-aktywnosc-k1 .bar-value-k1 {
  fill: #ffffff;
  font-weight: 700;
}

.panel_statystyk .chart-svg-aktywnosc-k1 .bar-seg-label {
  fill: #ffffff;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .panel_statystyk .radial-charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel_statystyk .statystyki_siatka_wykresow {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .panel_statystyk .radial-charts {
    grid-template-columns: 1fr;
  }

  .panel_statystyk .statystyki_belka {
    position: static;
  }
}

/* === Ustawienia wyświetlania (Koncepcja 1: karty 2x2 + ikony z koncepcji 3) === */
.ustawienia_formularz {
  max-width: 1100px;
}

.ustawienia_siatka {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* Równe wiersze — wszystkie karty mają ten sam rozmiar niezależnie od zawartości */
  grid-auto-rows: 1fr;
  gap: 20px;
}

.ustawienia_karta {
  margin: 0;
  padding: 18px 20px;
  background: #212a34;
  border: 1px solid #3a4652;
  border-radius: 6px;
  /* Wiersze rozkładają się równomiernie na całej wysokości karty */
  display: flex;
  flex-direction: column;
}

.ustawienia_karta .ustawienia_wiersz {
  flex: 1;
}

.ustawienia_karta .tytul_sekcji_formularza {
  margin-top: 0;
}

.ustawienia_wiersz {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.ustawienia_wiersz + .ustawienia_wiersz {
  border-top: 1px solid #3a4652;
}

.ustawienia_wiersz:hover {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
}

/* Status zapisu na pasku (AJAX) */
.ustawienia_status {
  margin-left: 12px;
  font-weight: 700;
  font-size: 0.9em;
}

.ustawienia_status.ok {
  color: #00b500;
}

.ustawienia_status.blad {
  color: var(--status-rented, #fd0019);
}

.ustawienia_status_karta {
  margin-left: 10px;
  font-size: 0.78em;
  font-weight: 700;
  vertical-align: middle;
}

.ustawienia_status_karta.ok {
  color: #00b500;
}

.ustawienia_status_karta.blad {
  color: var(--status-rented, #fd0019);
}

.ustawienia_btn_przywroc {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.82em;
}

.ustawienia_btn_przywroc:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Ikona w zaokrąglonym kwadracie — wzór z koncepcji nr 3 */
.ustawienia_ikona {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  color: var(--primary-color);
  background: rgba(255, 92, 0, 0.08);
}

.ustawienia_ikona .material-icons-outlined {
  font-size: 20px;
}

.ustawienia_etykieta {
  flex: 1;
  cursor: pointer;
  font-size: 0.95em;
}

/* Przełącznik (toggle) zamiast checkboxa */
.przelacznik {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
}

.przelacznik input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.przelacznik_tor {
  position: absolute;
  inset: 0;
  background: #3a4652;
  border-radius: 999px;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.przelacznik_tor::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s ease;
}

.przelacznik input:checked + .przelacznik_tor {
  background: var(--primary-color);
}

.przelacznik input:checked + .przelacznik_tor::before {
  transform: translateX(20px);
}

.przelacznik input:focus-visible + .przelacznik_tor {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Wiersze z polami liczbowymi (karta Limity) */
.ustawienia_wiersz--pole {
  align-items: flex-start;
}

.ustawienia_wiersz--pole .ustawienia_ikona {
  margin-top: 4px;
}

.ustawienia_pole {
  flex: 1;
  min-width: 0;
}

.ustawienia_pole input[type="number"],
.ustawienia_pole input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  margin: 6px 0 0;
}

.ustawienia_pole .podpowiedz_pola {
  display: block;
  margin-top: 6px;
  color: var(--text-dark);
  font-size: 0.8em;
}

@media (max-width: 900px) {
  .ustawienia_siatka {
    grid-template-columns: 1fr;
    /* W jednej kolumnie każda karta wraca do naturalnej wysokości */
    grid-auto-rows: auto;
  }
}

/* === Profil: karta podglądu — Koncepcja 2 (tożsamość na środku + chipy) === */
.karta_podglad_profilu {
  text-align: center;
}

.karta_podglad_profilu .inicjaly_klienta {
  width: 96px;
  height: 96px;
  margin: 8px auto 12px;
  font-size: 1.7em;
}

.karta_podglad_profilu .podglad_nazwa_pojazdu {
  margin: 0 0 10px;
  color: var(--text-bialy);
}

.karta_podglad_profilu .typ_pastylka_klienta {
  display: inline-block;
}

.karta_podglad_profilu .profil_podglad_email {
  margin: 10px 0 0;
  color: var(--text-dark);
  font-size: 0.85em;
  word-break: break-all;
}

.karta_podglad_profilu .profil_chipy {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  text-align: left;
}

.karta_podglad_profilu .profil_chipy:has(.profil_chip:only-child) {
  grid-template-columns: 1fr;
}

.karta_podglad_profilu .profil_chip {
  min-width: 0;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #3a4652;
  border-radius: 6px;
}

.karta_podglad_profilu .profil_chip .pasek_koloru_uzytkownika {
  margin-right: 6px;
}

.karta_podglad_profilu .profil_podglad_pastylki {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.karta_podglad_profilu .profil_chip_podetykieta {
  display: block;
  margin: -1px 0 4px;
  color: var(--text-dark);
  font-size: 0.68em;
  letter-spacing: 0.4px;
}

.karta_podglad_profilu .profil_chip_godzina {
  display: block;
  margin-top: 2px;
  color: var(--text-dark);
  font-size: 0.82em;
}

@media print {
  .panel_statystyk .statystyki_belka,
  .panel_statystyk .statystyki_aktywnosc_tytul {
    display: none !important;
  }

  .panel_statystyk .statystyki_wykres_scroll {
    max-height: none;
    overflow: visible;
  }

  .panel_statystyk .statystyki_siatka_wykresow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 16px;
  }
}

@media print {
  body.strona_tablicy {
    background: #fff !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  body.strona_tablicy::before,
  body.strona_tablicy::after {
    display: none !important;
  }

  body.strona_tablicy .top,
  body.strona_tablicy nav,
  body.strona_tablicy .belka_tablicy,
  body.strona_tablicy .wskazowka_kafelkow,
  body.strona_tablicy .ostrzezenie_tablicy,
  body.strona_tablicy #svg-tooltip,
  body.strona_tablicy .session-timer,
  body.strona_tablicy .belka_przycisk_drukuj,
  body.strona_tablicy footer {
    display: none !important;
  }

  body.strona_tablicy main.zalogowany,
  body.strona_tablicy main.zalogowany.minimized {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    background: #fff !important;
    overflow: visible !important;
    box-shadow: none !important;
  }

  body.strona_tablicy .naglowek_wydruku_tablicy {
    display: block !important;
    margin: 0 0 10px;
    padding: 0 0 8px;
    color: #111;
    border-bottom: 3px solid #ff5c00;
    break-after: avoid;
    page-break-after: avoid;
  }

  body.strona_tablicy .wydruk_tablicy_belka {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  body.strona_tablicy .wydruk_tablicy_firma_blok {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  body.strona_tablicy .wydruk_tablicy_pas {
    flex-shrink: 0;
    width: 8px;
    height: 42px;
    background: #ff5c00;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.strona_tablicy .naglowek_wydruku_tablicy h1 {
    margin: 2px 0 0;
    font-size: 18px;
    color: #1a4484;
  }

  body.strona_tablicy .naglowek_wydruku_tablicy p {
    margin: 0;
    font-size: 10px;
    color: #555;
  }

  body.strona_tablicy .naglowek_wydruku_tablicy .wydruk_tablicy_firma {
    margin: 0;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ff5c00;
  }

  body.strona_tablicy .wydruk_tablicy_meta {
    margin: 4px 0 0;
    font-size: 10px;
    color: #555;
  }

  body.strona_tablicy .wydruk_tablicy_meta .wydruk_tablicy_data::before {
    content: " · ";
  }

  body.strona_tablicy .belka_kafelki_wydruku {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    margin: 0;
  }

  body.strona_tablicy .belka_kafelki_wydruku .kafelek_statusu {
    min-width: 62px;
    padding: 3px 7px;
    background: #f6f6f6 !important;
    border: 1px solid #d0d0d0 !important;
    border-radius: 6px;
  }

  body.strona_tablicy .belka_kafelki_wydruku .kafelek_opis {
    color: #666;
  }

  body.strona_tablicy .pojazdy-container,
  body.strona_tablicy:not(.wydruk-kafelki) .siatka_zrzutow_kafelkow {
    display: none !important;
  }

  body.strona_tablicy.wydruk-kafelki .siatka_zrzutow_kafelkow {
    --skala-wydruku: 0.52;
    display: flex !important;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 6px;
    padding: 0;
  }

  body.strona_tablicy.wydruk-kafelki .kafelek_miniaturka {
    width: calc(var(--kafelek-w, 320px) * var(--skala-wydruku));
    height: calc(var(--kafelek-h, 120px) * var(--skala-wydruku));
    overflow: hidden;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.strona_tablicy.wydruk-kafelki .kafelek_miniaturka .box_pojazdu {
    width: var(--kafelek-w, 320px) !important;
    margin: 0;
    animation: none !important;
    transform: scale(var(--skala-wydruku));
    transform-origin: top left;
    pointer-events: none;
    color: var(--text-bialy);
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.strona_tablicy .otoczka_kafelka_zwrotu,
  body.strona_tablicy .kafelek_miniaturka:has(.kafelek_zwrot_jutro) {
    animation: none !important;
    filter: drop-shadow(0 0 4px rgba(255, 92, 0, 0.55));
  }

  body.strona_tablicy #printPopupTablicy,
  body.strona_tablicy #printPopupOverlayTablicy {
    display: none !important;
  }

  body.strona_tablicy.wydruk-tabela .tabela_wydruku_tablicy,
  body.strona_tablicy.wydruk-terminy .tabela_wydruku_terminow {
    display: block !important;
    margin: 12px 0 0;
    color: #111;
    background: #fff !important;
  }

  body.strona_tablicy .tabela_wydruku_tablicy h2,
  body.strona_tablicy .tabela_wydruku_terminow h2 {
    margin: 0 0 8px;
    font-size: 13px;
    color: #ff5c00;
  }

  body.strona_tablicy .tabela_wydruku_tablicy table,
  body.strona_tablicy .tabela_wydruku_terminow table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9px;
    background: #fff !important;
    box-shadow: none !important;
    border: 1px solid #d8d8d8 !important;
  }

  body.strona_tablicy .tabela_wydruku_tablicy th,
  body.strona_tablicy .tabela_wydruku_terminow th,
  body.strona_tablicy .tabela_wydruku_tablicy thead th,
  body.strona_tablicy .tabela_wydruku_terminow thead th {
    background-color: #ff5c00 !important;
    color: #fff !important;
    text-align: left;
    padding: 5px 7px;
    border: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.strona_tablicy .tabela_wydruku_tablicy td,
  body.strona_tablicy .tabela_wydruku_terminow td,
  body.strona_tablicy .tabela_wydruku_tablicy tbody td,
  body.strona_tablicy .tabela_wydruku_terminow tbody td {
    background-color: #fff !important;
    color: #111 !important;
    border: none !important;
    border-bottom: 1px solid #e6e6e6 !important;
    padding: 4px 7px;
  }

  body.strona_tablicy .tabela_wydruku_tablicy tr:nth-child(even) td,
  body.strona_tablicy .tabela_wydruku_terminow tr:nth-child(even) td,
  body.strona_tablicy .tabela_wydruku_tablicy tbody tr:nth-child(even) td,
  body.strona_tablicy .tabela_wydruku_terminow tbody tr:nth-child(even) td {
    background-color: #f3f3f3 !important;
    color: #111 !important;
  }

  body.strona_tablicy .tabela_wydruku_tablicy tr:hover td,
  body.strona_tablicy .tabela_wydruku_terminow tr:hover td,
  body.strona_tablicy .tabela_wydruku_tablicy tbody tr:hover td,
  body.strona_tablicy .tabela_wydruku_terminow tbody tr:hover td {
    background-color: #fff !important;
  }

  body.strona_tablicy .tabela_wydruku_tablicy tbody tr:nth-child(even):hover td,
  body.strona_tablicy
    .tabela_wydruku_terminow
    tbody
    tr:nth-child(even):hover
    td {
    background-color: #f3f3f3 !important;
  }

  body.strona_tablicy .tabela_wydruku_tablicy tr,
  body.strona_tablicy .tabela_wydruku_terminow tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
