/* --- СИСТЕМА УВЕДОМЛЕНИЙ (Glassmorphism VisionOS Toasts) --- */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 420px;
  width: calc(100vw - 32px);
}

@media (max-width: 640px) {
  #toast-container {
    top: 16px;
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
  }
}

.toast {
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: #ffffff;
  transform-origin: top right;
  animation: superToastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  touch-action: pan-y;
  user-select: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.toast.swiping {
  transition: none !important;
}

.toast.toast-closing {
  animation: superToastOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards !important;
}

@keyframes superToastIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes superToastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-16px) scale(0.9); }
}

.toast-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.toast.success .toast-icon-badge {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.toast.error .toast-icon-badge {
  background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.4);
}

.toast.warning .toast-icon-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.toast.info .toast-icon-badge {
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  line-height: 1.3;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.toast-message {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.45;
}

.toast-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  margin-top: -2px;
  line-height: 1;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.toast-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

/* Прогресс-бар автозакрытия тоста */
.toast-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3.5px;
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  transform-origin: left;
}

.toast-progress-fill {
  height: 100%;
  width: 100%;
  transform-origin: left;
  animation: toastProgress linear forwards;
}

.toast.success .toast-progress-fill { background: linear-gradient(90deg, #34d399, #10b981); }
.toast.error .toast-progress-fill { background: linear-gradient(90deg, #fb7185, #f43f5e); }
.toast.warning .toast-progress-fill { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.toast.info .toast-progress-fill { background: linear-gradient(90deg, #818cf8, #6366f1); }

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* --- СТИЛИ КОЛОКОЛЬЧИКА И ВИДЖЕТА УВЕДОМЛЕНИЙ --- */
.notification-bell-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 4005;
}

.notification-bell-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #475569;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-bell-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: translateY(-1px);
}

.notification-badge-counter,
.admin-badge-counter {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #ff3b30 0%, #dc2626 100%);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", sans-serif;
  line-height: 1;
  min-width: 18px;
  height: 18px;
  padding: 0 4.5px;
  box-sizing: border-box;
  border-radius: 9999px;
  border: 2px solid #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 2px 7px rgba(239, 68, 68, 0.45);
  animation: pulseHeaderBadge 2.4s ease-in-out infinite;
  pointer-events: none;
  z-index: 10;
  letter-spacing: -0.02em;
}

@keyframes pulseHeaderBadge {
  0% {
    transform: scale(1);
    box-shadow: 0 2px 7px rgba(239, 68, 68, 0.45);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 3px 11px rgba(239, 68, 68, 0.65);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 2px 7px rgba(239, 68, 68, 0.45);
  }
}

/* Backdrop Overlay for notifications modal (mobile sheet tap scrim only, disabled on desktop) */
.notifications-backdrop {
  display: none !important;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 10040 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 640px) {
  .notifications-backdrop.active {
    display: block !important;
    opacity: 1;
    pointer-events: auto;
  }
}

/* Grabber handle for mobile sheet */
.notifications-grabber {
  display: none;
  width: 44px;
  height: 5px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.16);
  margin: 10px auto 2px;
  cursor: pointer;
  transition: all 0.16s ease;
  flex-shrink: 0;
}

.notifications-grabber:hover {
  background: rgba(0, 0, 0, 0.28);
  transform: scaleY(1.2);
}

.notifications-grabber:active {
  transform: scale(0.92);
}

/* Выпадающий список уведомлений в стиле Apple Glass */
.notifications-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 424px;
  max-width: calc(100vw - 20px);
  height: 520px;
  min-height: 420px;
  max-height: calc(100vh - 100px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(36px) saturate(200%);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  border-radius: 24px;
  box-shadow: 0 24px 64px -12px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.95);
  display: none;
  flex-direction: column;
  z-index: 5000;
  overflow: hidden;
  box-sizing: border-box;
}

.notifications-dropdown.open {
  display: flex !important;
  animation: dropdownFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.notifications-header {
  padding: 12px 16px 11px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: transparent;
  flex-shrink: 0;
}

.notifications-title-area {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.notif-header-unread-badge {
  background: #007aff;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.35);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notifications-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", sans-serif;
  line-height: 1;
}

.notifications-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.notif-header-btn {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 5px 9px;
  border-radius: 9px;
  transition: all 0.16s ease;
  font-family: inherit;
  letter-spacing: -0.01em;
  white-space: nowrap !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.notif-btn-label {
  display: inline;
}

.notifications-mark-read, .notif-header-read-all {
  color: #007aff;
  background: rgba(0, 122, 255, 0.08);
}

.notifications-mark-read:hover, .notif-header-read-all:hover {
  background: rgba(0, 122, 255, 0.15);
  color: #0056b3;
}

.notifications-delete-all-btn, .notif-clear-btn {
  color: #8e8e93;
  background: transparent;
}

.notifications-delete-all-btn:hover, .notif-clear-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

/* Элегантная кнопка закрытия окна в шапке (Apple Glass) */
.notifications-close-btn {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.04);
  color: #64748b;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  margin-left: 2px;
  flex-shrink: 0;
}

.notifications-close-btn:hover {
  background: rgba(0, 0, 0, 0.09);
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.14);
  transform: scale(1.06);
}

.notifications-close-btn:active {
  transform: scale(0.92);
  background: rgba(0, 0, 0, 0.14);
}

/* Нижний футер скрыт, закрытие окна через Apple-кнопку крестика в шапке и свайп */
.notifications-footer {
  display: none !important;
}

.notifications-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.notifications-scroll-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
  animation: notifCrossFade 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.notifications-scroll-area::-webkit-scrollbar {
  width: 5px;
}

.notifications-scroll-area::-webkit-scrollbar-track {
  background: transparent;
  margin: 6px 0;
}

.notifications-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 9999px;
}

.notifications-scroll-area::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.32);
}

.notification-item {
  padding: 13px 15px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-decoration: none;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.notification-item:hover {
  background: rgba(248, 250, 252, 0.98);
  border-color: rgba(203, 213, 225, 0.95);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.notification-item:active {
  transform: scale(0.985);
}

.notification-item.unread {
  background: linear-gradient(135deg, rgba(238, 245, 255, 0.96) 0%, rgba(255, 255, 255, 0.96) 100%);
  border-color: rgba(199, 210, 254, 0.95);
  box-shadow: 0 4px 16px -2px rgba(99, 102, 241, 0.1);
}

.notification-item.unread:hover {
  background: linear-gradient(135deg, rgba(230, 240, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.notification-title-wrap {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
  gap: 6px;
}

.notif-title-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: #007aff;
  box-shadow: 0 0 6px rgba(0, 122, 255, 0.55);
  flex-shrink: 0;
  display: inline-block;
  margin-top: 5px;
}

.notification-item-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #0f172a;
  line-height: 1.35;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  word-break: break-word;
  overflow-wrap: break-word;
}

.notification-meta-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 8px;
}

.notification-item-time {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

.notification-dismiss-btn {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.07);
  background: rgba(0, 0, 0, 0.04);
  color: #64748b;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  opacity: 0.75;
  pointer-events: auto;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  flex-shrink: 0;
}

.notification-item:hover .notification-dismiss-btn {
  opacity: 1;
}

.notification-dismiss-btn:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.25);
  transform: scale(1.08);
}

.notification-dismiss-btn:active {
  transform: scale(0.92);
  background: rgba(239, 68, 68, 0.2);
}

.notification-item-text {
  font-size: 12.5px;
  color: #475569;
  line-height: 1.45;
  font-weight: 400;
  margin-top: 3px;
  word-break: break-word;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

.notifications-empty {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  text-align: center;
  animation: notifCrossFade 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.notif-empty-card {
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.notif-empty-badge {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.notif-empty-badge:hover {
  transform: scale(1.06);
}

.notif-empty-badge-all {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(5, 150, 105, 0.08) 100%);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.notif-empty-badge-deals {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18) 0%, rgba(37, 99, 235, 0.08) 100%);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.28);
}

.notif-empty-badge-lots {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(217, 119, 6, 0.08) 100%);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.notif-empty-badge-loading {
  background: rgba(142, 142, 147, 0.1);
  color: #007aff;
  border: 1px solid rgba(142, 142, 147, 0.2);
}

.notif-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(0, 122, 255, 0.25);
  border-top-color: #007aff;
  border-radius: 50%;
  animation: notifSpin 0.7s linear infinite;
}

@keyframes notifSpin {
  to { transform: rotate(360deg); }
}

.notif-empty-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  letter-spacing: -0.025em;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
}

