/* UPA — Notifications: bell, dropdown, list/items, toast */

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

body.upa-page .upa-notif-bell {
  position: relative;
}

body.upa-page .upa-notif-bell__btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid #dbe4ef;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

body.upa-page .upa-notif-bell__btn:hover {
  background: #f1f5f9;
  color: #1e40af;
}

body.upa-page .upa-notif-bell__badge {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--upa-danger, #cf334d);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
  pointer-events: none;
}

body.upa-page .upa-notif-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 200;
  width: 22rem;
  max-height: 28rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #dbe4ef;
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  scrollbar-width: thin;
  scrollbar-color: var(--upa-border) transparent;
}

body.upa-page .upa-notif-dropdown::-webkit-scrollbar {
  width: 6px;
}

body.upa-page .upa-notif-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

body.upa-page .upa-notif-dropdown::-webkit-scrollbar-thumb {
  background: var(--upa-border);
  border-radius: 3px;
}

body.upa-page .upa-notif-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--upa-muted);
}

body.upa-page .upa-notif-dropdown__header {
  padding: 0.75rem 1rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #7488a3;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid #f1f5f9;
}

body.upa-page .upa-notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.upa-page .upa-notif-item {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #f1f5f9;
}

body.upa-page .upa-notif-item__link {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 1rem;
  border-bottom: none;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}

body.upa-page .upa-notif-item__dismiss {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  background: transparent;
  border: none;
  border-left: 1px solid #f1f5f9;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s, color 0.12s;
}

body.upa-page .upa-notif-item__dismiss:hover {
  background: #fef2f2;
  color: #ef4444;
}

body.upa-page .upa-notif-item__dismiss svg {
  width: 0.85rem;
  height: 0.85rem;
}

body.upa-page .upa-notif-item__link:hover {
  background: #f8fafc;
}

body.upa-page .upa-notif-item__title {
  font-size: 0.85rem;
  font-weight: 500;
  color: #1e293b;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

body.upa-page .upa-notif-item__tag {
  align-self: flex-start;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  background: #eef2ff;
  color: #3554a6;
}

body.upa-page .upa-notif-item__tag--client {
  background: #fef2f2;
  color: #b4233a;
}

body.upa-page .upa-notif-item__tag--support {
  background: #f0fdf4;
  color: #16834a;
}

body.upa-page .upa-notif-item__tag--system {
  background: #eef2ff;
  color: #3554a6;
}

body.upa-page .upa-notif-item__time {
  font-size: 0.72rem;
  color: #94a3b8;
}

body.upa-page .upa-notif-empty {
  padding: 1.2rem 1rem;
  text-align: center;
  font-size: 0.83rem;
  color: #94a3b8;
  margin: 0;
}

/* ── Toast Notifications ──────────────────────────────────────────────────── */

.upa-toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 22rem;
  pointer-events: none;
}

.upa-toast {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.6rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
  font-size: 0.85rem;
  color: #1e293b;
  pointer-events: auto;
  animation: upa-toast-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.upa-toast--success {
  border-left: 3px solid var(--upa-success, #1b9c67);
}

.upa-toast--success .upa-toast__icon {
  color: var(--upa-success, #1b9c67);
}

.upa-toast--failure {
  border-left: 3px solid var(--upa-danger, #cf334d);
}

.upa-toast--failure .upa-toast__icon {
  color: var(--upa-danger, #cf334d);
}

.upa-toast--warning {
  border-left: 3px solid var(--upa-warning, #b7791f);
}

.upa-toast--warning .upa-toast__icon {
  color: var(--upa-warning, #b7791f);
}

.upa-toast__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.upa-toast__message {
  flex: 1;
  line-height: 1.4;
}

.upa-toast__dismiss {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 0.35rem;
  padding: 0;
  transition: background 0.12s, color 0.12s;
}

.upa-toast__dismiss:hover {
  background: #f1f5f9;
  color: #475569;
}

.upa-toast--hiding {
  animation: upa-toast-out 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes upa-toast-in {
  from {
    opacity: 0;
    transform: translateX(calc(100% + 1.5rem));
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes upa-toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
    max-height: 6rem;
    margin-bottom: 0;
  }
  to {
    opacity: 0;
    transform: translateX(calc(100% + 1.5rem));
    max-height: 0;
    margin-bottom: -0.5rem;
  }
}
