/* public/styles/gear.css */
/* ================= GEAR ================= */

.gearToolbar {
  display: grid;
  gap: var(--space-3);
  margin-top: 12px;
}

.gearSearchSection {
  display: grid;
  gap: 4px;
}

.gearSearchLabel {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: space-between;
}

.gearSearchLabel label {
  margin: 0;
  font-weight: 600;
}

.gearMetaInline {
  font-size: 12px;
  white-space: nowrap;
}

.gearSearchRow {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.gearSearchRow input {
  flex: 1;
  min-width: 0;
}

.gearFiltersBar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: end;
}

.gearCheckPill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

:root[data-theme="light"] .gearCheckPill {
  background: rgba(12,18,32,0.02);
}

.gearCheckPill input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.gearCheckPill span {
  line-height: 1;
}

.gearTypeFilter {
  display: grid;
  gap: 6px;
}

.gearTypeFilter label {
  margin: 0;
}

.gearGrid {
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr;
  margin-top: 8px;
}

.gearCard {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  box-shadow: var(--shadow-1);
  overflow: hidden;
  position: relative;
}

:root[data-theme="light"] .gearCard {
  background: linear-gradient(180deg, rgba(12,18,32,0.02), rgba(12,18,32,0.01));
}

/* Karta bez zdjęć (rzutki, fartuchy — brak prawdziwych zdjęć, zawsze placeholder,
   patrz renderGenericGearCard) — kolumna na zdjęcie (76px) znika, treść zajmuje
   całą szerokość. Wyższa specyficzność (2 klasy) niż bazowa/mobilna reguła
   .gearCardInner (1 klasa) — wygrywa niezależnie od viewportu. */
.gearCardNoPhoto .gearCardInner {
  grid-template-columns: 1fr;
}

.gearCardNoPhoto .gearHead,
.gearCardNoPhoto .gearMiniBar,
.gearCardNoPhoto .gearDetails {
  grid-column: 1;
}

.gearCardInner {
  padding: 0;
  gap: 0;
  display: grid;
  grid-template-columns: 76px 1fr;
  grid-template-rows: 1fr auto auto;
  min-height: 80px;
}

.gearHead {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0;
  padding: 8px 6px 2px 10px;
}

.gearHeadSide {
  display: grid;
  gap: 10px;
  justify-items: end;
  min-width: auto;
}

.gearTitleWrap {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.gearTitleLine {
  display: flex;
  align-items: baseline;
  gap: 5px;
  overflow: hidden;
  min-width: 0;
}

.gearTitle {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gearModel {
  font-size: 11px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.gearNrInline    { font-size: 11px; font-weight: 900; color: var(--text); white-space: nowrap; flex-shrink: 0; }
.gearMiniType    { display: block; font-size: 10px; font-weight: 600; color: var(--text-muted); line-height: 1.3; }
.gearNrColorMobile { display: block; font-size: 10px; color: var(--text-muted); line-height: 1.3; }

/* .gearBadges: pozostaje display:none — używane też w my_reservations_module.js
   (status rezerwacji, aktualnie ukryty; osobne zgłoszenie do decyzji). */
.gearBadges {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  white-space: nowrap;
}

.badge.ok {
  border-color: rgba(74, 222, 128, 0.35);
  background: var(--ok-2);
}

.badge.danger {
  border-color: rgba(255, 107, 107, 0.35);
  background: var(--danger-2);
}

.badge.soft {
  border-color: rgba(138, 180, 255, 0.35);
  background: var(--primary-2);
}

.badge.pool {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.12);
  color: rgb(56, 189, 248);
}

.gearPoolActionLabel {
  align-self: center;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
}

/* Favourite heart button */
.gearFavBtn {
  background: none;
  border: none;
  padding: 3px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.15s, transform 0.15s;
  min-width: 30px;
  min-height: 30px;
  align-self: start;
}

.gearFavBtn svg {
  width: 17px;
  height: 17px;
  pointer-events: none;
}

.gearFavBtn:hover {
  color: #f87171;
  transform: scale(1.15);
}

.gearFavBtn.active {
  color: #f87171;
}

.gearFavBtn.active svg {
  filter: drop-shadow(0 0 4px rgba(248,113,113,0.5));
}

.gearImgs {
  grid-column: 1;
  grid-row: 1 / 3;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  width: 100%;
}

.gearImgsSingle {
  display: flex;
  flex-direction: column;
}

.gearImgBtn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  width: 100%;
}

.gearImgsSingle .gearImgBtn {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.gearImgPh {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(0,0,0,0.18);
  display: grid;
  place-items: center;
  position: relative;
}

.gearImgsSingle .gearImgPh {
  aspect-ratio: unset;
  flex: 1;
  min-height: 0;
  border-radius: 0;
  border-top: 0;
  border-left: 0;
  border-bottom: 0;
  border-right: 1px solid var(--border);
}

.gearImgsSingle .gearImgLabel { display: none; }

.gearImgCounter {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(0,0,0,0.52);
  color: #fff;
  pointer-events: none;
  line-height: 1.3;
}

.gearPhotoLoading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.35);
  pointer-events: none;
}

