/* HADAFIN header notification bell */
@keyframes hadafin-notif-badge-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.55); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(255, 0, 0, 0); }
}
@keyframes hadafin-notif-bell-shake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-12deg); }
  40% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(8deg); }
}
@keyframes hadafin-notif-toast-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.header-user-cluster {
  position: relative;
  z-index: 10070;
}
.hadafin-notif-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 10070;
}
.hadafin-notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1);
}
.hadafin-notif-btn:hover {
  background: #fff7f7;
  border-color: #ff0000;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255, 0, 0, 0.18);
}
.hadafin-notif-btn.has-unread {
  border-color: #ff0000;
  background: #fff5f5;
  animation: hadafin-notif-bell-shake 2.4s ease-in-out infinite;
}
.hadafin-notif-btn.has-unread .ti {
  color: #ff0000;
}
.hadafin-notif-btn[aria-expanded="true"] {
  background: #fff;
  border-color: #ff0000;
  box-shadow: 0 0 0 4px rgba(255, 0, 0, 0.2);
  animation: none;
}
.hadafin-notif-btn .ti {
  font-size: 1.32rem;
  line-height: 1;
  font-weight: 700;
  color: #0f172a;
}
.hadafin-notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.24rem;
  border-radius: 999px;
  background: #ff0000;
  color: #fff;
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1.2rem;
  text-align: center;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 10px rgba(255, 0, 0, 0.55);
  animation: hadafin-notif-badge-pulse 1.5s ease-in-out infinite;
}
.hadafin-notif-badge:empty,
.hadafin-notif-badge[data-count="0"] {
  display: none;
}
.hadafin-notif-panel {
  position: fixed;
  width: min(380px, calc(100vw - 1rem));
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.95rem;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.32);
  z-index: 20050;
  overflow: hidden;
}
.hadafin-notif-panel.hidden { display: none !important; }
.hadafin-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(180deg, #fff7f7, #fff);
}
.hadafin-notif-head h3 {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 900;
  color: #0f172a;
}
.hadafin-notif-mark-all {
  border: 0;
  background: transparent;
  color: #ff0000;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 0.35rem;
}
.hadafin-notif-mark-all:hover { background: #fff1f1; }
.hadafin-notif-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.hadafin-notif-tab {
  border: 0;
  background: transparent;
  padding: 0.58rem 0.25rem;
  font-size: 0.64rem;
  font-weight: 750;
  color: #64748b;
  cursor: pointer;
  position: relative;
  line-height: 1.2;
}
.hadafin-notif-tab.is-active {
  color: #0f172a;
  font-weight: 900;
}
.hadafin-notif-tab.is-active::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: #ff0000;
}
.hadafin-notif-tab-count {
  display: block;
  font-size: 0.6rem;
  font-weight: 900;
  color: #ff0000;
  margin-top: 0.1rem;
}
.hadafin-notif-tab-count:empty,
.hadafin-notif-tab-count[data-count="0"] { display: none; }
.hadafin-notif-list {
  max-height: min(380px, 55vh);
  overflow-y: auto;
  padding: 0.4rem;
  background: #fff;
}
.hadafin-notif-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 0.65rem;
  padding: 0.65rem 0.7rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
}
.hadafin-notif-item:hover { background: #f8fafc; }
.hadafin-notif-item.is-unread {
  background: #fff5f5;
  border-left: 3px solid #ff0000;
}
.hadafin-notif-item.is-unread:hover { background: #ffe8e8; }
.hadafin-notif-item-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}
.hadafin-notif-item-body {
  margin-top: 0.15rem;
  font-size: 0.68rem;
  color: #475569;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hadafin-notif-item-meta {
  margin-top: 0.25rem;
  font-size: 0.6rem;
  font-weight: 700;
  color: #94a3b8;
}
.hadafin-notif-empty,
.hadafin-notif-guest {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: #64748b;
}
.hadafin-notif-guest a {
  color: #ff0000;
  font-weight: 800;
  text-decoration: none;
}
.hadafin-notif-guest a:hover { text-decoration: underline; }
.hadafin-notif-loading {
  padding: 1.25rem;
  text-align: center;
  font-size: 0.72rem;
  color: #94a3b8;
}

.hadafin-notif-toast {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 20100;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: min(320px, calc(100vw - 2rem));
  padding: 0.75rem 0.9rem;
  border: 2px solid #ff0000;
  border-radius: 0.85rem;
  background: #fff;
  box-shadow: 0 18px 40px rgba(255, 0, 0, 0.28);
  cursor: pointer;
  opacity: 0;
  transform: translateY(-12px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.hadafin-notif-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: hadafin-notif-toast-in 0.28s ease;
}
.hadafin-notif-toast-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #ff0000;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hadafin-notif-toast-icon .ti { font-size: 1.1rem; }
.hadafin-notif-toast-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  text-align: left;
}
.hadafin-notif-toast-copy strong {
  font-size: 0.78rem;
  color: #0f172a;
}
.hadafin-notif-toast-copy span {
  font-size: 0.68rem;
  color: #ff0000;
  font-weight: 700;
}

body.home-marketplace .hadafin-notif-btn {
  border-color: #cbd5e1;
}

.hadafin-notif-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 0 0 14px 14px;
}
.hadafin-notif-foot a {
  font-size: 0.72rem;
  font-weight: 800;
  color: #0f766e;
  text-decoration: none;
}
.hadafin-notif-foot a:hover { text-decoration: underline; }
