.tb-actions { position: relative; display: flex; align-items: center; gap: 10px; }
.tb-actions > .icon-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--muted); transition: .16s; background: transparent; border: 0; cursor: pointer; text-decoration: none; }
.tb-actions > .icon-btn:hover { background: var(--soft); color: var(--green-dark); }
.tb-actions > .icon-btn svg { display: block; }

.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: #ef4444; color: #fff; border-radius: 99px;
  font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px #fff; pointer-events: none;
}
.notif-badge[hidden] { display: none !important; }

.notif-dropdown-popover {
  position: absolute; right: 0; top: calc(100% + 10px); width: 340px;
  background: #fff; border: 1px solid var(--line, #e6e8ee); border-radius: 16px;
  box-shadow: 0 18px 48px rgba(11,25,48,.18); z-index: 99; overflow: hidden;
  animation: notifPopIn .18s ease; text-align: left;
}
@keyframes notifPopIn { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:none} }
.notif-dropdown-popover[hidden] { display: none !important; }

.notif-popover-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line, #e6e8ee); background: #fafbfc; }
.notif-popover-head strong { font-size: 15px; color: var(--ink, #151b2b); }
.notif-btn-read { border: 0; background: transparent; color: var(--green, #2563eb); font-size: 12px; font-weight: 700; cursor: pointer; padding: 0; }
.notif-btn-read:hover { text-decoration: underline; }

.notif-popover-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; }
.notif-item { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line, #e6e8ee); text-decoration: none; color: inherit; transition: .15s; }
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #f0f7ff; }
.notif-item-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; background: #e0f2fe; }
.notif-item-icon.warn { background: #fef3c7; color: #d97706; }
.notif-item-icon.danger { background: #fee2e2; color: #dc2626; }
.notif-item-body { min-width: 0; flex: 1; font-size: 13px; }
.notif-item-title { font-weight: 750; color: var(--ink, #151b2b); margin-bottom: 2px; }
.notif-item-desc { color: var(--muted, #6d7280); font-size: 12px; line-height: 1.45; word-break: break-word; }
.notif-item-time { font-size: 11px; color: #94a3b8; margin-top: 4px; display: block; }

.notif-popover-foot { padding: 12px 16px; text-align: center; border-top: 1px solid var(--line, #e6e8ee); background: #fafbfc; }
.notif-popover-foot a { color: var(--green, #2563eb); font-size: 13px; font-weight: 700; text-decoration: none; }
.notif-popover-foot a:hover { text-decoration: underline; }

.notif-empty { padding: 32px 16px; text-align: center; color: var(--muted, #6d7280); font-size: 13px; }

@media (max-width: 767px) {
  #notifDropdownPopover {
    position: fixed;
    top: 72px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 84px);
    max-height: calc(100dvh - 84px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 99;
  }

  #notifDropdownPopover .notif-popover-head {
    flex: 0 0 auto;
    gap: 12px;
    min-width: 0;
    padding: 12px 14px;
  }

  #notifDropdownPopover .notif-popover-head strong {
    flex: 1 1 auto;
    min-width: 0;
  }

  #notifDropdownPopover .notif-btn-read {
    flex: 0 1 auto;
    line-height: 1.35;
    text-align: right;
    white-space: normal;
  }

  #notifDropdownPopover .notif-popover-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  #notifDropdownPopover .notif-item {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
  }

  #notifDropdownPopover .notif-item-icon {
    flex: 0 0 auto;
  }

  #notifDropdownPopover .notif-item-body {
    flex: 1 1 auto;
    min-width: 0;
  }

  #notifDropdownPopover .notif-item-title,
  #notifDropdownPopover .notif-item-desc,
  #notifDropdownPopover .notif-item-time {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  #notifDropdownPopover .notif-popover-foot {
    flex: 0 0 auto;
    padding: 0;
  }

  #notifDropdownPopover .notif-popover-foot a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    text-align: center;
    overflow-wrap: anywhere;
  }
}