.gearPhotoLoading .spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gearSpin 0.8s linear infinite;
}

@keyframes gearSpin {
  to { transform: rotate(360deg); }
}

:root[data-theme="light"] .gearImgPh {
  background: rgba(12,18,32,0.04);
}

.gearImgPh img {
  width: 54%;
  height: 54%;
  object-fit: contain;
  opacity: 0.9;
}

.gearImgPh img.gearCoverLoaded {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
}

.gearImgLabel {
  position: absolute;
  left: 10px;
  bottom: 10px;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  color: var(--text);
  backdrop-filter: blur(10px);
}

:root[data-theme="light"] .gearImgLabel {
  background: rgba(255,255,255,0.65);
  color: var(--text);
}

.gearMoreBtn {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: auto;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  border-radius: 0;
}

.gearMoreBtn:hover {
  transform: none;
  border-color: transparent;
  color: var(--text);
  text-decoration: underline;
}

.gearMoreBtn:focus-visible {
  box-shadow: none;
  outline: none;
  text-decoration: underline;
}

.gearDetails {
  grid-column: 1 / 3;
  grid-row: 3;
  border-top: 1px dashed rgba(230, 232, 238, 0.10);
  padding: 6px 10px 8px 10px;
  font-size: 12px;
}

:root[data-theme="light"] .gearDetails {
  border-top-color: rgba(12, 18, 32, 0.12);
}

.gearDetailsSummary {
  cursor: pointer;
  font-weight: 900;
  font-size: 13px;
  color: var(--text);
  list-style: none;
  display: none;
}

.gearDetailsSummary::-webkit-details-marker { display: none; }

.gearMeta {
  display: grid;
  gap: 6px;
  font-size: 13px;
  margin-top: 0;
}

.gearMetaRow {
  display: flex;
  gap: 6px;
  align-items: baseline;
  border-top: 1px dashed rgba(230, 232, 238, 0.12);
  padding-top: 8px;
}

:root[data-theme="light"] .gearMetaRow {
  border-top-color: rgba(12, 18, 32, 0.12);
}

.gearMetaKey {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.gearMetaVal {
  color: var(--text);
  font-weight: 400;
  text-align: left;
}

/* ✅ Ramka 1px: zielona = sprawny klubowy, czerwona = niesprawny klubowy, żółta = prywatny */
.gearCard::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  pointer-events: none;
  border: 1px solid rgba(230, 232, 238, 0.20);
}

.gearOk::before { border-color: rgba(74, 222, 128, 0.75); }
.gearBad::before { border-color: rgba(255, 107, 107, 0.75); }
.gearPrivate::before { border-color: rgba(250, 204, 21, 0.85); }

/* ================= GEAR MODALS ================= */

.gearModal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: var(--space-3);
}

.gearModalBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
}

