/* ═══════════════════════════════════════════════════════════
   atr-topbar — Sticky page header row
   Demo: /static/components-demo.html#topbar
   ═══════════════════════════════════════════════════════════ */

.atr-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--atr-topbar-height, 64px);
  padding: 0 16px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--atr-border, #e5e7eb);
  background: var(--ds-surface-raised, #fff);
  position: sticky;
  top: 0;
  z-index: var(--atr-z-topbar, 220);
}

.atr-topbar__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ds-text, #1a1a1a);
  margin: 0;
  flex: 1;
  min-width: 0;
}

.atr-topbar__title i {
  color: var(--atr-accent, #e8622a);
  font-size: 15px;
}

.atr-topbar__leading,
.atr-topbar__trailing {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── Notification Bell ──────────────────────────────────────────────────── */

.notif-bell-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.notif-bell-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 50%;
  background: transparent;
  color: var(--atr-text, #374151);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
  flex-shrink: 0;
  padding: 0;
  outline: none;
}

.notif-bell-btn i {
  font-size: 15px;
  pointer-events: none;
}

.notif-bell-btn:hover {
  background: rgba(0, 0, 0, .05);
  border-color: rgba(0, 0, 0, .14);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.notif-bell-btn:active {
  transform: scale(.93);
  box-shadow: none;
}

.notif-bell-btn:focus-visible {
  outline: 2px solid var(--atr-accent, #e8622a);
  outline-offset: 2px;
}

.notif-bell-btn--has-new {
  color: #e8622a;
}

.notif-bell-btn--has-new i {
  animation: bell-ring .55s ease .3s both;
}

@keyframes bell-ring {
  0%, 100% { transform: rotate(0); }
  15%       { transform: rotate(14deg); }
  30%       { transform: rotate(-11deg); }
  45%       { transform: rotate(8deg); }
  60%       { transform: rotate(-5deg); }
  75%       { transform: rotate(2deg); }
}

/* Badge ------------------------------------------------------------------ */

.notif-bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-sizing: border-box;
  border: 2px solid var(--atr-surface, #fff);
  white-space: nowrap;
}

.notif-bell-badge--pulse {
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, .45); }
  50%       { transform: scale(1.12); box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
}

/* Panel ------------------------------------------------------------------ */

.notif-panel {
  display: none;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-height: 460px;
  background: var(--atr-surface, #fff);
  border: 1px solid var(--atr-border, #e5e7eb);
  border-radius: 14px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, .13), 0 2px 8px rgba(0, 0, 0, .06);
  z-index: 350;
  overflow: hidden;
  animation: notif-panel-in .17s ease;
}

@keyframes notif-panel-in {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);   }
}

.notif-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--atr-border, #e5e7eb);
  gap: 10px;
  flex-shrink: 0;
}

.notif-panel__title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--atr-text, #111827);
}

.notif-panel__title i {
  color: #6366f1;
  font-size: 12px;
}

.notif-panel__mark-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border: 1px solid rgba(99, 102, 241, .22);
  border-radius: 20px;
  background: rgba(99, 102, 241, .06);
  color: #6366f1;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease;
  white-space: nowrap;
  outline: none;
}

.notif-panel__mark-all:hover {
  background: rgba(99, 102, 241, .13);
  border-color: rgba(99, 102, 241, .35);
}

.notif-panel__mark-all:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 1px;
}

.notif-panel__mark-all i {
  font-size: 11px;
}

.notif-panel__body {
  overflow-y: auto;
  flex: 1;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, .12) transparent;
}

.notif-panel__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 44px 20px;
  color: #9ca3af;
  text-align: center;
}

.notif-panel__empty i {
  font-size: 28px;
  opacity: .45;
}

.notif-panel__empty p {
  margin: 0;
  font-size: 13px;
}

/* Notification items ----------------------------------------------------- */

.notif-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 16px;
  cursor: pointer;
  transition: background .12s ease;
  border-bottom: 1px solid rgba(0, 0, 0, .04);
}

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

.notif-item:hover {
  background: rgba(99, 102, 241, .05);
}

.notif-item--new {
  background: rgba(99, 102, 241, .04);
}

.notif-item__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .5px;
  user-select: none;
}

.notif-item__content {
  flex: 1;
  min-width: 0;
}

.notif-item__name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--atr-text, #111827);
  line-height: 1.4;
}

.notif-item__name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.notif-item__new-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 10px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-item__from {
  font-size: 11.5px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.notif-item__from i {
  font-size: 11px;
  margin-right: 3px;
}

.notif-item__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.notif-item__time {
  font-size: 10.5px;
  color: #9ca3af;
  white-space: nowrap;
}

.notif-item__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  display: block;
  flex-shrink: 0;
  animation: shared-dot-pulse 2s ease-in-out infinite;
}

/* Mobile ----------------------------------------------------------------- */

@media (max-width: 500px) {
  .notif-panel {
    width: calc(100vw - 20px);
    right: -4px;
  }
}
