/* ═══ ALP Notifications ═══ */
.notif-bell{position:relative;display:inline-flex;margin-left:8px}
.notif-controls{display:inline-flex;align-items:center;gap:4px;margin-left:12px}
.notif-bell-btn{position:relative;font-size:18px!important;padding:4px 6px!important}
.notif-controls .btn-icon{font-size:16px;padding:4px 6px}
.notif-bell-icon{display:inline-block;transition:transform .2s}
.notif-bell-btn:hover .notif-bell-icon{transform:rotate(15deg)}
.notif-badge{position:absolute;top:-4px;right:-6px;background:#dc2626;color:#fff;font-size:10px;font-weight:700;min-width:18px;height:18px;line-height:18px;text-align:center;border-radius:9px;padding:0 4px;pointer-events:none;animation:notif-pop .3s ease}
@keyframes notif-pop{0%{transform:scale(0)}50%{transform:scale(1.3)}100%{transform:scale(1)}}

.notif-dropdown{position:fixed;top:52px;left:240px;width:380px;max-width:calc(100vw - 16px);max-height:500px;background:var(--bg2,#fff);border:1px solid var(--border,#dee2e6);border-radius:12px;box-shadow:0 8px 32px rgba(0,0,0,.15);z-index:1001;display:none;flex-direction:column;overflow:hidden}
.notif-dropdown.open{display:flex}
@media(max-width:1024px){.notif-dropdown{max-height:70vh}}

.notif-header{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid var(--border-subtle,#e9ecef);gap:8px}
.notif-title{font-size:14px;font-weight:700;flex:1}
.notif-settings-btn{background:none;border:none;cursor:pointer;font-size:14px;padding:4px 6px;border-radius:4px;opacity:.6;transition:opacity .2s}
.notif-settings-btn:hover{opacity:1}
.notif-mark-all{font-size:11px;color:var(--blue,#2563eb);background:none;border:none;cursor:pointer;font-family:inherit;font-weight:600;padding:4px 8px;border-radius:4px;white-space:nowrap}
.notif-mark-all:hover{background:rgba(37,99,235,.06)}

/* Category filter tabs */
.notif-filter-tabs{display:flex;gap:4px;padding:8px 12px;border-bottom:1px solid var(--border-subtle,#e9ecef);overflow-x:auto;background:var(--bg-secondary,#fafafa)}
.notif-filter-btn{display:flex;align-items:center;gap:4px;background:none;border:1px solid var(--border-subtle,#e9ecef);border-radius:6px;padding:6px 10px;font-size:12px;cursor:pointer;color:var(--text-dim,#868e96);font-weight:500;transition:all .2s;white-space:nowrap;flex-shrink:0}
.notif-filter-btn:hover{border-color:var(--blue,#2563eb);color:var(--blue,#2563eb);background:rgba(37,99,235,.04)}
.notif-filter-btn.active{background:var(--blue,#2563eb);color:#fff;border-color:var(--blue,#2563eb)}
.notif-filter-icon{font-size:14px}
.notif-filter-label{display:none}
@media(min-width:400px){.notif-filter-label{display:inline}}

.notif-list{flex:1;overflow-y:auto;max-height:360px;background:var(--bg-primary,#fff)}
.notif-full-list{max-height:60vh;overflow-y:auto;background:var(--bg-primary,#fff)}

/* Date grouping */
.notif-date-group{margin-bottom:2px}
.notif-date-header{padding:8px 16px 4px;font-size:11px;font-weight:700;color:var(--text-dim,#868e96);text-transform:uppercase;letter-spacing:.5px;background:var(--bg-secondary,#fafafa)}
.notif-date-items{border-bottom:1px solid var(--border-subtle,#e9ecef)}

.notif-item{display:flex;gap:10px;padding:12px 16px;border-bottom:1px solid var(--border-subtle,#e9ecef);cursor:pointer;transition:background .15s;position:relative;align-items:flex-start}
.notif-item:hover{background:var(--bg-secondary,#f1f3f5)}
.notif-item.unread{background:rgba(37,99,235,.04)}
.notif-item.read{opacity:.75}
.notif-unread-border{position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--cyan,#06b6d4);border-radius:0;flex-shrink:0}
.notif-item:not(.unread) .notif-unread-border{display:none}

.notif-item-icon{font-size:16px;flex-shrink:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:var(--bg-tertiary,#e9ecef);border-radius:8px;margin-left:6px}
.notif-item-body{flex:1;min-width:0}
.notif-item-text{font-size:13px;line-height:1.4;color:var(--text,#1a1a2e)}
.notif-item.unread .notif-item-text{font-weight:600;color:var(--text,#1a1a2e)}
.notif-item.read .notif-item-text{color:var(--text-dim,#868e96)}
.notif-item-time{font-size:11px;color:var(--text-dim,#868e96);margin-top:3px;display:flex;gap:8px;align-items:center}

.notif-footer{padding:10px 16px;border-top:1px solid var(--border-subtle,#e9ecef);text-align:center}
.notif-footer a{font-size:12px;font-weight:600;color:var(--blue,#2563eb);text-decoration:none}
.notif-footer a:hover{text-decoration:underline}

.notif-empty{padding:40px 20px;text-align:center;color:var(--text-dim,#868e96);font-size:13px}
.notif-modal-title{font-size:16px;font-weight:700;margin:0}

/* Self-closing activity overlay */
.notif-overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:1002;display:flex;align-items:center;justify-content:center}
.notif-modal{background:var(--bg2,#fff);border-radius:12px;width:90%;max-width:560px;max-height:80vh;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 8px 32px rgba(0,0,0,.2)}
.notif-modal-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--border,#dee2e6)}
.notif-modal-close{background:none;border:none;font-size:24px;cursor:pointer;color:var(--text-dim,#868e96);padding:0 4px;line-height:1}
.notif-modal-close:hover{color:var(--text,#1a1a2e)}

/* Override page-header to keep controls on left when toggle is moved */
.page-header:has(.notif-controls){justify-content:flex-start;gap:12px}

/* Dismiss button per notification item */
.notif-dismiss-btn{
  flex-shrink:0;opacity:0;background:none;border:none;color:var(--text-muted,#6b7280);
  font-size:12px;cursor:pointer;padding:2px 4px;border-radius:4px;line-height:1;
  transition:opacity .15s,background .15s;align-self:flex-start;margin-top:2px;
}
.notif-item:hover .notif-dismiss-btn{ opacity:1; }
.notif-dismiss-btn:hover{ background:rgba(220,38,38,.1);color:#dc2626; }

/* ── @MENTION DROPDOWN (shared — textarea + contenteditable) ── */
.mention-dropdown {
  position: fixed;
  z-index: 9000;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  box-shadow: var(--panel-shadow-lg, 0 8px 24px rgba(0,0,0,.15));
  min-width: 200px;
  max-width: 280px;
  overflow: hidden;
  font-size: 13px;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background .1s;
}
.mention-item:hover,
.mention-item.active {
  background: var(--bg-hover);
}
.mention-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.mention-name {
  color: var(--text-primary);
  font-weight: 500;
}

/* ═══ Notification preferences modal (self-contained — do not rely on
   admin.css, which isn't loaded on most pages this modal opens from) ═══ */
.notif-settings-overlay{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:2000;display:flex;align-items:center;justify-content:center;padding:16px}
.notif-settings-modal{background:var(--bg-primary,#fff);border-radius:12px;width:100%;max-width:440px;max-height:80vh;overflow-y:auto;box-shadow:0 12px 40px rgba(0,0,0,.25)}
.notif-settings-header{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid var(--border-subtle,#e9ecef);font-size:15px;font-weight:700}
.notif-settings-header button{background:none;border:none;cursor:pointer;font-size:14px;opacity:.6;padding:4px 6px}
.notif-settings-header button:hover{opacity:1}
.notif-settings-desc{padding:12px 18px 0;font-size:12px;color:var(--text-dim,#868e96)}
.notif-settings-list{padding:8px 18px 18px}
.notif-pref-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--border-subtle,#e9ecef)}
.notif-pref-row:last-child{border-bottom:none}
.notif-pref-label{font-size:13px;font-weight:600;color:var(--text-primary,#212529)}
.notif-pref-desc{font-size:11px;color:var(--text-dim,#868e96);margin-top:2px}
.notif-pref-toggle{position:relative;display:inline-block;width:38px;height:22px;flex-shrink:0}
.notif-pref-toggle input{opacity:0;width:0;height:0}
.notif-pref-toggle .notif-pref-slider{position:absolute;cursor:pointer;inset:0;background:var(--border,#ced4da);transition:.2s;border-radius:22px}
.notif-pref-toggle .notif-pref-slider:before{position:absolute;content:"";height:16px;width:16px;left:3px;bottom:3px;background:#fff;transition:.2s;border-radius:50%}
.notif-pref-toggle input:checked + .notif-pref-slider{background:var(--blue,#2563eb)}
.notif-pref-toggle input:checked + .notif-pref-slider:before{transform:translateX(16px)}