.notif-empty-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
  font-weight: 400;
  margin-bottom: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

.notif-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  font-size: 11.5px;
  font-weight: 600;
  color: #059669;
  letter-spacing: -0.01em;
}

.notif-live-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: notifPulse 2s infinite ease-in-out;
}

@keyframes notifPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

@keyframes notifCrossFade {
  from { opacity: 0.65; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Стеклянные иконки уведомлений в стиле Apple SF Symbols */
.notif-icon-circle {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.notification-item:hover .notif-icon-circle {
  transform: scale(1.05);
}

/* 1. На модерации / проверке — янтарно-песочный стеклянный стиль Apple */
.notif-icon-moderation {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(217, 119, 6, 0.08) 100%);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.28);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
}

/* 2. Одобрено / Опубликовано — свежий изумрудный стеклянный стиль */
.notif-icon-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(5, 150, 105, 0.08) 100%);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.28);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.14);
}

/* 3. Новая заявка на бронь / Хотят забрать — небесно-лазурный стеклянный стиль */
.notif-icon-booking {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18) 0%, rgba(2, 132, 199, 0.08) 100%);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.28);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.12);
}

/* 4. Бронь подтверждена / Сделка принята — глубокий сапфировый стиль */
.notif-icon-deal {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18) 0%, rgba(37, 99, 235, 0.08) 100%);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.28);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}

