:root {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --border-subtle: #e2e8f0;
  --border-hover: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --brand-primary: #4f46e5;
  --brand-hover: #4338ca;
  --brand-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.02);
  --shadow-hover: 0 20px 35px -10px rgba(79, 70, 229, 0.15), 0 10px 15px -5px rgba(15, 23, 42, 0.05);
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-pill: 9999px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-surface: #131b2e;
  --bg-glass: rgba(19, 27, 46, 0.85);
  --border-subtle: #1e293b;
  --border-hover: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 20px 40px -10px rgba(99, 102, 241, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Tło dekoracyjne w stylu Canva */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.ambient-circle-1 {
  position: absolute;
  top: -150px;
  left: -100px;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0) 70%);
  border-radius: 50%;
  filter: blur(50px);
}
.ambient-circle-2 {
  position: absolute;
  top: 30%;
  right: -150px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.12) 0%, rgba(236, 72, 153, 0) 70%);
  border-radius: 50%;
  filter: blur(60px);
}
.ambient-circle-3 {
  position: absolute;
  bottom: -150px;
  left: 30%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, rgba(6, 182, 212, 0) 70%);
  border-radius: 50%;
  filter: blur(50px);
}

/* Pasek nawigacji */
.navbar {
  position: sticky;
  top: 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.brand-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--text-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: rgba(100, 116, 139, 0.08);
  color: var(--text-main);
}

.btn-primary {
  background: var(--brand-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
  border-color: var(--border-hover);
  background: rgba(100, 116, 139, 0.05);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-role-badge {
  font-size: 10px;
  background: rgba(79, 70, 229, 0.15);
  color: var(--brand-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
[data-theme="dark"] .user-role-badge {
  background: rgba(99, 102, 241, 0.22);
  color: #a5b4fc;
}

/* =========================================================================
   ZINTEGROWANE MENU ROZWIJANE UŻYTKOWNIKA (PROFIL / MFA / WYLOGUJ)
   ========================================================================= */
.user-menu-dropdown {
  position: relative;
  display: inline-block;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.user-menu-trigger:hover,
.user-menu-dropdown.open .user-menu-trigger {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
}

.user-chevron {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-muted);
}

.user-menu-dropdown.open .user-chevron {
  transform: rotate(180deg);
  color: var(--brand-primary);
}

.user-dropdown-pane {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  max-width: calc(100vw - 24px);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 6px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

[data-theme="dark"] .user-dropdown-pane {
  background: #111827;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.user-menu-dropdown.open .user-dropdown-pane {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 8px;
}

.user-avatar-lg {
  width: 36px;
  height: 36px;
  font-size: 15px;
  flex-shrink: 0;
}

.user-dropdown-meta {
  min-width: 0;
  flex: 1;
}

.user-dropdown-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 11px;
}

.user-dropdown-email {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 135px;
  font-size: 11.5px;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

.user-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  font-family: inherit;
}

.user-dropdown-item:hover {
  background: rgba(100, 116, 139, 0.08);
  color: var(--brand-primary);
}

.user-dropdown-item-danger {
  color: #ef4444;
}

.user-dropdown-item-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

[data-theme="dark"] .user-dropdown-item-danger:hover {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
}

/* Główny kontener */
.container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 32px 24px;
  flex: 1;
  width: 100%;
}

/* Hero & Wyszukiwarka */
.hero-section {
  text-align: center;
  margin: 20px auto 44px auto;
  max-width: 760px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.08);
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 12px;
}

.hero-description {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.search-bar-wrap {
  position: relative;
  max-width: 580px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  font-size: 18px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 16px 52px 16px 48px;
  font-size: 15px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12), var(--shadow-card);
}

.search-shortcut {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(100, 116, 139, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}

/* Sekcje kafelków */
.section-wrapper {
  margin-bottom: 48px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-badge {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-badge-public {
  background: rgba(14, 165, 233, 0.1);
  color: #0284c7;
}

.section-badge-admin {
  background: rgba(234, 88, 12, 0.1);
  color: #ea580c;
}

.section-badge-local {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.section-count {
  font-size: 13px;
  color: var(--text-subtle);
  font-weight: 500;
}

/* Siatka kafelków w stylu Canva */
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 24px;
}

.tile-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  overflow: hidden;
  cursor: pointer;
}

.tile-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--tile-gradient, var(--brand-gradient));
  opacity: 0.8;
  transition: height 0.25s ease, opacity 0.25s ease;
}

.tile-card:hover {
  transform: translateY(-5px);
  border-color: transparent;
  box-shadow: var(--shadow-hover);
}

.tile-card:hover::before {
  height: 6px;
  opacity: 1;
}

.tile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tile-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 24px;
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s ease;
}

.tile-card:hover .tile-icon-box {
  transform: scale(1.08) rotate(-3deg);
}

.tile-corner-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(100, 116, 139, 0.08);
  color: var(--text-muted);
}

