/* ============================================
   COMPONENTS — Glass cards, buttons, inputs,
   bottom sheet, nav, FAB, toasts, skeletons
   ============================================ */

/* ─────────────────────────────────────────────
   GLASS CARD
   ───────────────────────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: var(--space-4);
}

.glass-card-strong {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: var(--space-4);
}

/* ─────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-base);
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  min-height: 48px;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--red-primary);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(229, 57, 53, 0.40);
}

.btn-primary:hover {
  background: var(--red-dark);
  box-shadow: 0 6px 20px rgba(229, 57, 53, 0.50);
}

.btn-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  box-shadow: var(--glass-shadow);
}

.btn-glass:hover {
  background: var(--glass-bg-strong);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 40px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-md);
}

.btn-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  flex-shrink: 0;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ─────────────────────────────────────────────
   INPUTS
   ───────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.form-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--font-size-base);
  min-height: 48px;
  transition: var(--transition);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  outline: none;
  border-color: var(--red-primary);
  background: var(--glass-bg-strong);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.10);
}

.form-input.error {
  border-color: var(--red-light);
  animation: shake 0.3s ease;
}

.form-error {
  font-size: var(--font-size-sm);
  color: var(--red-light);
  display: none;
}

.form-error.visible {
  display: block;
}

/* Password strength */
.password-strength {
  height: 3px;
  border-radius: 2px;
  background: var(--glass-border);
  margin-top: var(--space-1);
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  border-radius: 2px;
  transition: var(--transition);
  width: 0%;
}

.password-strength-bar.weak   { background: var(--red-light); width: 33%; }
.password-strength-bar.medium { background: var(--yellow);    width: 66%; }
.password-strength-bar.strong { background: var(--green);     width: 100%; }

/* Input with icon */
.input-with-icon {
  position: relative;
}

.input-with-icon .form-input {
  padding-left: 44px;
}

.input-with-icon .input-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 20px;
}

.input-with-icon .input-icon-right {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  background: none;
  border: none;
  padding: var(--space-1);
  transition: var(--transition);
}

.input-with-icon .input-icon-right:hover {
  color: var(--text-primary);
}

/* ─────────────────────────────────────────────
   TOGGLE / PILL SWITCH
   ───────────────────────────────────────────── */
.pill-toggle {
  display: flex;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 4px;
}

.pill-toggle-option {
  flex: 1;
  text-align: center;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  color: var(--text-secondary);
}

.pill-toggle-option.active {
  background: var(--red-primary);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.4);
}

/* ─────────────────────────────────────────────
   BOTTOM NAVIGATION
   ───────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
  padding-bottom: var(--safe-area-bottom);
  background: var(--nav-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--nav-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  padding-top: var(--space-2);
  z-index: var(--z-nav);
  display: none; /* Ukryty do czasu zalogowania */
}

.bottom-nav.visible {
  display: flex;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-1);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  min-height: 48px;
  justify-content: center;
}

.nav-item .material-symbols-rounded {
  font-size: 24px;
  transition: var(--transition);
}

.nav-item span:last-child {
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.nav-item.active {
  color: var(--red-primary);
}

.nav-item.active .material-symbols-rounded {
  font-variation-settings: 'FILL' 1;
}

/* ─────────────────────────────────────────────
   NAV FAB — wycentrowany w bottom nav
   ───────────────────────────────────────────── */
.nav-fab-slot {
  flex: 1.2;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
}

.nav-fab {
  position: absolute;
  top: -22px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--red-primary);
  color: var(--white);
  border: 3.5px solid var(--nav-bg);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(229, 57, 53, 0.50);
  z-index: var(--z-fab);
  transition: var(--transition-spring);
  animation: fabPulse 2.5s ease-in-out infinite;
}

.nav-fab.visible {
  display: flex;
}

.nav-fab .material-symbols-rounded {
  font-size: 26px;
  transition: var(--transition);
}

.nav-fab.open {
  animation: none;
  background: var(--text-secondary);
  box-shadow: none;
}

.nav-fab.open .material-symbols-rounded {
  transform: rotate(45deg);
}

.nav-fab:active {
  transform: scale(0.92);
}

/* ─────────────────────────────────────────────
   SPEED DIAL
   ───────────────────────────────────────────── */
.speed-dial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: calc(var(--z-nav) + 5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.speed-dial-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.speed-dial {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 44px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  align-items: center;
  z-index: calc(var(--z-nav) + 10);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.speed-dial.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}

.speed-dial-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
  transition: var(--transition);
  letter-spacing: 0.01em;
  min-width: 160px;
  justify-content: center;
}

.speed-dial-btn:active {
  transform: scale(0.94);
}

