/* ===== Notification System v2 ===== */

/* ── Header bell badge ─────────────────────────────────────── */
.header-notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
  transform: scale(0);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.header-notif-badge.visible {
  transform: scale(1);
}

.header-notif-badge:empty {
  display: none;
}

@keyframes notifBadgeBounce {
  0% {
    transform: scale(1);
  }

  30% {
    transform: scale(1.4);
  }

  60% {
    transform: scale(0.9);
  }

  100% {
    transform: scale(1);
  }
}

/* ── Dropdown Menu ─────────────────────────────────────────── */
.notif-dropdown-menu {
  position: absolute;
  right: -80px;
  top: calc(100% + 10px);
  width: 380px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, rgba(226, 232, 240, 0.8));
  box-shadow: 0 20px 48px -8px rgba(2, 6, 23, 0.16), 0 8px 16px -4px rgba(2, 6, 23, 0.06);
  transform-origin: top right;
  z-index: 10010;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95) translateY(-8px);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
  pointer-events: none;
}

.notif-dropdown-menu::before {
  content: '';
  position: absolute;
  right: 22px;
  top: -6px;
  width: 12px;
  height: 12px;
  background: var(--surface, #ffffff);
  border-left: 1px solid var(--border, rgba(226, 232, 240, 0.8));
  border-top: 1px solid var(--border, rgba(226, 232, 240, 0.8));
  transform: rotate(45deg);
  border-radius: 3px 0 0 0;
  z-index: 1;
}

.notif-dropdown.open .notif-dropdown-menu,
.notif-dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.theme-dark .notif-dropdown-menu {
  background: var(--surface-elevated, #1e293b);
  border-color: var(--border-strong, rgba(148, 163, 184, 0.22));
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.6), 0 12px 24px -6px rgba(0, 0, 0, 0.4);
}

.theme-dark .notif-dropdown-menu::before {
  background: var(--surface-elevated, #1e293b);
  border-left-color: var(--border-strong, rgba(148, 163, 184, 0.22));
  border-top-color: var(--border-strong, rgba(148, 163, 184, 0.22));
}

/* ── Header ────────────────────────────────────────────────── */
.notif-modal-header {
  position: relative;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border, rgba(226, 232, 240, 0.8));
  flex-shrink: 0;
  background: transparent;
  z-index: 2;
  /* Above the ::before arrow */
}

.theme-dark .notif-modal-header {
  border-bottom-color: rgba(148, 163, 184, 0.12);
}

.notif-modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.notif-modal-title-row h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--text, #0f172a);
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-modal-title-row h3 i {
  color: #0ea5e9;
  font-size: 18px;
}

.notif-modal-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
}

.notif-modal-count:empty {
  display: none;
}

/* ── Filter tabs ───────────────────────────────────────────── */
.notif-modal-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}

.notif-modal-filters::-webkit-scrollbar {
  display: none;
}

.notif-filter-btn {
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
  color: var(--muted, #64748b);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.theme-dark .notif-filter-btn {
  background: rgba(255, 255, 255, 0.04);
}

.notif-filter-btn:hover {
  background: rgba(14, 165, 233, 0.08);
  color: #0ea5e9;
}

.notif-filter-btn.active {
  background: #f0f9ff;
  color: #0284c7;
  border-color: #bae6fd;
}

.theme-dark .notif-filter-btn.active {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border-color: rgba(14, 165, 233, 0.25);
}

/* ── Body / list ───────────────────────────────────────────── */
.notif-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  max-height: 420px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

.theme-dark .notif-modal-body {
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.notif-modal-body::-webkit-scrollbar {
  width: 5px;
}

.notif-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.notif-modal-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

/* ── Loading state ─────────────────────────────────────────── */
.notif-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 50px 20px;
  color: var(--muted, #64748b);
  font-size: 13.5px;
  font-weight: 600;
}

.notif-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(14, 165, 233, 0.15);
  border-top-color: #0ea5e9;
  border-radius: 50%;
  animation: notifSpin 0.7s linear infinite;
}

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

/* ── Empty state ───────────────────────────────────────────── */
.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 50px 20px;
  text-align: center;
}