.tile-body {
  flex: 1;
  margin-bottom: 18px;
}

.tile-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tile-arrow {
  opacity: 0;
  transform: translateX(-4px);
  transition: var(--transition);
  font-size: 14px;
  color: var(--brand-primary);
}

.tile-card:hover .tile-arrow {
  opacity: 1;
  transform: translateX(0);
}

.tile-domain {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: block;
}

.tile-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 12px;
  font-weight: 600;
}

.tile-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #10b981;
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.tile-open-btn {
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Modale */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
  box-sizing: border-box;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 20px 24px 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: var(--bg-surface);
  gap: 12px;
}

.modal-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.modal-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
}

.modal-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-close-btn {
  background: rgba(100, 116, 139, 0.08);
  border: 1px solid var(--border-subtle);
  font-size: 20px;
  color: var(--text-main);
  cursor: pointer;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
  line-height: 1;
}
.modal-close-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

.modal-body {
  padding: 20px 24px 28px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.45) transparent;
}

/* =========================================================================
   ZINTEGROWANY SYSTEM SCROLLBARA (STYL CANVA - BEZ BIAŁYCH PASKÓW PRZEGLĄDARKI)
   ========================================================================= */
.modal-body::-webkit-scrollbar,
.custom-scrollbar::-webkit-scrollbar {
  width: 7px;
}

.modal-body::-webkit-scrollbar-track,
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
  margin: 8px 0;
}

.modal-body::-webkit-scrollbar-thumb,
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
  transition: background 0.2s ease;
}

.modal-body::-webkit-scrollbar-thumb:hover,
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.75);
}

[data-theme="dark"] .modal-body {
  scrollbar-color: rgba(129, 140, 248, 0.5) transparent;
}

[data-theme="dark"] .modal-body::-webkit-scrollbar-thumb,
[data-theme="dark"] .custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(129, 140, 248, 0.45);
}

[data-theme="dark"] .modal-body::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(165, 180, 252, 0.85);
}

/* Globalny scrollbar strony */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.35) transparent;
}

html::-webkit-scrollbar {
  width: 8px;
}

html::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.35);
  border-radius: 999px;
}

html::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.65);
}

[data-theme="dark"] html {
  scrollbar-color: rgba(129, 140, 248, 0.4) transparent;
}

[data-theme="dark"] html::-webkit-scrollbar-thumb {
  background: rgba(129, 140, 248, 0.35);
}

[data-theme="dark"] html::-webkit-scrollbar-thumb:hover {
  background: rgba(165, 180, 252, 0.7);
}

/* Formularze */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}
.form-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.alert-message {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  margin-bottom: 20px;
  display: none;
}
.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}
.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

/* Changelog */
.changelog-timeline {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.changelog-item {
  position: relative;
  padding-left: 28px;
}
.changelog-item::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: -24px;
  width: 2px;
  background: var(--border-subtle);
}
.changelog-item:last-child::before {
  display: none;
}
.changelog-dot {
  position: absolute;
  left: 0;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.changelog-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.changelog-ver {
  font-size: 17px;
  font-weight: 800;
}

.changelog-date {
  font-size: 12px;
  color: var(--text-subtle);
}

.changelog-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
}
.changelog-list li {
  position: relative;
  padding-left: 18px;
}
.changelog-list li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: var(--brand-primary);
  font-size: 16px;
}

