/* ═══════════════════════════════════════════════════════════════
   ADMIN HEADER — style wspólnego paska górnego + uzupełnienia sidebaru
   Napisane w czystym CSS (niezależne od Tailwinda) jako pas
   bezpieczeństwa: pasek i sidebar mają wyglądać poprawnie nawet
   bez CDN / bez przebudowanego style.css.
   ═══════════════════════════════════════════════════════════════ */

/* ── Typografia: Inter (ładuje się w head.ejs) ── */
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  background-color: #f6f7fb;
  background-image:
    radial-gradient(620px 320px at 6% -6%, rgba(99, 102, 241, 0.10), transparent 60%),
    radial-gradient(720px 360px at 96% -4%, rgba(220, 38, 38, 0.07), transparent 60%),
    radial-gradient(900px 520px at 50% 112%, rgba(14, 165, 233, 0.07), transparent 60%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Nadpisuje kolor z klasy .bg-gray-50, dopóki jest jeszcze w widokach
   (background-image z reguły wyżej Tailwind i tak nie nadpisuje). */
body.bg-gray-50 {
  background-color: #f6f7fb;
}

/* ── Ciemny motyw: głęboki gradient + poświaty ── */
html.dark body {
  background-color: #070b16;
  background-image:
    radial-gradient(700px 380px at 10% -8%, rgba(99, 102, 241, 0.16), transparent 60%),
    radial-gradient(760px 400px at 95% -5%, rgba(220, 38, 38, 0.10), transparent 60%),
    radial-gradient(1000px 600px at 50% 115%, rgba(14, 165, 233, 0.10), transparent 60%),
    linear-gradient(180deg, #0b1120 0%, #020617 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Pulpit ma własny arbitrary-gradient w klasie body — też go nadpisujemy,
   żeby cały panel miał jednolite tło. */
html.dark body[class*="radial-gradient"] {
  background-image:
    radial-gradient(700px 380px at 10% -8%, rgba(99, 102, 241, 0.16), transparent 60%),
    radial-gradient(760px 400px at 95% -5%, rgba(220, 38, 38, 0.10), transparent 60%),
    radial-gradient(1000px 600px at 50% 115%, rgba(14, 165, 233, 0.10), transparent 60%),
    linear-gradient(180deg, #0b1120 0%, #020617 100%);
}




h1, h2, h3 { letter-spacing: -0.02em; }

/* ── Wspólny pasek górny (zaczyna się ZA sidebarem) ── */
#topHeader {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  height: 4rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #e5e7eb;
  transition: left .3s cubic-bezier(.4, 0, .2, 1);
}
.dark #topHeader {
  background: rgba(15, 23, 42, 0.9);
  border-bottom-color: #1e293b;
}
#topHeader > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  height: 100%;
  padding: 0 1rem;
}
@media (min-width: 1024px) {
  #topHeader > div { padding: 0 1.5rem; }
}

/* ── Sidebar: pełna wysokość ── */
#adminNav {
  top: 0;
}
#navBackdrop {
  top: 0;
}

/* ── Chip z datą ── */
.date-chip {
  display: none;
  align-items: center;
  gap: .5rem;
  height: 2.5rem;
  padding: 0 1rem;
  border-radius: .75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  font-size: .875rem;
  font-weight: 500;
  color: #4b5563;
  white-space: nowrap;
}
.dark .date-chip {
  background: #0f172a;
  border-color: #1e293b;
  color: #cbd5e1;
}
.date-chip svg { width: 1rem; height: 1rem; color: #9ca3af; }
@media (min-width: 768px) {
  .date-chip { display: inline-flex; }
}

/* ── Przyciski-akcje (headerActions) ── */
.header-action {
  display: none;
  align-items: center;
  gap: .5rem;
  height: 2.5rem;
  padding: 0 1rem;
  border-radius: .75rem;
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  transition: all .15s ease;
}
.header-action svg { width: 1rem; height: 1rem; }
.header-action--ghost {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #374151;
}
.header-action--ghost:hover { border-color: #d1d5db; }
.dark .header-action--ghost {
  background: #0f172a;
  border-color: #1e293b;
  color: #e2e8f0;
}
.dark .header-action--ghost:hover { border-color: #334155; }
.header-action--primary {
  background: #0f172a;
  color: #fff;
}
.header-action--primary:hover { opacity: .9; }
.dark .header-action--primary { background: #fff; color: #0f172a; }
@media (min-width: 640px) {
  .header-action { display: inline-flex; }
}

/* ── Dzwonek powiadomień ── */
#notifBell {
  position: relative;
  padding: .5rem;
  border-radius: .75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  color: #6b7280;
  line-height: 0;
  transition: color .15s ease, border-color .15s ease;
}
#notifBell:hover { color: #111827; border-color: #d1d5db; }
.dark #notifBell {
  background: #0f172a;
  border-color: #1e293b;
  color: #94a3b8;
}
.dark #notifBell:hover { color: #fff; border-color: #334155; }
#notifBell svg { width: 1.25rem; height: 1.25rem; }
#notifCount {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#notifPanel {
  position: absolute;
  right: 0; top: 3rem;
  width: 22rem;
  max-width: calc(100vw - 2rem);
  max-height: 24rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 12px 32px rgba(2, 6, 23, .12), 0 2px 8px rgba(2, 6, 23, .06);
  z-index: 50;
}
.dark #notifPanel {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
}