.notif-empty i {
  font-size: 36px;
  color: rgba(14, 165, 233, 0.2);
}

.notif-empty span {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted, #64748b);
}

/* ── Notification item ─────────────────────────────────────── */
.notif-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding: 14px;
  border-radius: 14px;
  background: transparent;
  transition: background 0.15s ease, transform 0.15s ease;
  animation: notifItemIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  margin-bottom: 2px;
}

@keyframes notifItemIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notif-item:hover {
  background: rgba(0, 0, 0, 0.02);
}

.theme-dark .notif-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.notif-item.clickable {
  cursor: pointer;
}

.notif-item.clickable:active {
  transform: scale(0.98);
}

.notif-item.unread {
  background: #f0f9ff;
}

.theme-dark .notif-item.unread {
  background: rgba(14, 165, 233, 0.08);
}

/* Left side: Icon or Avatar */
.notif-item-left {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  margin-right: 14px;
}

.notif-actor-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.theme-dark .notif-actor-avatar {
  border-color: rgba(255, 255, 255, 0.05);
}

.notif-avatar-fallback {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.theme-dark .notif-avatar-fallback {
  background: linear-gradient(135deg, #334155, #1e293b);
  color: #94a3b8;
}

.notif-item-type-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border: 2px solid var(--surface, #fff);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.theme-dark .notif-item-type-badge {
  border-color: var(--surface-elevated, #1e293b);
}

.notif-item-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  margin-right: 14px;
}

/* Content */
.notif-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.notif-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #0f172a);
  line-height: 1.35;
}

.notif-item-body {
  font-size: 13px;
  color: var(--muted, #64748b);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-item-time {
  font-size: 11.5px;
  color: var(--muted, #94a3b8);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

/* Footer / View all */
.notif-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border, rgba(226, 232, 240, 0.8));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.015);
  border-radius: 0 0 16px 16px;
}

.theme-dark .notif-modal-footer {
  border-top-color: rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.015);
}

.notif-modal-mark-all {
  border: none;
  background: transparent;
  color: var(--muted, #64748b);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.notif-modal-mark-all:hover {
  background: rgba(14, 165, 233, 0.1);
  color: #0ea5e9;
}

.notif-modal-view-all {
  color: #0ea5e9;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  padding: 6px 10px;
  border-radius: 8px;
}

.notif-modal-view-all:hover {
  background: rgba(14, 165, 233, 0.1);
  gap: 8px;
  /* Slight arrow push effect */
}

.notif-modal-view-all i {
  font-size: 12px;
}

/* ── Item actions ──────────────────────────────────────────── */
.notif-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: flex-start;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.notif-item:hover .notif-item-actions {
  opacity: 1;
}

.notif-action-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--muted, #94a3b8);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.theme-dark .notif-action-btn {
  background: rgba(255, 255, 255, 0.05);
}

.notif-action-btn:hover {
  background: rgba(14, 165, 233, 0.12);
  color: #0ea5e9;
  transform: scale(1.05);
}

.notif-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