/* Stopka */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 8px;
}
.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}
.footer-link:hover {
  color: var(--brand-primary);
}

/* =========================================================================
   ELEMENTY NAWIGACJI MOBILNEJ
   ========================================================================= */
.nav-btn-badge-mobile {
  display: none;
}

/* =========================================================================
   RESPONSYWNOŚĆ I WERSJA MOBILNA DLA TELEFONÓW (MOBILE-FIRST POLISH)
   ========================================================================= */

/* Płynne skalowanie na tabletach (<= 900px) */
@media (max-width: 900px) {
  .tiles-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
  }
}

/* Smartfony i urządzenia mobilne (<= 768px) */
@media (max-width: 768px) {
  /* Przylepny pasek nawigacji z efektem rozmycia */
  .navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 12px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-subtle);
    gap: 8px;
  }

  .brand-container {
    gap: 8px;
    min-width: 0;
    flex-shrink: 1;
  }

  .brand-icon-box {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 17px;
    flex-shrink: 0;
  }

  .brand-title {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-subtitle {
    display: none;
  }

  .nav-actions {
    gap: 6px;
    flex-shrink: 0;
  }

  .nav-actions .btn {
    padding: 7px 9px;
    font-size: 13px;
  }

  .user-menu-trigger {
    padding: 4px 8px 4px 4px;
    gap: 6px;
    font-size: 12.5px;
  }

  .user-badge {
    padding: 4px 8px;
    font-size: 12px;
  }

  .user-name-text {
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .user-dropdown-pane {
    right: 0;
    left: auto;
    width: 250px;
    max-width: calc(100vw - 20px);
  }

  /* Sekcja nagłówkowa / Hero na telefonie */
  .hero-section {
    padding: 24px 8px 16px;
  }

  .hero-tag {
    font-size: 11px;
    padding: 4px 10px;
    margin-bottom: 12px;
  }

  .hero-title {
    font-size: 24px;
    line-height: 1.25;
    letter-spacing: -0.5px;
  }

  .hero-description {
    font-size: 13.5px;
    line-height: 1.5;
    margin: 8px auto 18px;
    padding: 0 4px;
  }

  .search-bar-wrap {
    max-width: 100%;
    margin: 0 auto;
    border-radius: var(--radius-md);
  }

  .search-input {
    font-size: 16px; /* Zapobiega niepożądanemu powiększaniu widoku na iOS/Android */
    padding: 13px 14px 13px 44px;
  }

  .search-icon {
    left: 14px;
  }

  .search-shortcut {
    display: none; /* Skrót klawiszowy '/' jest zbędny na ekranie dotykowym */
  }

  /* Siatka kafelków usług */
  .section-header {
    margin-bottom: 14px;
  }

  .section-title {
    font-size: 19px;
  }

  .tiles-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Kafelki zoptymalizowane pod dotyk */
  .tile-card {
    padding: 18px 16px;
    border-radius: var(--radius-lg);
    -webkit-tap-highlight-color: transparent;
  }

  .tile-card:active {
    transform: scale(0.985);
    background: var(--bg-hover);
  }

  .tile-header {
    margin-bottom: 12px;
  }

  .tile-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .tile-title {
    font-size: 16px;
  }

  .tile-domain {
    font-size: 12px;
  }

  .tile-desc {
    font-size: 13px;
    line-height: 1.45;
    margin: 6px 0 12px;
  }

  .tile-footer {
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
  }

  .tile-open-btn {
    font-size: 12.5px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(100, 116, 139, 0.08);
  }

  /* Okna modalne jako wygodny arkusz mobilny */
  .modal-overlay {
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    align-items: flex-end;
    box-sizing: border-box;
  }

  .modal-card {
    max-height: calc(100dvh - 28px - env(safe-area-inset-top, 0px));
    max-height: min(calc(100dvh - 28px), calc(100vh - 84px));
    width: 100%;
    border-radius: 20px 20px 12px 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .modal-header {
    flex-shrink: 0;
    padding: 14px 16px;
    gap: 8px;
    background: var(--bg-surface);
  }

  .modal-title-box {
    min-width: 0;
    flex: 1;
    gap: 10px;
  }

  .modal-icon-badge {
    width: 34px;
    height: 34px;
    font-size: 16px;
    flex-shrink: 0;
  }

  .modal-title {
    font-size: 15.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .modal-close-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 20px;
    border-radius: 10px;
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
  }

  .modal-body {
    padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
  }

  /* Przyciski i formularze w modalach */
  .form-input {
    font-size: 16px; /* Bez auto-zooma */
    padding: 12px 14px;
  }

  .modal-body .btn {
    min-height: 46px;
  }

  /* Stopka na telefonie */
  .footer {
    margin-top: 36px;
    padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 12px;
  }

  /* Powiadomienia Toast na pełną szerokość ekranu telefonu */
  .toast-container {
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
  }

  .toast {
    padding: 12px 14px;
    border-radius: var(--radius-md);
  }
}

/* Wąskie ekrany telefonów (<= 480px) */
@media (max-width: 480px) {
  .navbar {
    padding: 8px 10px;
    gap: 6px;
  }

  .nav-btn-text {
    display: none;
  }

  .nav-btn-badge-mobile {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
  }

  .brand-title {
    font-size: 13.5px;
  }

  .user-badge {
    padding: 4px 6px;
  }

  .user-name-text {
    display: none;
  }

  .user-role-badge {
    font-size: 9.5px;
    padding: 2px 5px;
  }

  .user-menu-trigger {
    padding: 4px 6px 4px 4px;
    gap: 4px;
  }

  .tile-badges {
    max-width: 60%;
    gap: 4px;
  }

  .tile-invite-badge,
  .tile-ad-badge {
    font-size: 10px;
    padding: 2px 6px;
    gap: 3px;
  }

  .changelog-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .modal-overlay {
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }

  .modal-card {
    max-height: calc(100dvh - 20px - env(safe-area-inset-top, 0px));
    max-height: min(calc(100dvh - 20px), calc(100vh - 75px));
  }

  .modal-header {
    padding: 12px 14px;
  }

  .modal-title {
    font-size: 14.5px;
  }
}

@media (max-width: 360px) {
  .brand-title {
    max-width: 105px;
  }
  .nav-actions {
    gap: 4px;
  }
}


/* =========================================================================
   POWIADOMIENIA TOAST (ZINTEGROWANE Z KODEM STRONY - STYL CANVA)
   ========================================================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 440px;
  width: calc(100% - 48px);
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.18), 0 6px 12px -2px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.toast-success {
  border-left: 4px solid #10b981;
}
.toast-success .toast-icon-box {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.toast-error {
  border-left: 4px solid #ef4444;
}
.toast-error .toast-icon-box {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.toast-info {
  border-left: 4px solid #4f46e5;
}
.toast-info .toast-icon-box {
  background: rgba(79, 70, 229, 0.15);
  color: #4f46e5;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.toast-msg {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.toast-close-btn {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
  border-radius: 6px;
  transition: var(--transition);
}
.toast-close-btn:hover {
  color: var(--text-main);
  background: rgba(100, 116, 139, 0.1);
}


/* Kontener plakietek na kafelkach */
.tile-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  max-width: 65%;
}

/* Plakietka "Na zaproszenie" */
.tile-invite-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(245, 158, 11, 0.32);
  letter-spacing: 0.2px;
  white-space: nowrap;
}

[data-theme="dark"] .tile-invite-badge {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

/* Plakietka konta AD na kafelkach */
.tile-ad-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(79, 70, 229, 0.1);
  color: var(--brand-primary);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(79, 70, 229, 0.22);
  letter-spacing: 0.2px;
  white-space: nowrap;
}

[data-theme="dark"] .tile-ad-badge {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.35);
}