.speed-dial-btn .material-symbols-rounded {
  font-size: 22px;
}

.speed-dial-expense {
  background: var(--red-primary);
  color: var(--white);
}

.speed-dial-income {
  background: var(--green);
  color: var(--white);
}

/* ─────────────────────────────────────────────
   BOTTOM SHEET
   ───────────────────────────────────────────── */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sheet-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--nav-border);
  border-bottom: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: var(--z-sheet);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--space-6) + var(--safe-area-bottom));
}

.bottom-sheet.open {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  margin: var(--space-3) auto var(--space-4);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4) var(--space-4);
}

.sheet-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
}

.sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.sheet-close:hover {
  background: var(--glass-bg-strong);
}

.sheet-body {
  padding: 0 var(--space-4);
}

/* ─────────────────────────────────────────────
   MODAL
   ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: var(--space-4);
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ─────────────────────────────────────────────
   TOAST NOTIFICATIONS
   ───────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + var(--space-4));
  left: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
  align-items: center;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-md);
  font-weight: 500;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  max-width: 90%;
  pointer-events: all;
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast.hiding {
  animation: toastOut 0.25s ease forwards;
}

.toast-success {
  background: rgba(76, 175, 80, 0.85);
  color: #fff;
}

.toast-error {
  background: rgba(229, 57, 53, 0.85);
  color: #fff;
}

.toast-info {
  background: rgba(33, 150, 243, 0.85);
  color: #fff;
}

.toast .material-symbols-rounded {
  font-size: 18px;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────
   SKELETON LOADERS
   ───────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.08) 25%,
    rgba(255,255,255,0.16) 50%,
    rgba(255,255,255,0.08) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  border-radius: 4px;
  margin-bottom: var(--space-2);
}

.skeleton-text.sm { width: 40%; }
.skeleton-text.md { width: 65%; }
.skeleton-text.lg { width: 85%; }
.skeleton-text.full { width: 100%; }

.skeleton-card {
  border-radius: var(--radius-lg);
  height: 80px;
  margin-bottom: var(--space-3);
}

.skeleton-circle {
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────
   EMPTY STATE
   ───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
  gap: var(--space-4);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  background: var(--glass-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
}

.empty-state-icon .material-symbols-rounded {
  font-size: 36px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.empty-state p {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  max-width: 240px;
}

/* ─────────────────────────────────────────────
   AVATAR
   ───────────────────────────────────────────── */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--glass-bg-strong);
  border: 1.5px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-md);
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

/* ─────────────────────────────────────────────
   TAGS / BADGES
   ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-dev {
  background: rgba(255, 193, 7, 0.25);
  border: 1px solid rgba(255, 193, 7, 0.5);
  color: #FFC107;
}

.badge-success {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid rgba(76, 175, 80, 0.4);
  color: var(--green);
}

/* ─────────────────────────────────────────────
   CHOICE CARDS (np. przy rejestracji)
   ───────────────────────────────────────────── */
.choice-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.choice-card {
  padding: var(--space-5);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.choice-card:hover,
.choice-card.selected {
  border-color: rgba(255, 255, 255, 0.5);
  background: var(--glass-bg-strong);
  transform: scale(1.01);
}

.choice-card .choice-icon {
  font-size: 32px;
}

.choice-card h3 {
  font-size: var(--font-size-base);
  font-weight: 700;
}

.choice-card p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ─────────────────────────────────────────────
   PROGRESS BAR
   ───────────────────────────────────────────── */
.progress-bar {
  height: 8px;
  background: var(--glass-bg);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--green);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar-fill.warning { background: var(--yellow); }
.progress-bar-fill.danger  { background: var(--red-light); }

/* ─────────────────────────────────────────────
   SPINNER
   ───────────────────────────────────────────── */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

/* ─────────────────────────────────────────────
   DEV MODE BADGE
   ───────────────────────────────────────────── */
#dev-badge {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  right: 0;
  background: rgba(255, 193, 7, 0.9);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 0 0 0 var(--radius-sm);
  z-index: var(--z-toast);
  display: none;
}

#dev-badge.visible {
  display: block;
}

/* ─────────────────────────────────────────────
   SEARCH BAR
   ───────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-4);
  height: 48px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
  margin-bottom: 0;
}

.search-bar.visible {
  max-height: 56px;
  opacity: 1;
  margin-bottom: var(--space-4);
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: var(--font-size-base);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar .material-symbols-rounded {
  color: var(--text-muted);
  font-size: 20px;
}

/* ─────────────────────────────────────────────
   TOGGLE (switch)
   ───────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
}

.toggle-row label {
  font-size: var(--font-size-base);
  font-weight: 500;
  cursor: pointer;
  flex: 1;
}

.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-thumb {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--glass-border);
}

.toggle-thumb::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  transition: var(--transition-spring);
}

.toggle input:checked + .toggle-thumb {
  background: var(--red-primary);
  border-color: var(--red-primary);
}

.toggle input:checked + .toggle-thumb::after {
  transform: translateX(20px);
}

/* ─────────────────────────────────────────────
   STEP INDICATOR (rejestracja)
   ───────────────────────────────────────────── */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transition: var(--transition);
}

