/* Jedyny zestaw stylów paska dla wszystkich modułów, także stron legacy.
 * Wymiary desktopu odpowiadają paskowi strony głównej; stan kontroluje swd-topnav.js. */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

.swd-topnav {
  --swd-nav-bg: #182534;
  --swd-nav-border: rgba(255, 255, 255, .13);
  --swd-nav-soft: rgba(255, 255, 255, .08);
  background: var(--swd-nav-bg);
  border-bottom: 1px solid var(--swd-nav-border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .14);
  box-sizing: border-box;
  color: #fff;
  isolation: isolate;
  min-height: 64px;
  flex: 0 0 auto;
  margin: 0;
  border-radius: 0;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  text-align: left;
  overflow: visible;
  padding: 7px max(16px, env(safe-area-inset-right)) 7px max(16px, env(safe-area-inset-left));
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 2200 !important;
}
.swd-topnav, .swd-topnav * { font-family: 'Poppins', system-ui, sans-serif !important; }
.swd-topnav .swd-topnav-inner {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin-inline: auto;
  max-width: 1560px;
  min-width: 0;
  padding: 0;
  width: 100%;
}
.swd-topnav .swd-topnav-brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 9px;
  margin: 0 4px 0 0;
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0;
  color: #fff !important;
  text-decoration: none;
}
.swd-topnav-logo { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; }
.swd-topnav-logo img { display: block; width: 38px; height: 38px; object-fit: contain; }
.swd-topnav-brand-text { line-height: 1.2; }
.swd-topnav-brand-text strong { font-size: 1.04rem; font-weight: 700; letter-spacing: -.02em; }
.swd-topnav .swd-topnav-toggler {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 92px;
  min-height: 44px;
  margin-left: auto;
  padding: 9px 12px;
  border: 1px solid var(--swd-nav-border);
  border-radius: 10px;
  background: var(--swd-nav-soft);
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
}
.swd-topnav-burger, .swd-topnav-burger::before, .swd-topnav-burger::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .18s ease, background-color .18s ease;
}
.swd-topnav-burger { position: relative; }
.swd-topnav-burger::before, .swd-topnav-burger::after { content: ''; position: absolute; left: 0; }
.swd-topnav-burger::before { top: -6px; }
.swd-topnav-burger::after { top: 6px; }
.swd-topnav-toggler[aria-expanded='true'] .swd-topnav-burger { background: transparent; }
.swd-topnav-toggler[aria-expanded='true'] .swd-topnav-burger::before { transform: translateY(6px) rotate(45deg); }
.swd-topnav-toggler[aria-expanded='true'] .swd-topnav-burger::after { transform: translateY(-6px) rotate(-45deg); }
.swd-topnav .swd-topnav-collapse {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 16px;
  min-width: 0;
}
.swd-topnav .navbar-nav { list-style: none; margin: 0; padding: 0; }
.swd-topnav .swd-topnav-menu { display: flex; flex: 1 1 auto; flex-direction: row; flex-wrap: wrap; gap: 2px; min-width: 0; }
.swd-topnav .nav-item { min-width: 0; }
.swd-topnav .nav-link {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 7px !important;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #dce4ef !important;
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .16s ease, color .16s ease;
}
.swd-topnav .nav-link:hover, .swd-topnav .nav-link:focus-visible { background: var(--swd-nav-soft); color: #fff !important; }
.swd-topnav .nav-link.active, .swd-topnav .nav-item.is-current { background: #25445f; border-radius: 9px; }
.swd-topnav .nav-link.active { color: #fff !important; }
.swd-topnav :is(a, button):focus-visible { outline: 2px solid #7cc7ff; outline-offset: -2px; box-shadow: none; }
.swd-topnav .nav-item.dropdown { display: flex; align-items: center; position: relative; }
.swd-topnav .nav-item.dropdown > .nav-link:first-child { border-radius: 9px 0 0 9px; padding-right: 2px !important; }
.swd-topnav .dropdown-toggle-split {
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  margin: 0;
  padding-inline: 8px !important;
  border-radius: 0 9px 9px 0;
  cursor: pointer;
}
.swd-topnav .dropdown-toggle::after {
  content: '';
  width: 7px;
  height: 7px;
  margin: -3px 0 0;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  transition: transform .18s ease;
}
.swd-topnav .dropdown-toggle[aria-expanded='true'] { background: var(--swd-nav-soft); color: #fff !important; }
.swd-topnav .dropdown-toggle[aria-expanded='true']::after { transform: translateY(3px) rotate(225deg); }
.swd-topnav .swd-topnav-submenu {
  display: none;
  position: absolute;
  inset: 100% auto auto 0;
  z-index: 2300;
  width: max-content;
  min-width: 250px;
  max-width: min(340px, calc(100vw - 32px));
  max-height: calc(100vh - 100px);
  max-height: calc(100dvh - var(--swd-topnav-height, 72px) - 24px);
  margin: 8px 0 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  border: 1px solid #dce5ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, .2);
  transform: translateX(var(--swd-dropdown-shift, 0px));
}
.swd-topnav .swd-topnav-submenu.show { display: block; }
.swd-topnav .dropdown-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 7px;
  color: #263b50;
  font-size: .84rem;
  font-weight: 500;
  line-height: 1.45;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
.swd-topnav .dropdown-item:hover, .swd-topnav .dropdown-item:focus-visible, .swd-topnav .dropdown-item.active {
  background: #eaf3fc;
  color: #075ea6;
}
.swd-topnav .swd-session-list { display: flex; flex-direction: row; align-items: center; flex: 0 0 auto; gap: 10px; }
.swd-session-panel {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 225px;
  min-height: 50px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--swd-nav-border);
  border-radius: 11px;
  background: var(--swd-nav-soft);
}
.swd-session-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  height: 34px;
  border-radius: 8px;
  background: #287bb4;
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
}
.swd-session-copy { display: grid; flex: 1; gap: 4px; min-width: 0; }
.swd-session-name { max-width: 150px; overflow: hidden; color: #fff; font-size: .83rem; font-weight: 600; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.swd-session-time { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: #f6d879; font-size: .71rem; line-height: 1.3; }
.swd-session-label { display: none; }
.swd-topnav #session-timer { min-width: 5ch; font-variant-numeric: tabular-nums; }
.swd-topnav #refresh-container { display: none; }
.swd-topnav #refresh-container.is-visible { display: inline-flex; }
.swd-session-actions { display: flex; align-items: center; gap: 8px; }
.swd-topnav .swd-nav-text-btn, .swd-session-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--swd-nav-border);
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}
.swd-topnav .swd-nav-text-btn:hover { background: var(--swd-nav-soft); color: #fff; }
.swd-topnav .swd-session-logout-btn { min-height: 50px; padding: 5px 13px 5px 6px; color: #ffd4d4; border-color: rgba(248, 113, 113, .25); }
.swd-topnav .swd-session-logout-btn:hover { background: rgba(239, 68, 68, .12); }
.swd-topnav .swd-impersonation-btn, .swd-session-refresh-btn { color: #fde68a; border-color: rgba(250, 204, 21, .4); }
.swd-session-refresh-btn { width: 44px; padding: 0; background: rgba(250, 204, 21, .08); }
.swd-session-refresh-btn:hover { background: rgba(250, 204, 21, .18); }
.swd-session-refresh-btn:disabled { cursor: wait; opacity: .65; }
.swd-session-refresh-btn.is-loading i { animation: swd-session-refresh-spin .8s linear infinite; }
@keyframes swd-session-refresh-spin { to { transform: rotate(360deg); } }
.swd-topnav .swd-nav-public-cta { background: #eaf3fc; color: #16466b; }
.swd-topnav .swd-nav-public-cta:hover { background: #fff; color: #16466b; }

@media (min-width: 1400px) {
  .swd-topnav { padding-inline: 24px; }
}
@media (min-width: 1400px) and (max-width: 1599.98px) {
  .swd-topnav .nav-link { font-size: .8rem; padding-inline: 6px !important; }
  .swd-session-panel { width: 210px; }
  .swd-session-name { max-width: 135px; }
}
@media (max-width: 1399.98px) {
  .swd-topnav { min-height: 68px; padding-block: 10px; }
  .swd-topnav .swd-topnav-inner { gap: 12px; }
  .swd-topnav .swd-topnav-toggler { display: inline-flex; }
  .swd-topnav .swd-topnav-collapse {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    max-height: calc(100vh - 80px);
    max-height: calc(100dvh - var(--swd-topnav-height, 68px) - 12px);
    margin: 0;
    padding: 12px max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #63788e var(--swd-nav-bg);
    border-bottom: 1px solid var(--swd-nav-border);
    border-radius: 0 0 16px 16px;
    /* Starszy swd-modern.css może nadal pochodzić z cache i narzucać tło rgba. */
    background: #182534 !important;
    box-shadow: 0 18px 30px rgba(15, 23, 42, .24);
  }
  .swd-topnav .swd-topnav-collapse.show { display: flex; animation: swd-nav-open .18s ease-out; }
  @keyframes swd-nav-open { from { transform: translateY(-8px); } to { transform: translateY(0); } }
  .swd-topnav .swd-topnav-menu { flex: 0 0 auto; flex-direction: column; flex-wrap: nowrap; gap: 4px; }
  .swd-topnav .nav-link { width: 100%; min-height: 48px; padding: 12px !important; font-size: .9rem; white-space: normal; overflow-wrap: anywhere; }
  .swd-topnav .nav-item.dropdown { display: grid; align-items: stretch; grid-template-columns: minmax(0, 1fr) 48px; }
  .swd-topnav .dropdown-toggle-split { width: 48px; min-height: 48px; border-left: 1px solid var(--swd-nav-border); }
  .swd-topnav .swd-topnav-submenu {
    position: static;
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: none;
    margin: 4px 0 6px;
    overflow: visible;
    border-color: var(--swd-nav-border);
    border-radius: 9px;
    background: #223449;
    box-shadow: none;
    transform: none;
  }
  .swd-topnav .dropdown-item { color: #e1eaf5; }
  .swd-topnav .dropdown-item:hover, .swd-topnav .dropdown-item:focus-visible, .swd-topnav .dropdown-item.active { background: #304d6a; color: #fff; }
  .swd-topnav .swd-session-list { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 14px; border-top: 1px solid var(--swd-nav-border); }
  .swd-session-panel { width: 100%; min-height: 58px; padding: 8px; }
  .swd-session-name { max-width: none; font-size: .84rem; }
  .swd-session-label { display: inline; }
  .swd-session-actions { flex-wrap: wrap; }
  .swd-session-actions > a, .swd-session-actions > form { flex: 1; }
  .swd-session-list form .swd-nav-text-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .swd-topnav *, .swd-topnav *::before, .swd-topnav *::after { animation: none !important; transition: none !important; }
}

/* Modale i komunikaty pozostają ponad otwartą nawigacją. */
body.swd-modern-page > :not(.navbar):not(.modal):not(.modal-backdrop):not(.swal2-container),
body.swd-dashboard-page > :not(.navbar):not(.modal):not(.modal-backdrop):not(.swal2-container),
body.swd-events-page > :not(.navbar):not(.modal):not(.modal-backdrop):not(.swal2-container),
body.swd-auth-page > :not(.navbar):not(.modal):not(.modal-backdrop):not(.swal2-container) { z-index: auto; }
body .modal,
body:is(.swd-modern-page, .swd-dashboard-page, .swd-events-page, .swd-auth-page) .modal { z-index: 2400 !important; }
body .modal-backdrop,
body:is(.swd-modern-page, .swd-dashboard-page, .swd-events-page, .swd-auth-page) .modal-backdrop { z-index: 2390 !important; }
body .swal2-container,
body:is(.swd-modern-page, .swd-dashboard-page, .swd-events-page, .swd-auth-page) .swal2-container { z-index: 2410 !important; }
