.table-column-filter-row th{padding:.55rem!important;background:var(--bs-tertiary-bg);vertical-align:middle}.table-column-filter-row .form-control,.table-column-filter-row .form-select{width:100%;min-width:0;font-size:.8rem}.table-column-filter-row .form-select[data-filter-key="status"]{min-width:150px}.table-column-filter-row .btn{white-space:nowrap}@media(max-width:991.98px){.table-column-filter-row th{padding:.4rem!important}}

/* Spójna kolumna Akcje we wszystkich tabelach: każdy przycisk zajmuje pełną szerokość. */
.table:has(tbody td.table-action-cell>a.btn,tbody td.table-action-cell>button.btn,tbody td.table-action-cell>form>.btn) thead tr:first-child th.table-action-cell{width:164px;min-width:164px}
.table tbody td.table-action-cell:has(>a.btn,>button.btn,>form>.btn){width:164px;min-width:164px;white-space:normal!important;vertical-align:middle;text-align:center!important}
.table tbody td.table-action-cell:has(>a.btn,>button.btn,>form>.btn)>form{display:block!important;width:100%;margin:.22rem 0!important}
.table tbody td.table-action-cell:has(>a.btn,>button.btn,>form>.btn)>a.btn,.table tbody td.table-action-cell:has(>a.btn,>button.btn,>form>.btn)>button.btn,.table tbody td.table-action-cell:has(>a.btn,>button.btn,>form>.btn)>form>.btn{display:flex!important;align-items:center;justify-content:center;width:100%!important;max-width:none!important;min-height:2.1rem;margin:.22rem 0!important;padding:.38rem .5rem;border-radius:.55rem;font-size:.78rem;font-weight:600;line-height:1.15;white-space:normal!important;box-sizing:border-box}
.table tbody td.table-action-cell:has(>a.btn,>button.btn,>form>.btn) .btn:focus-visible{box-shadow:0 0 0 .2rem rgba(var(--bs-primary-rgb),.18)}
@media(max-width:991.98px){.table:has(tbody td.table-action-cell>a.btn,tbody td.table-action-cell>button.btn,tbody td.table-action-cell>form>.btn) thead tr:first-child th.table-action-cell,.table tbody td.table-action-cell:has(>a.btn,>button.btn,>form>.btn){width:150px;min-width:150px}.table tbody td.table-action-cell:has(>a.btn,>button.btn,>form>.btn)>a.btn,.table tbody td.table-action-cell:has(>a.btn,>button.btn,>form>.btn)>button.btn,.table tbody td.table-action-cell:has(>a.btn,>button.btn,>form>.btn)>form>.btn{font-size:.74rem;padding:.34rem .4rem}}

/* Wspólny dropdown wyboru widocznych kolumn. Kontrolka jest przenoszona do
   nagłówka strony i pozostaje poza kartą oraz poza samą tabelą. */