/* ── Awatar / user menu ── */
#userMenuBtn {
  display: flex;
  align-items: center;
  gap: .5rem;
  height: 2.5rem;
  padding: .25rem .375rem .25rem .75rem;
  border-radius: 9999px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  transition: border-color .15s ease;
}
#userMenuBtn:hover { border-color: #d1d5db; }
.dark #userMenuBtn {
  background: #0f172a;
  border-color: #1e293b;
}
.dark #userMenuBtn:hover { border-color: #334155; }
#userMenuDropdown {
  position: absolute;
  right: 0; top: 3rem;
  width: 15rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .75rem;
  box-shadow: 0 12px 32px rgba(2, 6, 23, .12), 0 2px 8px rgba(2, 6, 23, .06);
  padding: .5rem 0;
  z-index: 50;
}
.dark #userMenuDropdown {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
}
#userMenuChevron { transition: transform .2s ease; }
#userMenuChevron.rotate-180 { transform: rotate(180deg); }

/* ── Zwijany sidebar (uzupełnienia, gdyby Tailwind nie dodał klas) ── */
@media (min-width: 1024px) {
  #adminNav {
    width: 16rem;
    transition: width .3s cubic-bezier(.4, 0, .2, 1);
  }
  #topHeader { left: 16rem; }
  html.nav-collapsed #adminNav { width: 5.5rem; }
  html.nav-collapsed #topHeader { left: 5.5rem; }
  html.nav-collapsed .lg\:pl-64 { padding-left: 5.5rem !important; }
}

/* ═══════════════════════════════════════════════════════════════
   MODULE CARDS — powtarzalne kartki (FlowAI)
   ─────────────────────────────────────────────────────────────
   .module-card   — biały prostokąt modułu (zakładki, lista, formularz…)
   .module-item   — element W środku karty: szare tło + obramowanie
                    (kafelki kursów, wiersze list, klucze API…)
   .tabs          — zakładki z przesuwającą się pigułką (patrz
                    partials/ui/tabs.ejs)
   ═══════════════════════════════════════════════════════════════ */

.module-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.dark .module-card {
  background: rgba(15, 23, 42, .55);
  border-color: #1e293b;
  box-shadow: none;
}

.module-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: .75rem;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.module-item:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.dark .module-item {
  background: rgba(148, 163, 184, .07);
  border-color: #1e293b;
}
.dark .module-item:hover {
  background: rgba(148, 163, 184, .1);
  border-color: #334155;
}

