/* Niezależny przełącznik skeletonów. Wszystkie zmienne mają fallback bez motywu.
   Czas ujawnienia, timeout, liczba wierszy i usuwanie stanów należą do JS. */
@media screen {
/* R4: Perfex ukrywa tabelę, jej wiersze i narzędzia opacity:0!important
   w .table-loading. Nadpisanie działa tylko po przejęciu stanu przez JS. */
html.fwui-sk-on table.fwui-sk-active.dt-table-loading,
html.fwui-sk-on .fwui-sk-host.table-loading :is(.dataTables_filter, .dataTables_length, .dt-buttons),
html.fwui-sk-on .fwui-sk-host.table-loading table.fwui-sk-active :is(thead th, tbody tr.fwui-sk-row) { opacity: 1 !important; }
html.fwui-sk-on .fwui-sk-host.table-loading table.fwui-sk-active > thead > tr { height: auto; min-height: 0; }
/* Zastępcze belki Perfexa są obrazem tła wrappera .table-loading. */
html.fwui-sk-on .dataTables_wrapper:is(.fwui-sk-host, .fwui-has-error) { background-image: none; }
html.fwui-sk-on .dataTables_wrapper:is(.fwui-sk-host, .fwui-has-error, .fwui-owns-processing) .dataTables_processing {
  display: none !important; /* DataTables ustawia display:block inline. */
}
html.fwui-sk-on .dataTables_wrapper.fwui-sk-host,
html.fwui-sk-on .fwui-sk-host .table-responsive { position: relative; }
html.fwui-sk-on .fwui-sk { box-sizing: border-box; max-width: 100%; color: transparent; pointer-events: none; }
html.fwui-sk-on .fwui-sk--table { width: 100%; border-radius: var(--fwui-radius-card, 12px); background: var(--fwui-card, #fff); }
html.fwui-sk-on .fwui-sk-row { border-bottom: 1px solid var(--fwui-row-border, rgba(16, 42, 69, .10)); }
html.fwui-sk-on div.fwui-sk-row { display: flex; align-items: center; gap: 16px; padding: 12px 14px; min-height: var(--fwui-table-row-height, 46px); }
html.fwui-sk-on tr.fwui-sk-row { height: var(--fwui-table-row-height, 46px); }
html.fwui-sk-on tr.fwui-sk-row > td { padding: 12px 14px; vertical-align: top; }
html.fwui-sk-on tr.fwui-sk-row .fwui-sk-bar { height: 21px; }
html.fwui-sk-on .fwui-sk-cell { min-width: 0; }
html.fwui-sk-on div.fwui-sk-cell { flex: 1 1 0; }
html.fwui-sk-on .fwui-sk-bar { display: block; position: relative; overflow: hidden; width: 100%; height: 16px; border-radius: 6px; background: var(--fwui-canvas, #e9ebed); }
html.fwui-sk-on .fwui-sk-bar + .fwui-sk-bar { width: 64%; height: 12px; margin-top: 8px; }
html.fwui-sk-on .fwui-sk-bar::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(91, 100, 114, .14), transparent); animation: fwui-skeleton-shimmer 1.4s ease-in-out infinite; }
html.fwui-sk-on :is(.fwui-sk--card, .fwui-sk--detail, .fwui-sk--chart) { padding: 20px 24px; border: 1px solid var(--fwui-border, rgba(16, 42, 69, .12)); border-radius: var(--fwui-radius-card, 12px); background: var(--fwui-card, #fff); }
html.fwui-sk-on .fwui-sk--card { min-height: 136px; }
html.fwui-sk-on .fwui-sk--card > .fwui-sk-bar:first-child { width: 65%; height: 12px; }
html.fwui-sk-on .fwui-sk--card > .fwui-sk-bar:nth-child(2) { width: 42%; height: 28px; margin-top: 16px; }
html.fwui-sk-on .fwui-sk--detail { min-height: 200px; }
html.fwui-sk-on .fwui-sk--detail > .fwui-sk-bar:first-child { width: 72%; height: 26px; }
html.fwui-sk-on .fwui-sk--detail > .fwui-sk-bar + .fwui-sk-bar { margin-top: 20px; }
html.fwui-sk-on .fwui-sk--chart { min-height: 220px; }
html.fwui-sk-on .fwui-sk--chart > .fwui-sk-bar { min-height: 160px; }
/* Wskaźnik nawigacji i AJAX modalu, niezależny od przełączników motywu. */
html.fwui-sk-on #fwui-progress { display: none; position: fixed; inset: 0 0 auto; height: 3px; z-index: 10000; overflow: hidden; pointer-events: none; background: var(--fwui-cyan, #6fa9cc); }
html.fwui-sk-on #fwui-progress.is-active { display: block; }
html.fwui-sk-on #fwui-progress::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent); animation: fwui-skeleton-shimmer 1.4s ease-in-out infinite; }
html.fwui-sk-on .fwui-refresh-bar { position: relative; overflow: hidden; width: 100%; height: 3px; margin-block: 4px; border-radius: 9999px; background: var(--fwui-canvas, #e9ebed); pointer-events: none; }
html.fwui-sk-on .fwui-refresh-bar::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--fwui-cyan, #6fa9cc), transparent); animation: fwui-skeleton-shimmer 1.4s ease-in-out infinite; }
/* R4: istniejące dane zostają klikalne; przygaszenie dotyczy tylko wierszy. */
html.fwui-sk-on [data-fwui-state="refreshing"] > .fwui-refresh-bar { background: var(--fwui-assigned, rgba(111, 169, 204, .18)); }
html.fwui-sk-on [data-fwui-state="refreshing"] table > tbody > tr:not(.fwui-sk-row),
html.fwui-sk-on table[data-fwui-state="refreshing"] > tbody > tr:not(.fwui-sk-row) { opacity: .6; }
html.fwui-sk-on .fwui-refresh-pill {
  position: absolute; inset-block-start: 0; inset-inline-end: 8px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px; width: max-content; height: auto; max-width: calc(100% - 16px); margin: 0; overflow: visible;
  padding: 6px 12px; border: 1px solid var(--fwui-border, rgba(16, 42, 69, .12)); border-radius: 9999px;
  background: var(--fwui-card, #fff); color: var(--fwui-navy, #102a45);
  box-shadow: 0 1px 3px rgba(16, 42, 69, .12); font: 12px/18px var(--fwui-font-sans, system-ui, sans-serif);
  pointer-events: none;
}
html.fwui-sk-on .fwui-refresh-pill::before {
  content: ""; flex: 0 0 12px; width: 12px; height: 12px; box-sizing: border-box;
  border: 2px solid var(--fwui-canvas, #e9ebed); border-top-color: var(--fwui-ink-muted, #5b6472);
  border-radius: 50%; animation: fwui-refresh-spin 1s linear infinite;
}
html.fwui-sk-on .fwui-state { margin-block: 12px; padding: 24px; border: 1px solid var(--fwui-border, rgba(16, 42, 69, .12)); border-radius: var(--fwui-radius-card, 12px); background: var(--fwui-card, #fff); color: var(--fwui-ink-muted, #5b6472); font: 14px/1.5 var(--fwui-font-sans, system-ui, sans-serif); overflow-wrap: anywhere; }
html.fwui-sk-on [data-fwui-state="error"] > .fwui-state { border-inline-start: 3px solid var(--fwui-brass, #b8873a); }
html.fwui-sk-on [data-fwui-state="empty"] .dataTables_empty { color: var(--fwui-ink-muted, #5b6472); }
html.fwui-sk-on .fwui-retry { display: inline-block; min-height: 36px; margin-top: 12px; padding: 7px 14px; border: 1px solid var(--fwui-button-border, rgba(16, 42, 69, .24)); border-radius: var(--fwui-radius, 8px); background: var(--fwui-card, #fff); color: var(--fwui-navy, #102a45); font: 500 13px/20px var(--fwui-font-display, system-ui, sans-serif); cursor: pointer; }
html.fwui-sk-on .fwui-retry:hover { background: var(--fwui-hover, rgba(111, 169, 204, .08)); }
html.fwui-sk-on .fwui-retry:focus-visible { outline: 2px solid var(--fwui-cyan, #6fa9cc); outline-offset: 2px; }
html.fwui-sk-on .fwui-retry:disabled { opacity: .45; cursor: not-allowed; }
/* Jedyny ukrywany tekst to region ogłoszeń czytnika, zgodnie z kontraktem. */
html.fwui-sk-on #fwui-live { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
@keyframes fwui-skeleton-shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
@keyframes fwui-refresh-spin { to { transform: rotate(360deg); } }
@media (max-width: 767px) {
  html.fwui-sk-on :is(.fwui-sk--card, .fwui-sk--detail, .fwui-sk--chart, .fwui-state) { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html.fwui-sk-on .fwui-refresh-pill::before { animation: none; }
  html.fwui-sk-on #fwui-progress::after,
  html.fwui-sk-on .fwui-sk-bar::after,
  html.fwui-sk-on .fwui-refresh-bar::after { animation: none; transform: none; background: none; }
}
html.fwui-sk-on.fwui-reduced-motion .fwui-refresh-pill::before { animation: none; }
html.fwui-sk-on.fwui-reduced-motion #fwui-progress::after,
html.fwui-sk-on.fwui-reduced-motion .fwui-sk-bar::after,
html.fwui-sk-on.fwui-reduced-motion .fwui-refresh-bar::after { animation: none; transform: none; background: none; }
}