.step-dot.active {
  background: var(--white);
  width: 24px;
  border-radius: var(--radius-pill);
}

/* ─────────────────────────────────────────────
   AMOUNT INPUT (duże pole kwoty)
   ───────────────────────────────────────────── */
.amount-input-wrap {
  text-align: center;
  padding: var(--space-4) 0;
}

.amount-input-wrap .currency-symbol {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-secondary);
  vertical-align: top;
  margin-top: 6px;
  margin-right: 2px;
}

.amount-input {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  background: none;
  border: none;
  color: var(--text-primary);
  text-align: center;
  width: 100%;
  letter-spacing: -0.02em;
}

.amount-input:focus {
  outline: none;
}

.amount-input::placeholder {
  color: var(--text-muted);
}

/* ─────────────────────────────────────────────
   BACK BUTTON
   ───────────────────────────────────────────── */
.back-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  color: var(--text-primary);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.back-btn:hover,
.back-btn:active {
  background: var(--glass-bg-strong);
  transform: scale(0.95);
}

.back-btn .material-symbols-rounded {
  font-size: 20px;
}

/* Na auth screenach — absolute top-left */
.auth-screen .back-btn {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  left: 16px;
}

/* ─────────────────────────────────────────────
   CATEGORY MANAGER
   ───────────────────────────────────────────── */
.cat-mgr-tabs {
  display: flex;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.25rem;
}

.cat-mgr-tab {
  flex: 1;
  text-align: center;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  user-select: none;
}

.cat-mgr-tab.active {
  background: var(--red-primary);
  color: var(--white);
}

.cat-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.5rem;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.cat-row:active {
  background: var(--glass-bg);
}

.cat-row-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cat-row-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.cat-row-default-badge {
  font-size: 0.62rem;
  color: var(--text-muted);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.cat-row-delete {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(229,57,53,0.09);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red-light);
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.cat-row-delete:active {
  background: rgba(229,57,53,0.22);
}

/* Siatka ikon (5 kolumn × 8 wierszy = 40 ikon) */
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 1.25rem;
}

.icon-picker-item {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  background: var(--glass-bg);
  border: 2px solid transparent;
}

.icon-picker-item:active {
  transform: scale(0.90);
}

.icon-picker-item.selected {
  border-color: var(--red-primary);
  background: rgba(229,57,53,0.09);
}

.icon-picker-item .material-symbols-rounded {
  font-size: 20px;
  color: var(--text-secondary);
}

.icon-picker-item.selected .material-symbols-rounded {
  color: var(--red-primary);
}

/* Paleta kolorów (5 kolumn × 4 wiersze = 20 kolorów) */
.color-palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 1.25rem;
}

.color-swatch {
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 3px solid transparent;
  position: relative;
}

.color-swatch:active {
  transform: scale(0.88);
}

.color-swatch.selected {
  outline: 3px solid var(--text-primary);
  outline-offset: 3px;
  opacity: 0.9;
}

/* ─────────────────────────────────────────────
   SETTINGS
   ───────────────────────────────────────────── */
.settings-section {
  margin-bottom: var(--space-4);
}

.settings-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.settings-toggle-row {
  cursor: default;
}

.settings-row-icon {
  color: var(--text-secondary);
  font-size: 22px;
  flex-shrink: 0;
}

.settings-row-text {
  flex: 1;
}

.settings-row-title {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-primary);
}

.settings-row-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ─────────────────────────────────────────────
   BTN DANGER
   ───────────────────────────────────────────── */
.btn-danger {
  background: var(--red-dark);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(198, 40, 40, 0.35);
}

.btn-danger:hover,
.btn-danger:active {
  background: #b71c1c;
}

/* Kod zaproszenia */
.invite-code-display {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-align: center;
  color: var(--text-primary);
  padding: var(--space-3) 0;
}

/* Lista członków */
.member-row {
  border-bottom: 1px solid var(--glass-border);
}

.member-row:last-child {
  border-bottom: none;
}

/* Przycisk wyrzucenia */
.btn-kick {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-kick:hover,
.btn-kick:active {
  color: var(--red-primary);
  background: rgba(229, 57, 53, 0.1);
}