/* ── Zakładki (pigułka z .tabs-ink przesuwa się pod aktywnym linkiem) ── */
.tabs {
  position: relative;
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tabs-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .5rem 1rem;
  border-radius: 9999px;
  font-size: .875rem;
  font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
  text-decoration: none;
  transition: color .2s ease;
}
.tabs-tab:hover { color: #111827; }
.tabs-tab.is-active { color: #111827; font-weight: 600; }

.tabs-ink {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  background: #fff;
  border-radius: 9999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
  transition: left .25s cubic-bezier(.4, 0, .2, 1), width .25s cubic-bezier(.4, 0, .2, 1);
}

.dark .tabs {
  background: rgba(15, 23, 42, .6);
  border-color: #1e293b;
}
.dark .tabs-tab { color: #94a3b8; }
.dark .tabs-tab:hover,
.dark .tabs-tab.is-active { color: #fff; }
.dark .tabs-ink { background: #0f172a; box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }

/* Kafelek statystyki (ikona + etykieta + wartość) */
.stat-tile {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .75rem;
  padding: .875rem 1rem;
}
.dark .stat-tile { background: rgba(15, 23, 42, .55); border-color: #1e293b; }
.stat-tile-icon {
  width: 2rem; height: 2rem;
  border-radius: .5rem;
  background: #f3f4f6;
  color: #4b5563;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dark .stat-tile-icon { background: rgba(255,255,255,.06); color: #94a3b8; }
.stat-tile-icon svg { width: 1rem; height: 1rem; }
.stat-tile-label { font-size: .8rem; color: #6b7280; margin: 0; }
.dark .stat-tile-label { color: #94a3b8; }
.stat-tile-value { font-size: 1.125rem; font-weight: 700; color: #111827; margin: 0; line-height: 1.2; }
.dark .stat-tile-value { color: #f1f5f9; }

.module-title { font-size: .95rem; font-weight: 700; color: #111827; display: flex; align-items: center; gap: .5rem; }
.dark .module-title { color: #f1f5f9; }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS — spójny system przycisków (nadpisuje warianty z admin-ui.css,
   które ładują się wcześniej). Bez zmian w markupie stron.
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem 1.2rem;   /* domyślny rozmiar (= btn-md); btn-sm/btn-xs nadpisują */
  font-size: .925rem;
  font-weight: 600;
  border-radius: .75rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.25;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-xs { padding: .35rem .7rem; font-size: .75rem; }
.btn-sm { padding: .5rem 1rem;    font-size: .85rem; }
.btn-md { padding: .6rem 1.2rem;  font-size: .925rem; }

/* Podstawowy / główny (brand CEEA) */
.btn-primary {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 1px 2px rgba(220, 38, 38, .35), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn-primary:hover:not(:disabled) { background: #b91c1c; }

/* Neutralny (biały z borderem — „Edytuj", drukuj itp.) */
.btn-neutral {
  background: #fff;
  border-color: #e5e7eb;
  color: #374151;
}
.btn-neutral:hover:not(:disabled) { background: #f9fafb; border-color: #d1d5db; color: #111827; }

/* Duch (czyszczenie filtrów, pobieranie) */
.btn-ghost {
  background: transparent;
  color: #6b7280;
}
.btn-ghost:hover:not(:disabled) { background: #f3f4f6; color: #111827; }

/* Akcje pomocnicze w wierszach tabel */
.btn-edit {
  background: #eff6ff;
  border-color: #dbeafe;
  color: #2563eb;
}
.btn-edit:hover:not(:disabled) { background: #dbeafe; }

.btn-delete {
  background: #fff;
  border-color: #fecaca;
  color: #dc2626;
}
.btn-delete:hover:not(:disabled) { background: #fef2f2; border-color: #fca5a5; }

.btn-success {
  background: #16a34a;
  color: #fff;
}
.btn-success:hover:not(:disabled) { background: #15803d; }

/* Zapis formularza / utworzenie dokumentu (zielony, jak success) */
.btn-save {
  background: #16a34a;
  color: #fff;
  box-shadow: 0 1px 2px rgba(22, 163, 74, .3), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn-save:hover:not(:disabled) { background: #15803d; }

/* ── Dark mode ── */
.dark .btn-neutral {
  background: rgba(15, 23, 42, .6);
  border-color: #334155;
  color: #e2e8f0;
}
.dark .btn-neutral:hover:not(:disabled) { background: rgba(30, 41, 59, .8); border-color: #475569; color: #fff; }

.dark .btn-ghost { color: #94a3b8; }
.dark .btn-ghost:hover:not(:disabled) { background: rgba(148, 163, 184, .12); color: #fff; }

.dark .btn-edit { background: rgba(37, 99, 235, .15); border-color: rgba(59, 130, 246, .3); color: #93c5fd; }
.dark .btn-edit:hover:not(:disabled) { background: rgba(37, 99, 235, .25); }

.dark .btn-delete { background: transparent; border-color: rgba(248, 113, 113, .35); color: #f87171; }
.dark .btn-delete:hover:not(:disabled) { background: rgba(220, 38, 38, .12); border-color: rgba(248, 113, 113, .55); }

/* Karta „produktowa" — zewnętrzny poziom: biel, shadow, uniesienie na hover.
   Używaj razem z .card-inner (wewnętrzny border). */
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, .09);
  border-color: #d1d5db;
  transform: translateY(-2px);
}
.dark .card {
  background: rgba(15, 23, 42, .55);
  border-color: #1e293b;
  box-shadow: none;
}
.dark .card:hover {
  border-color: #334155;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
  transform: translateY(-2px);
}


/* ===== HELP PAGE ===== */
.help-hero {
  background: 
    radial-gradient(at 40% 20%, rgba(185, 28, 28, 0.08) 0px, transparent 50%),
    radial-gradient(at 80% 0%, rgba(185, 28, 28, 0.05) 0px, transparent 50%),
    radial-gradient(at 0% 50%, rgba(185, 28, 28, 0.06) 0px, transparent 50%);
}

.help-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.help-card:hover {
  transform: translateY(-4px);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
}
.faq-answer.open {
  max-height: 600px;
}

.faq-chevron {
  transition: transform 0.3s ease;
}
.faq-chevron.rotate {
  transform: rotate(180deg);
}

.scroll-mt-24 {
  scroll-margin-top: 6rem;
}

/* Privacy page */
.scroll-mt-24 {
  scroll-margin-top: 6rem;
}

@media print {
  .toc-link { display: none; }
  header { position: static; }
  section { break-inside: avoid; }
}

.nf-shape-svg {
  position: absolute;
  left: 50%; top: 50%;
  width: min(92vw, 60rem);
  animation: nf-sway 12s ease-in-out infinite alternate;
}
@keyframes nf-sway {
  from { transform: translate(-50%, -50%) scale(1) rotate(-1.5deg); }
  to   { transform: translate(-50%, -50%) scale(1.05) rotate(1.5deg); }
}

.nf-shape-svg--back {
  width: min(98vw, 66rem);
  opacity: .55;
  animation-duration: 16s;
  animation-direction: alternate-reverse;
}


/* admin */

.admin-bg {
  background: linear-gradient(
    135deg,
    #1e3a8a 0%,
    #3b82f6 50%,
    #1d4ed8 100%
  );
}
/* Na małych ekranach dodaj gradientowe tło */
@media (max-width: 1023px) {
  body {
    background: linear-gradient(
      135deg,
      #fef2f2 0%,
      #ffffff 50%,
      #fef2f2 100%
    );
    min-height: 100vh;
  }
  .mobile-decoration {
    position: fixed;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    pointer-events: none;
  }
  .mobile-decoration-1 {
    background: #dc2626;
    top: -50px;
    right: -50px;
  }
  .mobile-decoration-2 {
    background: #3b82f6;
    bottom: -50px;
    left: -50px;
  }
}
.login-view {
  display: none;
}
.login-view.active {
  display: block;
  animation: viewIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Spinner w przycisku */
.btn-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Ikona "wysłano" */
.sent-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto;
}
.sent-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(220, 38, 38, 0.35);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes popIn {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.sent-ring {
  position: absolute;
  inset: -10px;
  border: 2px dashed rgba(220, 38, 38, 0.4);
  border-radius: 50%;
  animation: ringSpin 14s linear infinite;
}
@keyframes ringSpin {
  to {
    transform: rotate(360deg);
  }
}
.sent-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #16a34a;
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: badgeIn 0.4s 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes badgeIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}
.sent-envelope {
  animation: floatY 3s 0.6s ease-in-out infinite;
}
@keyframes floatY {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-view.active,
  .sent-circle,
  .sent-badge,
  .sent-ring,
  .sent-envelope {
    animation: none;
  }
}

/* end admin */



/* --- Widoki logowania --- */
.login-view {
  display: none;
}
.login-view.active {
  display: block;
  animation: viewIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}




@media (prefers-reduced-motion: reduce) {
  .login-view.active,
  .sent-circle,
  .sent-badge,
  .sent-ring,
  .sent-envelope {
    animation: none;
  }
}






/* Efekt "shine" na kartach w dark mode */
@media (prefers-color-scheme: dark) {
  .glass-card {
    position: relative;
    overflow: hidden;
  }
  .glass-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    transition: left 0.7s;
  }
  .glass-card:hover::before {
    left: 100%;
  }
}





/* ═══════════════════════════════════════════════════════════════
   ROW MENU — „kebab" z akcjami w wierszach tabel
   Używa funkcji rowActions() z data-table.js.
   1 akcja  → zwykły przycisk (bez kropek)
   2+ akcji → ⋮ + rozwijane menu
   ═══════════════════════════════════════════════════════════════ */
   .row-menu { position: relative; display: inline-block; }

   .row-menu-btn {
     width: 2rem; height: 2rem;
     display: inline-flex; align-items: center; justify-content: center;
     border-radius: .5rem;
     border: 1px solid #e5e7eb;
     background: #fff;
     color: #6b7280;
     cursor: pointer;
     transition: background .15s ease, color .15s ease, border-color .15s ease;
   }
   .row-menu-btn:hover { background: #f9fafb; color: #111827; border-color: #d1d5db; }
   .row-menu-btn svg { width: 1rem; height: 1rem; }
   
   .row-menu-panel {
     position: fixed;      /* poza overflow kontenera tabeli; pozycję ustawia JS */
     top: 0;
     left: 0;
     min-width: 11rem;
     background: #fff;
     border: 1px solid #e5e7eb;
     border-radius: .75rem;
     box-shadow: 0 12px 32px rgba(2, 6, 23, .12), 0 2px 8px rgba(2, 6, 23, .06);
     padding: .25rem;
     z-index: 100;
   }
   .row-menu-item {
     display: flex; align-items: center; gap: .5rem;
     width: 100%;
     text-align: left;
     padding: .5rem .75rem;
     font-size: .8rem;
     font-weight: 500;
     color: #374151;
     border-radius: .5rem;
     text-decoration: none;
     background: none;
     border: none;
     cursor: pointer;
     white-space: nowrap;
   }
   .row-menu-item:hover { background: #f3f4f6; }
   .row-menu-item.is-danger { color: #dc2626; }
   .row-menu-item.is-danger:hover { background: #fef2f2; }
   .row-menu-item:disabled { opacity: .45; cursor: not-allowed; }
   .row-menu-item[aria-disabled="true"] { opacity: .45; pointer-events: none; }
   
   /* Dark */
   .dark .row-menu-btn { background: rgba(15,23,42,.6); border-color: #334155; color: #94a3b8; }
   .dark .row-menu-btn:hover { background: rgba(30,41,59,.8); color: #fff; border-color: #475569; }
   .dark .row-menu-panel { background: #1e293b; border-color: #334155; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
   .dark .row-menu-item { color: #e2e8f0; }
   .dark .row-menu-item:hover { background: rgba(148,163,184,.12); }
   .dark .row-menu-item.is-danger { color: #f87171; }
   .dark .row-menu-item.is-danger:hover { background: rgba(220,38,38,.12); }
   
   /* ── Timeline statusów (strona zamówienia) ── */
   .steps { display: flex; }
   .step {
     flex: 1;
     position: relative;
     padding-top: 1.6rem;
     text-align: center;
     font-size: .75rem;
     font-weight: 500;
     color: #9ca3af;
   }
   .step::before {
     content: '';
     position: absolute;
     top: .35rem;
     left: 50%;
     transform: translateX(-50%);
     width: .8rem; height: .8rem;
     border-radius: 9999px;
     background: #e5e7eb;
   }
   .step::after {
     content: '';
     position: absolute;
     top: .65rem;
     left: calc(50% + .6rem);
     right: calc(-50% + .6rem);
     height: 2px;
     background: #e5e7eb;
   }
   .step:last-child::after { display: none; }
   .step.is-done { color: #374151; }
   .step.is-done::before { background: #16a34a; }
   .step.is-done::after { background: #16a34a; }
   .step.is-current { color: #111827; font-weight: 700; }
   .step.is-current::before { background: #dc2626; box-shadow: 0 0 0 4px rgba(220, 38, 38, .15); }
   
   .dark .step { color: #64748b; }
   .dark .step::before, .dark .step::after { background: #334155; }
   .dark .step.is-done { color: #cbd5e1; }
   .dark .step.is-done::before, .dark .step.is-done::after { background: #16a34a; }
   .dark .step.is-current { color: #fff; }
   .dark .step.is-current::before { background: #dc2626; }


   /* ── Przełącznik (switch) ── */
.switch { position: relative; display: inline-block; width: 2.75rem; height: 1.5rem; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; border-radius: 999px;
  background: #d1d5db; transition: background .2s ease; cursor: pointer;
}
.switch .slider::before {
  content: ''; position: absolute; top: .1875rem; left: .1875rem;
  width: 1.125rem; height: 1.125rem; border-radius: 999px;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .2s ease;
}
.switch input:checked + .slider { background: #dc2626; }
.switch input:checked + .slider::before { transform: translateX(1.25rem); }
.dark .switch .slider { background: #475569; }

select {
  -webkit-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 1rem !important;
  padding-right: 2.5rem !important;
}


/* ═══════════════════════════════════════════════════════════════
   PULPIT — nowocześniejsze karty (nakładka)
   Dokleić NA KOŃCU głównego CSS panelu (po .module-card / .stat-tile)
   albo zapisać jako osobny plik i podlinkować jako OSTATNI w head.ejs.
   Nadpisuje tylko wygląd — markup zostaje bez zmian.
   ═══════════════════════════════════════════════════════════════ */

/* ── Karty modułów: większy radius, warstwowy cień, żywsza obwódka ── */
.module-card {
  border: 1px solid #e7e9ee;
  border-radius: 1.25rem;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, .04),
    0 8px 24px -12px rgba(16, 24, 40, .10);
  transition: box-shadow .25s ease, border-color .25s ease;
}
.module-card:hover {
  border-color: #dde1e8;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, .05),
    0 14px 34px -12px rgba(16, 24, 40, .14);
}
.dark .module-card {
  background: rgba(15, 23, 42, .65);
  border-color: #263248; /* jaśniejsza obwódka — karta "wychodzi" z ciemnego tła */
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .5);
}
.dark .module-card:hover {
  border-color: #334155;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .6);
}

/* ── Kafelki statystyk: uniesienie na hover, ikona w barwie brandu ── */
.stat-tile {
  border: 1px solid #e7e9ee;
  border-radius: 1rem;
  padding: 1rem 1.125rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: transform .18s ease, box-shadow .25s ease, border-color .25s ease;
}
.stat-tile:hover {
  transform: translateY(-2px);
  border-color: #dde1e8;
  box-shadow: 0 10px 24px -10px rgba(16, 24, 40, .15);
}
.dark .stat-tile { border-color: #263248; }
.dark .stat-tile:hover { border-color: #334155; }

.stat-tile-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .625rem;
  background: #fef2f2;   /* czerwony pastelowy spód — spójny z brandem CEEA */
  color: #dc2626;
}
.dark .stat-tile-icon {
  background: rgba(220, 38, 38, .14);
  color: #f87171;
}
.stat-tile-label { font-size: .78rem; font-weight: 500; letter-spacing: .01em; }
.stat-tile-value { font-size: 1.3rem; letter-spacing: -0.02em; }

/* ── Tytuły sekcji: odrobinę większe i ścieśnione ── */
.module-title { font-size: 1rem; letter-spacing: -0.01em; }

/* ── Elementy wewnętrzne kart (mini-kafelki GA4 itp.) ── */
.module-item { border-radius: .875rem; }
.dark .module-item { border-color: #263248; }

/* ── Słupki wykresów: gradient + delikatna reakcja na hover ── */
#visitsChart > div,
#bookOrdersChart > div {
  background: linear-gradient(180deg, #f87171 0%, #ef4444 55%, #dc2626 100%);
  border-radius: .375rem .375rem 0 0;
  transition: filter .15s ease, transform .15s ease;
}
#visitsChart > div:hover,
#bookOrdersChart > div:hover {
  filter: brightness(1.07);
  transform: scaleY(1.02);
  transform-origin: bottom;
}
.dark #visitsChart > div,
.dark #bookOrdersChart > div {
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
}


/* ADMIN */
.admin-bg {
  background: radial-gradient(
      60% 60% at 50% 0%,
      rgba(59, 130, 246, 0.12),
      transparent
    ),
    #020617;
}

/* dryfująca siatka kropek */
.dots-layer {
  background-image: radial-gradient(
    rgba(148, 163, 184, 0.5) 1px,
    transparent 1.2px
  );
  background-size: 28px 28px;
  animation: dots-drift 22s linear infinite;
}
@keyframes dots-drift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 56px 56px;
  }
}

/* pływające bloby */
.anim-float-a {
  animation: float-a 14s ease-in-out infinite;
}
.anim-float-b {
  animation: float-b 19s ease-in-out infinite;
}
@keyframes float-a {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(24px, -28px);
  }
}
@keyframes float-b {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-28px, 20px);
  }
}

/* radar znad karty */
.radar-ring {
  position: absolute;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 9999px;
  animation: radar 4.5s ease-out infinite;
}
@keyframes radar {
  0% {
    transform: scale(0.55);
    opacity: 0.45;
  }
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

/* scanline na QR */
.qr-frame {
  position: relative;
  overflow: hidden;
  display: inline-block;
  border-radius: 0.5rem;
}
.qr-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #60a5fa, transparent);
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.8);
  animation: qr-scan 2.4s ease-in-out infinite;
}
@keyframes qr-scan {
  0% {
    top: 0;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  50% {
    top: calc(100% - 2px);
  }
  90% {
    opacity: 1;
  }
  100% {
    top: 0;
    opacity: 0;
  }
}

/* przejście między krokami */
.step-anim {
  animation: step-in 0.35s ease;
}
@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* wejście przy ładowaniu */
.anim-rise {
  animation: rise 0.6s cubic-bezier(0.22, 0.8, 0.35, 1) both;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* puls tarczy shield */
.shield-ping {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.3);
  animation: shield-ping 2.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes shield-ping {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  75%,
  100% {
    transform: scale(1.7);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dots-layer,
  .anim-float-a,
  .anim-float-b,
  .radar-ring,
  .qr-scan,
  .step-anim,
  .anim-rise,
  .shield-ping {
    animation: none !important;
  }
}

/* MAILE */

.tpl-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid #e7e9ee;
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.tpl-card:hover { border-color: #fca5a5; }
.tpl-card.is-active {
  border-color: #dc2626;
  background: #fef2f2;
  box-shadow: inset 0 0 0 1px #dc2626;
}
.dark .tpl-card { background: #0f172a; border-color: #263248; }
.dark .tpl-card:hover { border-color: #7f1d1d; }
.dark .tpl-card.is-active {
  background: rgba(220, 38, 38, 0.08);
  border-color: #dc2626;
}
/* Quill dopasowany do panelu */
.ql-toolbar.ql-snow {
  border: 1px solid #e7e9ee;
  border-radius: 0.75rem 0.75rem 0 0;
  background: #f9fafb;
}
.ql-container.ql-snow {
  border: 1px solid #e7e9ee;
  border-top: 0;
  border-radius: 0 0 0.75rem 0.75rem;
  min-height: 180px;
  font-size: 0.9rem;
}
.dark .ql-toolbar.ql-snow { background: #0f172a; border-color: #263248; }
.dark .ql-container.ql-snow { border-color: #263248; background: rgba(15, 23, 42, 0.6); color: #fff; }
.dark .ql-snow .ql-stroke { stroke: #94a3b8; }
.dark .ql-snow .ql-picker { color: #94a3b8; }
/* Przyciski akcji modułu maili */
.mail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex: 1 1 0%;
  padding: 0.7rem 1.25rem;
  border-radius: 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s,
    transform 0.15s, box-shadow 0.15s;
}
.mail-btn svg { width: 1.05rem; height: 1.05rem; flex-shrink: 0; }
.mail-btn:disabled { opacity: 0.6; cursor: wait; }
.mail-btn-neutral {
  background: #fff;
  border-color: #d1d5db;
  color: #374151;
}
.mail-btn-neutral:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: #fef2f2;
}
.dark .mail-btn-neutral {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}
.dark .mail-btn-neutral:hover {
  border-color: #dc2626;
  color: #f87171;
  background: rgba(220, 38, 38, 0.08);
}
.mail-btn-primary {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.25),
    0 4px 12px -4px rgba(220, 38, 38, 0.35);
}
.mail-btn-primary:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  transform: translateY(-1px);
}
.mail-btn-primary:active { transform: translateY(0); }
/* Szkielet ładowania pól */
.field-skeleton {
  height: 2.75rem;
  border-radius: 0.75rem;
  background: #f3f4f6;
  animation: pulse 1.4s ease-in-out infinite;
}
.dark .field-skeleton { background: #1e293b; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }



/* PŁATNOŚCI */

@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: white;
  }
}



/* LOGIN */

/* prawa strona — kropki */
.login-dots {
  background-image: radial-gradient(#dc2626 1px, transparent 1px);
  background-size: 20px 20px;
}
.dark .login-dots {
  background-image: radial-gradient(
    rgba(148, 163, 184, 0.5) 1px,
    transparent 1px
  );
}

/* lewa strona — dryfujące kropki */
.dots-layer {
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.85) 1.2px,
    transparent 1.3px
  );
  background-size: 28px 28px;
  animation: dots-drift 22s linear infinite;
}
@keyframes dots-drift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 56px 56px;
  }
}

/* pływające bloby */
.anim-float-a {
  animation: float-a 14s ease-in-out infinite;
}
.anim-float-b {
  animation: float-b 19s ease-in-out infinite;
}
@keyframes float-a {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(24px, -28px);
  }
}
@keyframes float-b {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-28px, 20px);
  }
}

/* linia EKG — jasny puls przesuwa się po śladzie */
.ecg-pulse {
  stroke-dasharray: 200 2000;
  animation: ecg-run 6s linear infinite;
}
@keyframes ecg-run {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: -2200;
  }
}

/* karty delikatnie się unoszą */
.anim-bob {
  animation: bob 6s ease-in-out infinite;
}
.anim-bob-delay {
  animation-delay: 1.6s;
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* wejście przy ładowaniu */
.anim-rise {
  animation: rise 0.6s cubic-bezier(0.22, 0.8, 0.35, 1) both;
}
.anim-rise-1 {
  animation-delay: 0.1s;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dots-layer,
  .anim-float-a,
  .anim-float-b,
  .ecg-pulse,
  .anim-bob,
  .anim-rise {
    animation: none !important;
  }
}



/* POMOC */

.hp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.hp-btn-primary { background: #dc2626; border-color: #dc2626; color: #fff; }
.hp-btn-primary:hover { background: #b91c1c; border-color: #b91c1c; }
.hp-btn-neutral { background: #fff; border-color: #d1d5db; color: #374151; }
.hp-btn-neutral:hover { border-color: #dc2626; color: #dc2626; background: #fef2f2; }
.dark .hp-btn-neutral { background: #0f172a; border-color: #334155; color: #e2e8f0; }
.dark .hp-btn-neutral:hover { border-color: #dc2626; color: #f87171; background: rgba(220, 38, 38, 0.08); }
.hp-btn-danger { background: #fff; border-color: #fecaca; color: #b91c1c; }
.hp-btn-danger:hover { background: #fef2f2; border-color: #dc2626; }
.dark .hp-btn-danger { background: #0f172a; border-color: #7f1d1d; color: #f87171; }
.dark .hp-btn-danger:hover { background: rgba(220, 38, 38, 0.08); border-color: #dc2626; }
.hp-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.hp-input:focus { border-color: #f87171; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08); }
.dark .hp-input { background: rgba(15, 23, 42, 0.6); border-color: #475569; color: #fff; }
.hp-label { display: block; font-size: 0.72rem; font-weight: 500; color: #6b7280; margin-bottom: 0.35rem; }
.dark .hp-label { color: #94a3b8; }
details.hp-item > summary { list-style: none; cursor: pointer; }
details.hp-item > summary::-webkit-details-marker { display: none; }
details.hp-item[open] > summary .hp-chevron { transform: rotate(180deg); }
.hp-chevron { transition: transform 0.15s; }

/* Kontakt */

.ct-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.25rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ct-card:hover { border-color: #d1d5db; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04); }
.dark .ct-card { background: rgba(15, 23, 42, 0.6); border-color: #1e293b; }
.dark .ct-card:hover { border-color: #334155; }
.ct-avatar {
  width: 3.5rem; height: 3.5rem;
  border-radius: 9999px;
  object-fit: cover;
  flex-shrink: 0;
}
.ct-initials {
  width: 3.5rem; height: 3.5rem;
  border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  background: #fef2f2; color: #dc2626;
  font-weight: 700; font-size: 1rem;
  flex-shrink: 0;
}
.dark .ct-initials { background: rgba(220, 38, 38, 0.12); color: #f87171; }
.ct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.ct-btn-primary { background: #dc2626; border-color: #dc2626; color: #fff; }
.ct-btn-primary:hover { background: #b91c1c; border-color: #b91c1c; }
.ct-btn-neutral { background: #fff; border-color: #d1d5db; color: #374151; }
.ct-btn-neutral:hover { border-color: #dc2626; color: #dc2626; background: #fef2f2; }
.dark .ct-btn-neutral { background: #0f172a; border-color: #334155; color: #e2e8f0; }
.dark .ct-btn-neutral:hover { border-color: #dc2626; color: #f87171; background: rgba(220, 38, 38, 0.08); }
.ct-link {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.82rem; font-weight: 500;
  color: #374151;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.ct-link:hover { background: #fef2f2; color: #dc2626; }
.dark .ct-link { color: #cbd5e1; }
.dark .ct-link:hover { background: rgba(220, 38, 38, 0.08); color: #f87171; }
.ct-sys dt { font-size: 0.72rem; color: #6b7280; }
.dark .ct-sys dt { color: #94a3b8; }
.ct-sys dd { font-size: 0.82rem; font-weight: 600; color: #111827; font-family: ui-monospace, monospace; }
.dark .ct-sys dd { color: #e2e8f0; }
/* ====== PANEL: ZWIJANY PASEK FILTRÓW (wspólny dla modułów) ====== */
.filter-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.filter-bar-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}
.dark .filter-bar-title { color: #94a3b8; }
.filter-bar-actions { display: flex; align-items: center; gap: 0.75rem; }
.filter-clear {
  border: none;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.25rem 0.45rem;
  border-radius: 7px;
}
.filter-clear:hover { color: #dc2626; background: rgba(220, 38, 38, 0.08); }
.dark .filter-clear { color: #94a3b8; }
.dark .filter-clear:hover { color: #f87171; }
.filter-toggle {
  display: none;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  border-radius: 8px;
  padding: 0.3rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.dark .filter-toggle { background: #0f172a; border-color: #334155; color: #e2e8f0; }
.filter-toggle .chev { display: inline-block; transition: transform 0.18s ease; }
.filter-toggle.open .chev { transform: rotate(180deg); }
@media (max-width: 860px) {
  .filter-toggle { display: inline-flex; }
}