.gearModalCard {
  position: relative;
  width: min(920px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(16,24,40,0.92), rgba(16,24,40,0.82));
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

:root[data-theme="light"] .gearModalCard {
  background: rgba(255,255,255,0.92);
}

.gearModalTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.gearModalTitle {
  font-weight: 900;
}

.gearModalClose {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
}

.gearModalBody {
  padding: var(--space-3);
  display: grid;
  place-items: center;
}

/* Modal rezerwacji/edycji terminu — kalendarz + rosnąca lista dodanego sprzętu
   potrafi przekroczyć wysokość ekranu także na desktopie (nie tylko mobile, stąd
   poza @media). Bez własnego scrolla treść stawała się nieosiągalna: modal ma
   position:fixed i nie rośnie ze stroną, a document.body.style.overflow="hidden"
   (ustawiane na czas otwarcia modala) blokuje scroll tła jako jedyną alternatywę.
   display:block nadpisuje domyślne grid+place-items:center z .gearModalBody —
   przy przewijalnej zawartości wyśrodkowanie w gridzie przycina górę treści
   niezależnie od pozycji scrolla (znany efekt place-items:center + overflow). */
#gearBundleModal .gearModalCard,
#reservationEditModal .gearModalCard,
#gearDamageModal .gearModalCard {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

#gearBundleModal .gearModalBody,
#reservationEditModal .gearModalBody,
#gearDamageModal .gearModalBody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: block;
  /* Bazowe .gearModalBody ma place-items:center (dla trybu grid z pojedynczym
     zdjęciem) — samo display:block NIE czyści zostawionego justify-items:center,
     które we `display:block` nadal działa (CSS Box Alignment L3: wyrównanie
     blokowych dzieci) i kurczy je do szerokości treści zamiast rozciągać na
     całą szerokość (odkryte na polu Opis w #gearDamageModal, 07.09.2026). */
  justify-items: normal;
}

.gearModalBody img {
  width: 100%;
  height: auto;
  max-height: 70vh;
  border-radius: 14px;
  border: 1px solid var(--border);
  object-fit: contain;
  background: rgba(0,0,0,0.15);
}

:root[data-theme="light"] .gearModalBody img {
  background: rgba(12,18,32,0.03);
}

/* Photo viewer: image wrapper with overlay nav arrows */
.gearImgViewer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.gearImgNavBtn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.48);
  backdrop-filter: blur(6px);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  min-width: 0;
  min-height: 0;
  transition: background 0.15s;
  user-select: none;
}

.gearImgNavBtn:hover {
  background: rgba(0,0,0,0.72);
  border-color: rgba(255,255,255,0.35);
  transform: translateY(-50%) scale(1.08);
}

.gearImgNavPrev { left: 10px; }
.gearImgNavNext { right: 10px; }

.gearImgNavBtn.hidden { display: none; }

.gearModalActions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  border-top: 1px solid var(--border);
}

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

  .gearHeadSide {
    justify-items: start;
    min-width: 0;
  }
}

/* ================= GEAR TABS ================= */

.gearTabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: var(--space-2) 0;
}

.gearTab {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  border-radius: var(--radius-md);
  padding: 7px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.gearTabIcon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.gearTabIcon svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.gearTab.active {
  border-color: rgba(138, 180, 255, 0.5);
  background: linear-gradient(180deg, rgba(138, 180, 255, 0.22), rgba(138, 180, 255, 0.12));
}

/* Reload icon button */
.gearReloadBtn {
  width: 40px;
  height: 40px;
  min-width: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  flex-shrink: 0;
}

.gearReloadBtn svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

/* Mały trigger poradnika doboru kamizelki — element gridu .gearToolbar domyślnie
   rozciąga się na pełną szerokość (justify-items:stretch), więc trzeba go
   jawnie skurczyć i wyrównać do lewej. */
.gearInfoBtn {
  justify-self: start;
  padding: 8px 14px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ================= MOBILE OPTIMIZATIONS ================= */

/* --- Tabs i toolbar: kompaktowy układ na ≤720px --- */
@media (max-width: 720px) {

  .gearTabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    flex-wrap: unset;
    gap: 4px;
    padding-bottom: 0;
  }

  .gearTab {
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    font-size: 10px;
    border-radius: var(--radius-md);
  }

  .gearTabIcon svg {
    width: 20px;
    height: 20px;
  }

  .gearTabLabel {
    line-height: 1.1;
    text-align: center;
  }

  .gearToolbar {
    gap: var(--space-2);
    margin-top: 8px;
  }
}

/* --- Modale: bottom sheet tylko na telefonach ≤600px --- */
@media (max-width: 600px) {

  .gearModal {
    padding: 0;
    align-items: flex-end;
  }

  .gearModalCard {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
  }

  .gearModalBody {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-2);
  }

  .gearModalBody img {
    max-height: 52vh;
  }

  .gearModalActions {
    padding: var(--space-2) var(--space-3);
    padding-bottom: max(var(--space-2), env(safe-area-inset-bottom));
  }

  #gearReservationModal .gearModalCard,
  #gearBundleModal .gearModalCard {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 92vh;
    overflow-y: auto;
  }

  /* Photo modal stays centered, not bottom-sheet */
  #gearImgModal {
    padding: var(--space-2);
    align-items: center;
  }

  #gearImgModal .gearModalCard {
    width: 100%;
    border-radius: var(--radius-lg);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
  }

  #gearImgModal .gearModalBody {
    flex: 1;
    overflow: hidden;
    padding: var(--space-2);
  }

  #gearImgModal .gearModalBody img {
    max-height: 72vh;
  }
}