/* ── Item icon ─────────────────────────────────────────────── */
.notif-item-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.notif-item-icon.type-like {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.notif-item-icon.type-comment {
  background: rgba(14, 165, 233, 0.1);
  color: #0ea5e9;
}

.notif-item-icon.type-reply {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.notif-item-icon.type-repost {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.notif-item-icon.type-friend_request {
  background: rgba(6, 182, 212, 0.1);
  color: #06b6d4;
}

.notif-item-icon.type-friend_accept {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.notif-item-icon.type-chat {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.notif-item-icon.type-mention {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.notif-item-icon.type-deadline {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.notif-item-icon.type-schedule {
  background: rgba(14, 165, 233, 0.1);
  color: #0ea5e9;
}

.notif-item-icon.type-grade {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.notif-item-icon.type-achievement {
  background: rgba(234, 179, 8, 0.1);
  color: #ca8a04;
}

.notif-item-icon.type-system {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
}

.notif-item-icon.type-premium {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.notif-item-icon.type-ai {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.notif-item-icon.type-channel {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.notif-item-icon.type-challenge {
  background: rgba(236, 72, 153, 0.1);
  color: #ec4899;
}

.notif-item-icon.type-smartcloud {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.notif-item-icon.type-group {
  background: rgba(14, 165, 233, 0.1);
  color: #0ea5e9;
}

/* ── Item content ──────────────────────────────────────────── */
.notif-item-content {
  flex: 1;
  min-width: 0;
}

.notif-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #1e293b);
  line-height: 1.3;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-item-body {
  font-size: 13px;
  color: var(--muted, #64748b);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-item-time {
  font-size: 11px;
  color: var(--muted, #94a3b8);
  margin-top: 4px;
}

.notif-item-priority {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.notif-item-priority.high {
  background: #ef4444;
}

.notif-item-priority.normal {
  background: #f59e0b;
}

/* ── Item actions ──────────────────────────────────────────── */
.notif-item-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  align-items: flex-start;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.notif-item:hover .notif-item-actions {
  opacity: 1;
}

.notif-action-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted, #94a3b8);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.notif-action-btn:hover {
  background: rgba(14, 165, 233, 0.08);
  color: #0ea5e9;
}

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

/* ── Footer ────────────────────────────────────────────────── */
.notif-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.06));
  flex-shrink: 0;
}

.notif-modal-mark-all {
  border: none;
  background: transparent;
  color: var(--muted, #64748b);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.notif-modal-mark-all:hover {
  background: rgba(34, 197, 94, 0.08);
  color: #16a34a;
}

.notif-modal-view-all {
  font-size: 13px;
  font-weight: 600;
  color: #0ea5e9;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.notif-modal-view-all:hover {
  background: rgba(14, 165, 233, 0.06);
}

/* ===== Notifications Page ===== */
.notif-page {
  max-width: 800px;
  margin: 0 auto;
}

.notif-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.notif-page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text, #1e293b);
  display: flex;
  align-items: center;
  gap: 10px;
}

.notif-page-title i {
  color: #0ea5e9;
}

.notif-page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Page filter bar */
.notif-page-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.notif-page-filters::-webkit-scrollbar {
  display: none;
}

.notif-page-filter {
  padding: 8px 16px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--muted, #64748b);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-page-filter:hover {
  border-color: #0ea5e9;
  color: #0ea5e9;
}

.notif-page-filter.active {
  background: rgba(14, 165, 233, 0.08);
  border-color: #0ea5e9;
  color: #0284c7;
}

/* Page notification card */
.notif-page-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(0, 0, 0, 0.06));
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

.notif-page-card+.notif-page-card {
  margin-top: 8px;
}

.notif-page-card:hover {
  border-color: rgba(14, 165, 233, 0.2);
  box-shadow: 0 2px 12px rgba(14, 165, 233, 0.06);
}

.notif-page-card.unread {
  background: rgba(14, 165, 233, 0.03);
  border-color: rgba(14, 165, 233, 0.12);
}

.notif-page-card.unread::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0ea5e9;
}

.notif-page-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.notif-page-card-content {
  flex: 1;
  min-width: 0;
}

.notif-page-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #1e293b);
  line-height: 1.3;
  margin-bottom: 4px;
}

.notif-page-card-body {
  font-size: 13.5px;
  color: var(--muted, #64748b);
  line-height: 1.4;
  margin-bottom: 6px;
}

.notif-page-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted, #94a3b8);
}

.notif-page-card-type {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(14, 165, 233, 0.06);
  font-weight: 600;
  font-size: 11px;
}

.notif-page-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: flex-start;
}

/* Settings section on page */
.notif-settings-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(0, 0, 0, 0.06));
  border-radius: 16px;
  padding: 24px;
  margin-top: 32px;
}

.notif-settings-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #1e293b);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-settings-title i {
  color: #0ea5e9;
}

.notif-settings-group {
  margin-bottom: 20px;
}

.notif-settings-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.notif-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.04));
}

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

.notif-settings-label {
  font-size: 14px;
  color: var(--text, #1e293b);
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-settings-label i {
  width: 20px;
  text-align: center;
  font-size: 14px;
}

/* Toggle switch */
.notif-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.notif-toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: var(--border, #cbd5e1);
  cursor: pointer;
  transition: background 0.2s ease;
}

.notif-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.notif-toggle input:checked+.notif-toggle-track {
  background: #0ea5e9;
}

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

/* Quiet hours */
.notif-quiet-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-left: 28px;
}

.notif-quiet-row input[type="time"] {
  padding: 6px 10px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.1));
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface, #fff);
  color: var(--text, #1e293b);
}

.notif-quiet-row span {
  font-size: 13px;
  color: var(--muted, #64748b);
}

/* Priority select */
.notif-priority-select {
  padding: 6px 12px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.1));
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface, #fff);
  color: var(--text, #1e293b);
  cursor: pointer;
}

/* Save button */
.notif-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 16px;
}