.table-column-visibility-toolbar{position:relative;z-index:3;display:inline-flex;align-items:center;justify-content:flex-end;gap:.5rem;flex:0 0 auto;padding:0;border:0;background:transparent}
.table-column-visibility-toolbar--page-heading{margin:0}
.table-column-visibility-dropdown{display:inline-flex;align-items:center}
.table-column-visibility-toggle{white-space:nowrap;min-width:0;background:var(--app-surface-solid,var(--bs-body-bg))}
.table-column-visibility-menu{--table-column-menu-max-height:min(420px,calc(100vh - 40px));position:fixed!important;transform:none!important;right:auto!important;bottom:auto!important;display:flex;flex-direction:column;width:420px;min-width:min(320px,calc(100vw - 24px));max-width:min(420px,calc(100vw - 24px));max-height:var(--table-column-menu-max-height);margin:0!important;padding:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:var(--app-border-strong,var(--bs-border-color)) transparent;z-index:1200;border:1px solid var(--app-border,var(--bs-border-color));border-radius:.8rem;background:var(--app-surface-solid,var(--bs-body-bg));color:var(--app-text,var(--bs-body-color));box-shadow:0 14px 34px rgba(15,23,42,.14)}
.table-column-visibility-menu[hidden]{display:none!important}
.table-column-visibility-header{position:sticky;top:0;z-index:2;flex:0 0 auto;padding:.7rem .75rem .65rem;border-bottom:1px solid var(--app-border,var(--bs-border-color));background:var(--app-surface-solid,var(--bs-body-bg))}
.table-column-visibility-heading{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;margin-bottom:.55rem}
.table-column-visibility-title{min-width:0;font-size:.84rem;font-weight:700;color:var(--app-text,var(--bs-body-color))}
.table-column-visibility-count{flex:0 0 auto;font-size:.72rem;font-weight:650;color:var(--app-muted,var(--bs-secondary-color));font-variant-numeric:tabular-nums}
.table-column-visibility-actions{display:flex;align-items:center;gap:.4rem}
.table-column-visibility-actions .btn{flex:1 1 0;min-height:2rem;padding:.3rem .45rem;font-size:.72rem;line-height:1.15;white-space:normal}
.table-column-visibility-list{min-height:0;flex:0 0 auto;overflow:visible;padding:.35rem}
.table-column-visibility-item{display:flex;align-items:center;gap:.65rem;width:100%;min-height:2.35rem;margin:0;padding:.42rem .5rem;border-radius:.55rem;cursor:pointer;color:var(--app-text,var(--bs-body-color));font-size:.82rem;line-height:1.25;transition:background-color .14s ease,color .14s ease}
.table-column-visibility-item:hover{background:var(--app-primary-soft,rgba(var(--bs-primary-rgb),.08))}
.table-column-visibility-item:has(.form-check-input:focus-visible){outline:2px solid rgba(var(--bs-primary-rgb),.5);outline-offset:-2px;background:var(--app-primary-soft,rgba(var(--bs-primary-rgb),.08))}
.table-column-visibility-item .form-check-input{flex:0 0 auto;margin:0;cursor:pointer}
.table-column-visibility-item .form-check-input:disabled{cursor:not-allowed;opacity:.72}
.table-column-visibility-label{min-width:0;flex:1 1 auto;overflow-wrap:anywhere}
.table-column-visibility-required{flex:0 0 auto;padding:.15rem .35rem;border-radius:999px;background:var(--bs-tertiary-bg);color:var(--app-muted,var(--bs-secondary-color));font-size:.62rem;font-weight:650;line-height:1.2}
.table-column-visibility-item.is-required{cursor:default}
.table-column-visibility-item.is-required:hover{background:transparent}
[data-bs-theme="dark"] .table-column-visibility-menu{box-shadow:0 18px 40px rgba(0,0,0,.34)}

@media(max-width:767.98px){
.table-column-visibility-toolbar--page-heading .table-column-visibility-toggle{min-height:40px}
}

