/* ===== NOTIFICATIONS ===== */
.notif-panel {
  min-width: 340px;
  max-width: 400px;
  padding: 0 !important;
  overflow: hidden;
}

[data-dropdown].is-open > .header-dropdown__menu.notif-panel {
  display: flex;
  flex-direction: column;
}

.notif-panel__header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}
.notif-panel__title {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.notif-panel__title .header-dropdown__badge {
  margin-left: 0;
}

.notif-panel__list {
  max-height: 360px; overflow-y: auto; overscroll-behavior: contain;
}
.notif-panel__empty { padding: 24px 16px !important; }

.notif-panel__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 1px solid var(--color-border);
  background: #fafbfc;
  border-radius: 0 0 12px 12px;
}
.notif-panel__footer--dropdown {
  justify-content: center;
  padding: 12px 16px;
}
.notif-panel__all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-accent);
  background: #fff;
  border: 1px solid var(--color-border);
  transition: background 0.12s, border-color 0.12s;
}
.notif-panel__footer--dropdown .notif-panel__all {
  width: auto;
  min-width: 160px;
}
.notif-panel__all:hover {
  background: #f5f6f8;
  border-color: #d0d4db;
}

.notif-item {
  display: flex; align-items: stretch;
  border-bottom: 1px solid #f0f2f5;
  transition: background 0.1s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item--unread { background: #f8fbff; }
.notif-item--unread .notif-item__text { font-weight: 500; }
.notif-item:hover { background: #f5f6f8; }

.notif-item__link {
  flex: 1; display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 8px 12px 14px; min-width: 0;
}
.notif-item__icon {
  font-size: 18px; line-height: 1; flex-shrink: 0; margin-top: 2px;
}
.notif-item__icon--lg { font-size: 24px; }
.notif-item__body { flex: 1; min-width: 0; }
.notif-item__text {
  display: block; font-size: 13px; line-height: 1.4;
  word-break: break-word;
}
.notif-item__time {
  display: block; font-size: 11px; color: var(--color-text-secondary); margin-top: 4px;
}
.notif-item__delete {
  width: 36px; flex-shrink: 0; color: var(--color-text-secondary);
  font-size: 18px; opacity: 0; transition: opacity 0.12s;
  align-self: center;
}
.notif-item:hover .notif-item__delete,
.notif-item__delete:focus { opacity: 1; }
.notif-item__delete:hover { color: #f43f4a; }

.notifications-page { max-width: 640px; }
.notifications-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.notifications-header h1 { font-size: 22px; font-weight: 600; }
.notifications-header__actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.notif-btn-danger { color: #f43f4a !important; border-color: #fecaca !important; }

.notifications-list {
  background: var(--color-bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow-card); border: 1px solid var(--color-border);
  overflow: hidden;
}
.notif-item--page .notif-item__link { padding: 14px 8px 14px 16px; }
.notif-item--page .notif-item__text { font-size: 14px; }
.notif-item--page .notif-item__delete { opacity: 1; width: 44px; }

@media (max-width: 767px) {
  /* Full-screen dim behind the sheet */
  .notif-sheet-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
  }
  body.notif-sheet-open .notif-sheet-backdrop {
    display: block;
  }

  /* Mobile notification sheet — fixed to the real viewport */
  body.notif-sheet-open .header-dropdown__menu.notif-panel,
  .header-dropdown__menu.notif-panel.notif-panel--sheet {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: calc(var(--tabbar-height) + 16px + env(safe-area-inset-bottom, 0px)) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: min(72vh, 560px) !important;
    height: min(72dvh, 560px) !important;
    max-height: min(72vh, 560px) !important;
    max-height: min(72dvh, 560px) !important;
    min-height: 280px !important;
    margin: 0 !important;
    transform: none !important;
    z-index: 1001 !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    padding: 0 !important;
  }

  body.notif-sheet-open .notif-panel__header,
  body.notif-sheet-open .notif-panel__footer,
  .notif-panel--sheet .notif-panel__header,
  .notif-panel--sheet .notif-panel__footer {
    flex-shrink: 0;
  }

  body.notif-sheet-open .notif-panel__list,
  .notif-panel--sheet .notif-panel__list {
    flex: 1 1 auto;
    min-height: 120px;
    max-height: none !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.notif-sheet-open {
    overflow: hidden;
  }

  .notif-item__delete { opacity: 1; }
  .notifications-header { flex-direction: column; }
  .notifications-header__actions { width: 100%; }
  .notifications-header__actions .profile-btn { flex: 1; justify-content: center; }
}
