@layer components {

  /* ─── Bell Button ─── */
  .notification-bell {
    position: relative;
    display: flex;
    align-items: center;
  }

  .bell-button {
    position: relative;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 0.5rem;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .bell-button:hover {
    color: var(--accent-primary);
    background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  }

  .bell-button .material-symbols-outlined {
    font-size: 1.35rem;
  }

  /* ─── Badge ─── */
  .bell-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.3rem;
    border-radius: 99px;
    background: var(--neon-teal);
    color: var(--bg-main);
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    animation: badge-pulse 2s ease-in-out infinite;
  }

  @keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--neon-teal) 40%, transparent); }
    50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--neon-teal) 0%, transparent); }
  }

  /* ─── Dropdown Panel ─── */
  .notification-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 22rem;
    max-height: 28rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px color-mix(in srgb, var(--bg-main) 40%, transparent);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .notification-dropdown__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
  }

  .notification-dropdown__title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
  }

  .notification-dropdown__action {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background 0.2s;
  }

  .notification-dropdown__action:hover {
    background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  }

  .notification-dropdown__list {
    overflow-y: auto;
    flex: 1;
    max-height: 20rem;
  }

  .notification-dropdown__empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
  }

  .notification-dropdown__footer {
    display: flex;
    justify-content: center;
    padding: 0.5rem;
    border-top: 1px solid var(--border-color);
  }

  /* ─── Notification Items ─── */
  .notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 50%, transparent);
    background: color-mix(in srgb, var(--accent-primary) 5%, transparent);
    transition: background 0.2s;
  }

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

  .notification-item--read {
    background: transparent;
    opacity: 0.65;
  }

  .notification-item__icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--accent-primary) 15%, transparent);
    color: var(--accent-primary);
  }

  .notification-item__icon .material-symbols-outlined {
    font-size: 1rem;
  }

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

  .notification-item__title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
  }

  .notification-item__message {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 0.15rem;
  }

  .notification-item__time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    opacity: 0.7;
  }

  .notification-item__mark-read {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
  }

  .notification-item__mark-read:hover {
    color: var(--accent-primary);
    background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  }

  .notification-item__mark-read .material-symbols-outlined {
    font-size: 1rem;
  }

  /* ─── Toast Container ─── */
  .toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    pointer-events: none;
  }

  .toast {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px color-mix(in srgb, var(--bg-main) 30%, transparent);
    min-width: 18rem;
    max-width: 24rem;
    pointer-events: auto;
    animation: toast-slide-in 0.35s ease-out;
  }

  .toast--notice {
    border-color: color-mix(in srgb, var(--neon-teal) 40%, transparent);
    background: color-mix(in srgb, var(--neon-teal) 8%, var(--bg-card));
  }

  .toast--notice .toast__icon {
    color: var(--neon-teal);
  }

  .toast--alert {
    border-color: color-mix(in srgb, var(--neon-pink) 40%, transparent);
    background: color-mix(in srgb, var(--neon-pink) 8%, var(--bg-card));
  }

  .toast--alert .toast__icon {
    color: var(--neon-pink);
  }

  .toast__icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    color: var(--accent-primary);
  }

  .toast__message {
    font-size: 0.8rem;
    color: var(--text-main);
    flex: 1;
    line-height: 1.4;
  }

  .toast__close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    transition: color 0.2s;
    flex-shrink: 0;
  }

  .toast__close:hover {
    color: var(--text-main);
  }

  .toast__close .material-symbols-outlined {
    font-size: 1rem;
  }

  /* ─── Toast Animations ─── */
  @keyframes toast-slide-in {
    from {
      transform: translateX(100%);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }

  .toast--dismissing {
    animation: toast-slide-out 0.3s ease-in forwards;
  }

  @keyframes toast-slide-out {
    from {
      transform: translateX(0);
      opacity: 1;
    }
    to {
      transform: translateX(100%);
      opacity: 0;
    }
  }
}