.notif-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3);
}

.notif-save-status {
  font-size: 13px;
  color: var(--muted, #64748b);
  margin-left: 12px;
  transition: opacity 0.2s ease;
}

.notif-save-status.success {
  color: #22c55e;
}

.notif-save-status.error {
  color: #ef4444;
}

/* ===== Dark theme ===== */
.theme-dark .notif-modal-overlay {
  background: rgba(0, 0, 0, 0.55);
}

.theme-dark .notif-modal {
  background: var(--surface, #1e293b);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.theme-dark .notif-modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
}

.theme-dark .notif-item:hover,
.theme-dark .notif-item.unread {
  background: rgba(14, 165, 233, 0.08);
}

.theme-dark .notif-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

.theme-dark .notif-page-card {
  background: var(--surface, #1e293b);
  border-color: rgba(255, 255, 255, 0.06);
}

.theme-dark .notif-page-card:hover {
  border-color: rgba(14, 165, 233, 0.25);
}

.theme-dark .notif-page-card.unread {
  background: rgba(14, 165, 233, 0.06);
}

.theme-dark .notif-settings-card {
  background: var(--surface, #1e293b);
  border-color: rgba(255, 255, 255, 0.06);
}

.theme-dark .notif-toggle-track {
  background: rgba(255, 255, 255, 0.15);
}

.theme-dark .notif-toggle-track::after {
  background: #e2e8f0;
}

.theme-dark .notif-action-btn:hover {
  background: rgba(14, 165, 233, 0.12);
}

.theme-dark .notif-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.12);
}

/* ===== Mobile (≤ 640px) ===== */
@media (max-width: 640px) {

  /* Modal → bottom sheet */
  .notif-modal-overlay {
    align-items: flex-end;
  }

  .notif-modal {
    width: 100vw;
    max-width: 100%;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }

  .notif-modal-overlay.open .notif-modal {
    transform: translateY(0);
  }

  .notif-modal-header {
    padding: 16px 16px 10px;
  }

  .notif-modal-header::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.12);
    margin: 0 auto 12px;
  }

  .notif-modal-title-row {
    margin-bottom: 10px;
  }

  .notif-modal-title-row h3 {
    font-size: 16px;
  }

  .notif-modal-filters {
    gap: 3px;
  }

  .notif-filter-btn {
    padding: 5px 12px;
    font-size: 12px;
  }

  .notif-modal-body {
    padding: 6px 10px;
  }

  .notif-item {
    padding: 10px;
    border-radius: 10px;
    gap: 10px;
  }

  .notif-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 14px;
  }

  .notif-item-left {
    width: 36px;
    height: 36px;
  }

  .notif-actor-avatar {
    width: 36px;
    height: 36px;
  }

  .notif-item-title {
    font-size: 13px;
  }

  .notif-item-body {
    font-size: 12px;
  }

  .notif-item-time {
    font-size: 10px;
  }

  .notif-item-actions {
    opacity: 1;
  }

  .notif-modal-footer {
    padding: 10px 16px;
  }

  .notif-modal-close {
    top: 12px;
    right: 12px;
  }

  /* Page layout */
  .notif-page {
    max-width: 100%;
    padding: 0;
  }

  .notif-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
  }

  .notif-page-title {
    font-size: 20px;
    gap: 8px;
  }

  .notif-page-title i {
    font-size: 20px;
  }

  .notif-page-actions {
    width: 100%;
  }

  .notif-page-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Filters — horizontal scroll */
  .notif-page-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 14px;
    gap: 6px;
    padding-bottom: 2px;
  }

  .notif-page-filters::-webkit-scrollbar {
    display: none;
  }

  .notif-page-filter {
    padding: 7px 12px;
    font-size: 12px;
    flex-shrink: 0;
    border-radius: 8px;
  }

  /* Cards */
  .notif-page-card {
    padding: 12px;
    border-radius: 12px;
    gap: 10px;
  }

  .notif-page-card+.notif-page-card {
    margin-top: 6px;
  }

  .notif-page-card-icon {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .notif-page-card-title {
    font-size: 13.5px;
  }

  .notif-page-card-body {
    font-size: 12.5px;
  }

  .notif-page-card-meta {
    font-size: 11px;
    gap: 6px;
    flex-wrap: wrap;
  }

  .notif-page-card-actions {
    opacity: 1;
  }

  .notif-page-card-actions .notif-action-btn {
    width: 32px;
    height: 32px;
  }

  /* Settings */
  .notif-settings-card {
    padding: 16px;
    border-radius: 14px;
    margin-top: 20px;
  }

  .notif-settings-title {
    font-size: 16px;
    margin-bottom: 16px;
  }

  .notif-settings-group {
    margin-bottom: 16px;
  }

  .notif-settings-group-title {
    font-size: 11px;
    margin-bottom: 10px;
  }

  .notif-settings-row {
    padding: 8px 0;
  }

  .notif-settings-label {
    font-size: 13px;
    gap: 6px;
  }

  .notif-settings-label i {
    font-size: 13px;
    width: 18px;
  }

  .notif-toggle {
    width: 40px;
    height: 22px;
  }

  .notif-toggle-track::after {
    width: 18px;
    height: 18px;
  }

  .notif-toggle input:checked+.notif-toggle-track::after {
    transform: translateX(18px);
  }

  .notif-quiet-row {
    padding-left: 24px;
    gap: 6px;
  }

  .notif-quiet-row input[type="time"] {
    padding: 5px 8px;
    font-size: 12px;
  }

  .notif-priority-select {
    padding: 5px 10px;
    font-size: 12px;
  }

  .notif-save-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 14px;
    border-radius: 12px;
  }

  .notif-save-status {
    display: block;
    text-align: center;
    margin-left: 0;
    margin-top: 8px;
  }

  /* Empty state */
  .notif-empty {
    padding: 32px 16px;
  }

  .notif-empty i {
    font-size: 30px;
  }

  .notif-empty span {
    font-size: 13px;
  }
}

/* ===== Dark theme mobile ===== */
@media (max-width: 640px) {
  .theme-dark .notif-modal-header::before {
    background: rgba(255, 255, 255, 0.12);
  }

  .theme-dark .notif-page-card-actions .notif-action-btn {
    background: rgba(255, 255, 255, 0.04);
  }
}