/* ================= MINI CARD (mobile-only elements) ================= */

.gearMiniBar {
  display: flex;
  grid-column: 2;
  grid-row: 2;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 8px 8px;
  gap: 4px;
}

.gearMiniIcons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gearMiniStatusIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.gearMiniStatusIcon svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.gearMiniOk     { color: #4ade80; }
.gearMiniBad    { color: #f87171; }
.gearMiniLocked { color: #fbbf24; }
.gearMiniHalf  { color: #38bdf8; }
.gearMiniPriv {
  color: #ca8a04;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.gearMiniMoreBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 7px;
  transition: color 0.15s, background 0.15s;
  min-width: 0;
  min-height: 0;
}

.gearMiniMoreBtn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
  transform: none;
  border-color: transparent;
}

:root[data-theme="light"] .gearMiniMoreBtn:hover {
  background: rgba(12,18,32,0.06);
}

.gearMiniMoreBtn svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.gearMiniReserveBtn {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 800;
  min-height: 30px;
  border-radius: 8px;
  white-space: nowrap;
  min-width: 0;
}

/* --- Telefony (≤600px): kompaktowe karty poziome --- */
@media (max-width: 600px) {

  /* Single column list */
  .gearGrid {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 8px;
  }

  .gearCard {
    border-radius: var(--radius-md);
  }

  /* Horizontal card: [photo 76px] | [content] */
  .gearCardInner {
    padding: 0;
    gap: 0;
    display: grid;
    grid-template-columns: 76px 1fr;
    grid-template-rows: 1fr auto auto;
    min-height: 80px;
  }

  /* Photo: left column, spans rows 1–2 */
  .gearImgs {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .gearImgsSingle {
    display: flex;
    flex-direction: column;
  }

  .gearImgBtn {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .gearImgsSingle .gearImgPh {
    aspect-ratio: unset;
    flex: 1;
    min-height: 0;
    border-radius: 0;
    border-top: 0;
    border-left: 0;
    border-bottom: 0;
    border-right: 1px solid var(--border);
  }

  .gearImgsSingle .gearImgLabel { display: none; }

  /* Head: right column, row 1 */
  .gearHead {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 0;
    padding: 8px 6px 2px 10px;
  }

  .gearTitleWrap { gap: 1px; }

  /* Brand + Model on one line */
  .gearTitleLine {
    display: flex;
    align-items: baseline;
    gap: 5px;
    overflow: hidden;
  }

  .gearTitle {
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .gearModel {
    font-size: 11px;
    font-weight: 900;
    color: var(--text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  /* Type: visible on mobile */
  .gearMiniType {
    display: block !important;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.3;
  }

  /* Nr (color) combined line */
  .gearNrColorMobile {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.3;
  }

  .gearHeadSide {
    min-width: auto;
    justify-items: end;
  }

  .gearFavBtn {
    min-width: 30px;
    min-height: 30px;
    padding: 3px;
  }

  .gearFavBtn svg {
    width: 17px;
    height: 17px;
  }

  /* Mini status bar: right column, row 2 */
  .gearMiniBar {
    display: flex !important;
    grid-column: 2;
    grid-row: 2;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px 8px 8px;
    gap: 4px;
  }

  /* Details: spans both columns, row 3 */
  .gearDetails {
    grid-column: 1 / 3;
    grid-row: 3;
    border-top: 1px dashed rgba(230, 232, 238, 0.10);
    padding: 6px 10px 8px 10px;
    font-size: 12px;
  }

  :root[data-theme="light"] .gearDetails {
    border-top-color: rgba(12, 18, 32, 0.10);
  }

  .gearMeta { gap: 4px; }
  .gearMetaRow { padding-top: 5px; }

  /* Hide desktop-only elements */
  .gearDetailsSummary { display: none; }

  /* Toolbar: single column */
  .gearFiltersBar {
    grid-template-columns: 1fr;
  }
}

/* ================= GEAR RESERVATIONS SECTION ================= */

.gearReservSection {
  margin-top: 12px;
  border-top: 1px dashed rgba(230, 232, 238, 0.15);
  padding-top: 10px;
}

:root[data-theme="light"] .gearReservSection {
  border-top-color: rgba(12, 18, 32, 0.12);
}

/* ================= RESERVATIONS LIST ================= */

.gearReservNoData {
  font-size: 12px;
  color: var(--text-muted, #888);
}

/* ─── Widok masowego dodawania sprzętu na imprezę klubową ─── */

.clubEventItemList {
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.clubEventItemRow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px dashed rgba(230, 232, 238, 0.12);
  font-size: 13px;
  cursor: pointer;
}

.clubEventItemRow input[type="checkbox"] {
  accent-color: var(--primary, #3b82f6);
}

:root[data-theme="light"] .clubEventItemRow {
  border-bottom-color: rgba(12, 18, 32, 0.10);
}

.clubEventItemRow:last-child {
  border-bottom: none;
}

.clubEventItemRowDisabled {
  opacity: 0.5;
  cursor: default;
}

/* ─── Kategorie terenowe sprzętu (górskie/nizinne/torowo-morskie) ─── */

.terrainBadge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.terrainBadge svg {
  width: 12px;
  height: 12px;
}

/* Wariant na kartach głównej listy — szerokość dopasowana 1:1 do .gearFavBtn
   (min-width/height 30px), żeby serce i plakietka centrowały się w tej samej
   kolumnie (.gearHeadSide, justify-items:end) bez rozjazdu środków. */
.terrainBadgeLg {
  width: 30px;
  height: 30px;
}

.terrainBadgeLg svg {
  width: 18px;
  height: 18px;
}

.terrainBadgeGroup {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.terrainBadgeSep {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted, #888);
}

/* ─── Kolor wiosła (ikonka zamiast martwego tekstu/zamiast zdjęcia — wiosła go nie mają) ─── */
.paddleColorIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.paddleColorIcon svg {
  width: 22px;
  height: 22px;
}

/* Slot "w miejscu zdjęcia" na karcie głównej listy — ta sama lewa kolumna karty
   (.gearCardInner: 76px 1fr) i te same wymiary/obramowanie co .gearImgsSingle
   .gearImgPh u kajaków/kamizelek/kasków, ale z zawsze widocznym podpisem koloru
   (nie tylko tooltip) — wiosła bywają dwukolorowe, sama ikonka może nie wystarczyć. */
.gearImgsSingle .paddleColorPh {
  aspect-ratio: unset;
  flex: 1;
  min-height: 0;
  width: 100%;
  border-radius: 0;
  border-top: 0;
  border-left: 0;
  border-bottom: 0;
  border-right: 1px solid var(--border);
  background: rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 4px;
}

:root[data-theme="light"] .paddleColorPh {
  background: rgba(12,18,32,0.04);
}

.paddleColorPh svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.paddleColorPhLabel {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
  max-width: 100%;
}

.terrainLegend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm, 10px);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text-muted, #888);
}

.terrainLegendHint {
  font-weight: 600;
  color: var(--text);
}

.terrainLegendItem {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

/* Wiersz-przycisk listy w ekranie "Zgłoś uszkodzenie" — ten sam .clubEventItemRow
   co lista kierownika, ale bez ramki/tła bazowego przycisku (tu nie ma checkboxa,
   cały wiersz jest klikalny). */
.gearDamageItemBtn {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  justify-content: flex-start;
}
.gearDamageItemBtn:hover {
  background: rgba(255, 255, 255, 0.05);
}
:root[data-theme="light"] .gearDamageItemBtn:hover {
  background: rgba(12, 18, 32, 0.04);
}

/* ─── Modal "Zgłoś uszkodzenie" — nagłówek z hasłem + wybór oceny ─── */
.damageModalHeading {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  text-align: center;
}

.damageModalSlogan {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted, #888);
}

#gearDamageModalTitle {
  font-size: 16px;
  font-weight: 900;
  color: var(--text);
}

/* Duże ikony-obrysy bez kolorów (feedback użytkownika 07.09.2026) — kolor tylko
   na stan "wybrane", spójny z resztą strony (var(--primary)), nie z samą oceną. */
.damageSeverityPicker {
  display: flex;
  gap: 8px;
  width: 100%;
}

.damageSeverityBtn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px;
  border-radius: var(--radius-md, 14px);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted, #888);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.damageSeverityBtn svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.damageSeverityBtn span {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

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

.damageSeverityBtn.active {
  border-color: var(--primary);
  background: var(--primary-2);
  color: var(--text);
}

/* Pasek "Rezerwuj"/"Anuluj" NA SAMEJ GÓRZE ekranu, przed przewijaną listą
   kategorii (feedback użytkownika 04.09.2026 — na mobile przycisk na dole,
   po całej liście, był niewidoczny bez przewinięcia całej strony). Oba
   przyciski równej szerokości, pełna szerokość na wąskim ekranie. */
.clubEventActionsTop button {
  flex: 1 1 0;
}

@media (max-width: 480px) {
  .clubEventActionsTop {
    flex-wrap: nowrap;
  }
}

/* Duży, wyśrodkowany przycisk "Usuń rezerwację" — jedyna droga do pełnego
   skasowania rezerwacji na imprezę (odznaczenie wszystkich pozycji i tak
   blokuje zapis pustej listy — świadome, patrz komentarz przy no_items).
   Ukryty dopóki nie ma jeszcze żadnej zapisanej rezerwacji do usunięcia. */
.clubEventDeleteRow {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

.clubEventDeleteRow button {
  min-width: 220px;
}

/* Podsumowanie rezerwacji podzielone na kategorie — do wygodnej weryfikacji
   całej listy na imprezę bez przełączania zakładek (feedback użytkownika
   04.09.2026). */
.clubEventSummary {
  margin: 10px 0 4px;
}

.clubEventSummaryStatus {
  font-size: 13px;
  color: var(--text-muted, #888);
  margin-bottom: 6px;
}

.clubEventSummaryBlock {
  margin-bottom: 8px;
}

.clubEventSummaryCatTitle {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.clubEventSummaryList {
  margin: 2px 0 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-muted, #888);
}

.gearReservSimpleRow {
  padding: 4px 0;
  border-bottom: 1px dashed rgba(230, 232, 238, 0.12);
}

.gearReservSimpleRow:last-child {
  border-bottom: none;
}

:root[data-theme="light"] .gearReservSimpleRow {
  border-bottom-color: rgba(12, 18, 32, 0.10);
}

.gearReservSimpleDates {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.gearReservSimpleUser {
  font-size: 12px;
  color: var(--text-muted, #888);
}

/* Znacznik bezpłatnego wypożyczenia (tegoroczna szkoleniówka) */
.gearWaivedTag {
  font-size: 11px;
  font-weight: 700;
  color: var(--success, #4a4);
}

/* Znacznik rezerwacji na imprezę klubową — kolor celowo inny niż .gearWaivedTag,
   żeby nie mylić z tamtym (osobny powód zwolnienia z opłaty). */
.gearClubEventTag {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent, #3b82f6);
}

/* ================= KALENDARZ WYBORU TERMINU (public/core/date_range_calendar.js) ================= */

.gearCal {
  margin: 4px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gearCalHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gearCalTitle {
  font-size: 15px;
  font-weight: 800;
  text-transform: capitalize;
}

.gearCalNavBtn {
  padding: 6px 14px;
}

.gearCalWeekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #888);
  text-align: center;
}

.gearCalGrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.gearCalDay {
  aspect-ratio: 1 / 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

:root[data-theme="light"] .gearCalDay {
  background: rgba(12, 18, 32, 0.03);
}

.gearCalDay--blank {
  visibility: hidden;
  border: none;
  background: transparent;
  cursor: default;
}

.gearCalDay--past {
  opacity: 0.35;
  cursor: not-allowed;
  background: transparent;
}

.gearCalDay--available:hover {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.07);
}

/* Zajęty dzień — pomarańczowo-bursztynowa obwódka + kłódka, nieklikalny jako granica zakresu */
.gearCalDay--occupied {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
  color: #f59e0b;
  cursor: pointer;
}

.gearCalDay--occupied:hover {
  background: rgba(245, 158, 11, 0.22);
}

.gearCalDay--occupied .gearCalDayNum {
  color: var(--text);
}

.gearCalLockIcon {
  width: 17px;
  height: 17px;
}

/* Dzień, który spowodował odrzucenie ostatniego wyboru (konflikt bezpośredni albo
   przez bufor) — czerwona obwódka na wierzchu zwykłego stanu (najczęściej --occupied),
   znika przy kolejnym udanym wyborze/nawigacji miesiąca. */
.gearCalDay--conflict {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 1px #ef4444;
}

/* Wybrany zakres — zielony, jak "mój termin" w kalendarzu basenowym */
.gearCalDay--in-range {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.16);
  font-weight: 700;
}

.gearCalDay--edge {
  background: rgba(34, 197, 94, 0.32);
}

/* Dzień bufora (1 dzień przed/po wybranym zakresie, automatycznie doliczany przez
   backend — computeBlockIso) — sama zielona obwódka, bez wypełnienia, żeby odróżnić
   od faktycznie wybranych dni (.gearCalDay--in-range, wypełnione). */
.gearCalDay--buffer {
  border-color: #22c55e;
  border-style: dashed;
}

.gearCalDayNum {
  line-height: 1;
}

.gearCalLegend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted, #888);
}

.gearCalLegendItem {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gearCalLegendSwatch {
  width: 13px;
  height: 13px;
  border-radius: 4px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.04);
}

.gearCalLegendSwatch--occupied {
  border-color: #f59e0b;
}

.gearCalLegendSwatch--selected {
  border-color: #22c55e;
}

.gearCalLegendSwatch--buffer {
  border-color: #22c55e;
  border-style: dashed;
}

.gearCalHint {
  font-size: 11.5px;
  color: var(--text-muted, #888);
  font-style: italic;
}

.gearCalSummary {
  font-size: 12.5px;
  color: var(--text-muted, #888);
}

.gearCalSummary--ok {
  color: var(--text);
}

.gearCalSummary--warn {
  color: #f87171;
  font-weight: 600;
}

/* Mobile: siatka 7-kolumnowa ma mało miejsca — mniejsza ikonka kłódki (wzorem
   kalendarza basenowego, public/styles/basen.css, ten sam problem rozjeżdżania). */
@media (max-width: 720px) {
  .gearCalLockIcon { width: 14px; height: 14px; }
  .gearCalDay { font-size: 12px; }
}

/* ================= LISTA ZAREZERWOWANEGO SPRZĘTU (modal bundlowy) ================= */

.bundleItemRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

:root[data-theme="light"] .bundleItemRow {
  background: rgba(12, 18, 32, 0.02);
}

.bundleItemRowText {
  font-size: 13px;
  color: var(--text);
}

.bundleItemRemoveBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #ef4444;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.bundleItemRemoveBtn:hover {
  background: rgba(239, 68, 68, 0.14);
  border-color: #ef4444;
}