/* 5. Продление срока (+1 день) — индиго / фиолетовый стиль */
.notif-icon-extension {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(79, 70, 229, 0.08) 100%);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.28);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

/* 6. Сделка успешно завершена / Вещь передана — насыщенный мятно-изумрудный */
.notif-icon-completed {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22) 0%, rgba(4, 120, 87, 0.1) 100%);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.32);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.16);
}

/* 7. Отклонение модератором / Замечания — деликатный кораллово-розовый */
.notif-icon-rejected {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.16) 0%, rgba(225, 29, 72, 0.07) 100%);
  color: #e11d48;
  border: 1px solid rgba(244, 63, 94, 0.28);
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.12);
}

/* 8. Архив / Отмена сделки / Истек срок — спокойный дымчато-серый */
.notif-icon-archive {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.2) 0%, rgba(100, 116, 139, 0.08) 100%);
  color: #64748b;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 2px 6px rgba(100, 116, 139, 0.08);
}

/* 9. Отзывы и благодарности — солнечный золотой стиль */
.notif-icon-review {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.08) 100%);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.14);
}

/* 10. Личные сообщения / Чат — мягкий сиренево-фиолетовый */
.notif-icon-chat {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18) 0%, rgba(109, 40, 217, 0.08) 100%);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.28);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.12);
}

/* Системное уведомление по умолчанию */
.notif-icon-default {
  background: rgba(100, 116, 139, 0.08);
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.18);
}