@media(max-width:575.98px){
.table-column-visibility-menu{--table-column-menu-max-height:min(420px,70vh);width:min(320px,calc(100vw - 24px));min-width:min(260px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:var(--table-column-menu-max-height)}
.table-column-visibility-header{padding:.65rem}
.table-column-visibility-actions .btn{font-size:.7rem;padding:.3rem .4rem}
.table-column-visibility-item{min-height:2.5rem;padding:.48rem .5rem}
}

/* Przypinanie kolumn w głównych tabelach. Akcje są domyślnie zamrażane z prawej,
   pozostałe kolumny z lewej; offsety wylicza table-column-visibility.js. */
.table-column-visibility-choice{display:flex;align-items:center;gap:.65rem;min-width:0;flex:1 1 auto;margin:0;cursor:pointer}
.table-column-visibility-item.is-required .table-column-visibility-choice{cursor:default}
.table-column-pin-toggle{flex:0 0 auto;min-width:66px;padding:.24rem .38rem;font-size:.68rem;line-height:1.15;white-space:nowrap}
.table-column-pin-toggle.is-active{border-color:rgba(var(--bs-primary-rgb),.5);background:var(--app-primary-soft,rgba(var(--bs-primary-rgb),.1));color:var(--bs-primary)}
.table-has-pinned-columns .table-column-pinned{position:sticky!important;z-index:3;background:var(--app-surface-solid,var(--bs-body-bg));background-clip:padding-box}
.table-has-pinned-columns thead .table-column-pinned{z-index:5}
.table-has-pinned-columns .table-column-filter-row .table-column-pinned{background:var(--bs-tertiary-bg)!important}
.table-has-pinned-columns .table-column-pinned--left{left:var(--table-column-pin-left,0)!important;box-shadow:1px 0 0 var(--app-border,var(--bs-border-color))}
.table-has-pinned-columns .table-column-pinned--right{right:var(--table-column-pin-right,0)!important;box-shadow:-1px 0 0 var(--app-border,var(--bs-border-color))}
.table-hover>tbody>tr:hover>.table-column-pinned{background-color:var(--bs-table-hover-bg,var(--bs-tertiary-bg))}

/* Przypięta kolumna musi całkowicie zasłaniać przewijaną część tabeli.
   Wcześniej z-index 3/5 oraz półprzezroczyste tło hover pozwalały tekstom,
   inputom i comboboxom z sąsiednich kolumn wejść wizualnie na sticky cell. */
.table-has-pinned-columns{
  isolation:isolate;
  --table-pinned-column-border:rgba(var(--bs-primary-rgb),.48);
  --table-pinned-row-highlight-bg:#eef2ff;
  --table-pinned-row-highlight-color:#172033;
  --table-pinned-row-highlight-border:#9aa8ff;
}
[data-bs-theme="dark"] .table-has-pinned-columns{
  --table-pinned-row-highlight-bg:#1d2942;
  --table-pinned-row-highlight-color:#f8fafc;
  --table-pinned-row-highlight-border:#6376d9;
}
.table-has-pinned-columns .table-column-pinned--left{
  box-shadow:2px 0 0 var(--table-pinned-column-border),8px 0 16px -14px rgba(15,23,42,.72)!important;
}
.table-has-pinned-columns .table-column-pinned--right{
  box-shadow:-2px 0 0 var(--table-pinned-column-border),-8px 0 16px -14px rgba(15,23,42,.72)!important;
}
.table-has-pinned-columns .table-column-pinned{
  z-index:2000!important;
  background-color:var(--app-surface-solid,var(--bs-body-bg))!important;
  background-image:none!important;
  background-clip:border-box!important;
  color:var(--app-text,var(--bs-body-color))!important;
  opacity:1!important;
}
.table-has-pinned-columns thead .table-column-pinned{z-index:2020!important}
.table-has-pinned-columns .table-column-filter-row .table-column-pinned{
  z-index:2010!important;
  background-color:var(--app-surface-soft,var(--bs-tertiary-bg))!important;
}
.table-has-pinned-columns.table-hover>tbody>tr:hover>.table-column-pinned,
.table-has-pinned-columns>tbody>tr.table-active>.table-column-pinned,
.table-has-pinned-columns>tbody>tr[aria-selected="true"]>.table-column-pinned{
  background-color:var(--table-pinned-row-highlight-bg)!important;
  color:var(--table-pinned-row-highlight-color)!important;
  --bs-table-color-state:var(--table-pinned-row-highlight-color)!important;
  --bs-table-bg-state:var(--table-pinned-row-highlight-bg)!important;
}
.table-has-pinned-columns.table-hover>tbody>tr:hover>.table-column-pinned--left,
.table-has-pinned-columns>tbody>tr.table-active>.table-column-pinned--left,
.table-has-pinned-columns>tbody>tr[aria-selected="true"]>.table-column-pinned--left{
  box-shadow:2px 0 0 var(--table-pinned-row-highlight-border),8px 0 16px -14px rgba(15,23,42,.9)!important;
}
.table-has-pinned-columns.table-hover>tbody>tr:hover>.table-column-pinned--right,
.table-has-pinned-columns>tbody>tr.table-active>.table-column-pinned--right,
.table-has-pinned-columns>tbody>tr[aria-selected="true"]>.table-column-pinned--right{
  box-shadow:-2px 0 0 var(--table-pinned-row-highlight-border),-8px 0 16px -14px rgba(15,23,42,.9)!important;
}
.table-has-pinned-columns.table-hover>tbody>tr:hover>.table-column-pinned a:not(.btn),
.table-has-pinned-columns>tbody>tr.table-active>.table-column-pinned a:not(.btn),
.table-has-pinned-columns>tbody>tr[aria-selected="true"]>.table-column-pinned a:not(.btn){
  color:var(--app-primary,var(--bs-primary))!important;
}
.table-has-pinned-columns.table-hover>tbody>tr:hover>.table-column-pinned .text-secondary,
.table-has-pinned-columns.table-hover>tbody>tr:hover>.table-column-pinned .text-body-secondary,
.table-has-pinned-columns>tbody>tr.table-active>.table-column-pinned .text-secondary,
.table-has-pinned-columns>tbody>tr.table-active>.table-column-pinned .text-body-secondary,
.table-has-pinned-columns>tbody>tr[aria-selected="true"]>.table-column-pinned .text-secondary,
.table-has-pinned-columns>tbody>tr[aria-selected="true"]>.table-column-pinned .text-body-secondary{
  color:var(--table-pinned-row-highlight-color)!important;
  opacity:.78;
}

/* Zamiast sztucznego marginesu/pseudo-elementu dajemy 10 px dodatkowego
   padding-right ostatniej widocznej kolumnie przed przypiętymi „Akcjami”. */
@media(min-width:768px){
table[data-volunteer-table].table-has-pinned-columns tr>:not([hidden]):not(.table-column-pinned--right):has(~ .table-column-pinned--right):not(:has(~ :not([hidden]):not(.table-column-pinned--right) ~ .table-column-pinned--right)),
table.visits-table.table-has-pinned-columns tr>:not([hidden]):not(.table-column-pinned--right):has(~ .table-column-pinned--right):not(:has(~ :not([hidden]):not(.table-column-pinned--right) ~ .table-column-pinned--right)),
.card .table-responsive>table.table.table-has-pinned-columns:not([data-table-filters]):not([data-volunteer-table]) tr>:not([hidden]):not(.table-column-pinned--right):has(~ .table-column-pinned--right):not(:has(~ :not([hidden]):not(.table-column-pinned--right) ~ .table-column-pinned--right)){
  padding-right:calc(.5rem + 10px)!important;
}
}

@media(max-width:767.98px){
.mobile-card-table .table-column-pinned{position:static!important;left:auto!important;right:auto!important;box-shadow:none!important;z-index:auto!important}
}


/* Desktop column width controls. Widths are applied by table-column-visibility.js
   as inline !important styles so they can override the stable list defaults. */
.table-column-width-control{display:flex;align-items:center;gap:.25rem;flex:0 0 auto}
.table-column-width-input{width:74px!important;min-width:74px!important;max-width:74px!important;padding-left:.4rem;padding-right:.35rem;text-align:right;font-variant-numeric:tabular-nums}
.table-column-width-unit{flex:0 0 auto;color:var(--app-muted,var(--bs-secondary-color));font-size:.68rem}
.table-column-width-reset{flex:0 0 auto;min-width:42px;padding:.24rem .35rem;font-size:.68rem;line-height:1.15}
.table-column-width-reset:disabled{opacity:.45}
.table-column-resizable{position:relative}
.table-column-header-label{display:block;min-width:0}
.table-column-resizer{display:none}
body.table-column-resizing,body.table-column-resizing *{cursor:col-resize!important;user-select:none!important}

@media(min-width:768px) and (pointer:fine){
.table-column-visibility-item{gap:.45rem}
.table-column-width-control{display:flex}
.table-column-resizable{padding-right:1.5rem!important}
.table-column-resizable>.table-column-header-label{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.table-column-resize-disabled{padding-right:.5rem!important}
.table-column-resizer{
  position:absolute;
  top:0;
  right:0;
  bottom:0;
  width:16px;
  padding:0;
  border:0;
  display:block;
  z-index:2060;
  background:transparent;
  color:inherit;
  cursor:col-resize;
  touch-action:none;
  outline:none;
}
.table-column-resizer::before{
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  right:0;
  width:1px;
  background:var(--app-border-strong,var(--bs-border-color));
  opacity:.9;
  transition:width .12s ease,background-color .12s ease,box-shadow .12s ease,opacity .12s ease;
}
.table-column-divider-handle{
  position:absolute;
  top:50%;
  right:1px;
  display:grid;
  place-items:center;
  width:14px;
  height:14px;
  padding:0;
  transform:translateY(-50%);
  border:1px solid var(--app-border-strong,var(--bs-border-color));
  border-radius:50%;
  background:var(--app-surface-solid,var(--bs-body-bg));
  color:var(--app-muted,var(--bs-secondary-color));
  font-size:.5rem;
  font-weight:800;
  line-height:1;
  opacity:.62;
  box-shadow:none;
  transition:border-color .12s ease,background-color .12s ease,color .12s ease,box-shadow .12s ease,transform .12s ease,opacity .12s ease;
}
.table-column-resizer:hover::before,
.table-column-resizer:focus-visible::before,
.table-column-resizer.is-resizing::before{
  width:2px;
  opacity:1;
  background:var(--bs-primary);
  box-shadow:0 0 0 2px rgba(var(--bs-primary-rgb),.1);
}
.table-column-resizer:hover .table-column-divider-handle,
.table-column-resizer:focus-visible .table-column-divider-handle,
.table-column-resizer.is-resizing .table-column-divider-handle{
  border-color:var(--bs-primary);
  background:var(--bs-primary);
  color:#fff;
  opacity:1;
  box-shadow:0 0 0 3px rgba(var(--bs-primary-rgb),.12);
  transform:translateY(-50%);
}
.table-column-pinned>.table-column-resizer::before{background:rgba(var(--bs-primary-rgb),.72)}
.table-column-pinned>.table-column-resizer .table-column-divider-handle{
  border-color:rgba(var(--bs-primary-rgb),.5);
  color:var(--bs-primary);
  opacity:.78;
}
.table-column-pinned>.table-column-resizer:hover .table-column-divider-handle,
.table-column-pinned>.table-column-resizer:focus-visible .table-column-divider-handle,
.table-column-pinned>.table-column-resizer.is-resizing .table-column-divider-handle{color:#fff;opacity:1}

/* Wolontariusze: separator przewijanej kolumny nie może przebijać przez
   przypiętą kolumnę. Pinned cell ma być wizualną maską, jak w Excelu. */
table[data-volunteer-table].table-has-pinned-columns
  .table-column-resizable:not(.table-column-pinned)>.table-column-resizer{
  z-index:1;
}
table[data-volunteer-table].table-has-pinned-columns
  .table-column-pinned>.table-column-resizer{
  z-index:2;
}

.table-column-resizer:focus-visible{
  outline:2px solid rgba(var(--bs-primary-rgb),.65);
  outline-offset:-1px;
  border-radius:.35rem;
}
}

@media(max-width:767.98px),(pointer:coarse){
.table-column-width-control,.table-column-resizer{display:none!important}
}

.table-has-custom-column-widths th,
.table-has-custom-column-widths td{
  overflow:hidden;
}
.table-has-custom-column-widths th:not(.table-column-resizable),
.table-has-custom-column-widths td{
  text-overflow:ellipsis;
}