/* --- ВСПЛЫВАЮЩИЙ ТОСТ РИЛТАЙМ УВЕДОМЛЕНИЯ (Toast) --- */
#realtime-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.realtime-toast {
  pointer-events: auto;
  background: #ffffff;
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 15px 35px -5px rgba(15, 23, 42, 0.15), 0 0 1px 1px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 340px;
  max-width: calc(100vw - 48px);
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
  overflow: hidden;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.realtime-toast.closing {
  animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(10px) scale(0.95); }
}

.realtime-toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.realtime-toast-body {
  flex: 1;
  min-width: 0;
}

.realtime-toast-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.realtime-toast-msg {
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
}

.realtime-toast-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.realtime-toast-close:hover {
  color: #0f172a;
}

/* --- Apple Segmented Control: переключатель категорий --- */
.notifications-tabs-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  margin: 8px 14px 6px;
  background: rgba(118, 118, 128, 0.1);
  border-radius: 13px;
  border: none;
  flex-shrink: 0;
}

.notif-tab-chip {
  flex: 1;
  appearance: none;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 0;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: -0.01em;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.notif-tab-chip:hover {
  color: #0f172a;
}

.notif-tab-chip:active {
  transform: scale(0.965);
}

.notif-tab-chip.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08), 0 0.5px 1.5px rgba(0, 0, 0, 0.04);
}

.notif-tab-count {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.06);
  color: #64748b;
}

.notif-tab-chip.active .notif-tab-count {
  background: rgba(0, 122, 255, 0.12);
  color: #007aff;
}

@media (max-width: 640px) {
  .notifications-grabber {
    display: block;
  }

  .notifications-dropdown:not(.open) {
    display: none !important;
  }

  .notifications-dropdown {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: min(76vh, 660px) !important;
    min-height: 440px !important;
    max-height: 86vh !important;
    border-radius: 28px 28px 0 0 !important;
    box-shadow: 0 -12px 48px rgba(15, 23, 42, 0.28) !important;
    backdrop-filter: blur(32px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(32px) saturate(190%) !important;
    background: rgba(255, 255, 255, 0.97) !important;
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    border-bottom: none !important;
    padding-bottom: env(safe-area-inset-bottom, 16px) !important;
    transform: translateY(0);
    z-index: 10050 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }

  .notifications-dropdown.open {
    display: flex !important;
    animation: dropdownSheetUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  @keyframes dropdownSheetUp {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
  }

  .notifications-dropdown.closing {
    animation: dropdownSheetDown 0.22s cubic-bezier(0.4, 0, 1, 1) forwards !important;
  }

  @keyframes dropdownSheetDown {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(100%); }
  }

  .notifications-header {
    padding: 10px 16px 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
  }

  .notifications-title-area {
    min-width: 0 !important;
    flex-shrink: 1 !important;
  }

  .notifications-title {
    font-size: 16px !important;
    letter-spacing: -0.025em !important;
  }

  .notifications-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
  }

  /* На мобильных (смартфонах) скрываем текстовые подписи кнопок, 
     оставляя лаконичные круглые стеклянные кнопки-иконки в стиле Apple SF Symbols.
     Благодаря этому кнопка закрытия никогда не выталкивается за правый край экрана! */
  .notif-btn-label {
    display: none !important;
  }

  .notif-header-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  }

  .notifications-mark-read, .notif-header-read-all {
    background: rgba(0, 122, 255, 0.1) !important;
    border: 1px solid rgba(0, 122, 255, 0.22) !important;
    color: #007aff !important;
  }

  .notifications-delete-all-btn, .notif-clear-btn {
    background: rgba(0, 0, 0, 0.04) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    color: #8e8e93 !important;
  }

  .notifications-close-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.06) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: #1e293b !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin-left: 2px !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
  }

  .notifications-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .notifications-scroll-area {
    padding: 6px 14px 28px !important;
    scrollbar-width: none !important;
  }

  .notifications-scroll-area::-webkit-scrollbar {
    display: none !important;
  }

  .notification-dismiss-btn {
    opacity: 0.9;
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
  }
}
