/* ═══════════════════════════════════════════════════════════════
   NotifApp Styles — uses CRM theme tokens (light/dark auto)
   Tokens: --t1/--t2/--t3 (text), --bg/--bg2/--bg3/--bg4,
           --brd/--brd2 (borders), --glass/--glass2, --acc (accent),
           --red/--grn/--org/--cyn (semantic)
   ═══════════════════════════════════════════════════════════════ */

/* ═══ PANEL ═══ */
.nf-panel {
  position: fixed;
  top: calc(52px + var(--safe-t, 0px));
  right: 8px;
  width: 380px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 80px);
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--brd2);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity .2s ease, transform .2s ease;
  color: var(--t1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
}
.nf-panel.nf-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.nf-panel[hidden] {
  display: none !important;
}

/* Light-theme: subtle shadow upgrade */
[data-theme="light"] .nf-panel {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* ═══ HEADER ═══ */
.nf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--brd);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), transparent);
  gap: 8px;
}
.nf-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--t1);
  letter-spacing: -.3px;
}
.nf-bell-icon {
  font-size: 18px;
}
.nf-count-pill {
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 10px;
  background: var(--acc);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nf-header-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
.nf-icon-btn {
  min-width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--glass2);
  border: 1px solid var(--brd);
  color: var(--t1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
  padding: 0;
  flex-shrink: 0;
}
.nf-icon-btn:hover {
  background: var(--bg4);
  border-color: var(--brd2);
  color: var(--t1);
  transform: translateY(-1px);
}
.nf-mark-all {
  background: var(--glass2);
  border-color: var(--brd);
  color: var(--t1);
}
.nf-mark-all:hover {
  background: var(--acc);
  border-color: var(--acc);
  color: #fff;
  transform: translateY(-1px);
}
.nf-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--red);
}
.nf-settings:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.35);
  color: var(--acc);
}

/* ═══ TABS ═══ */
.nf-tabs {
  display: flex;
  padding: 4px;
  margin: 8px 10px 0;
  background: var(--bg3);
  border-radius: 10px;
  gap: 2px;
}
.nf-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--t3);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}
.nf-tab:hover {
  color: var(--t1);
  background: var(--bg4);
}
.nf-tab.active {
  background: var(--acc);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}
.nf-tab-icon { font-size: 11px; }
.nf-tab-label { font-size: 12px; }
.nf-tab-count {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--bg4);
  color: var(--t2);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nf-tab.active .nf-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.nf-tab-count-zero {
  opacity: 0.5;
}

/* ═══ LIST ═══ */
.nf-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--brd2) transparent;
}
.nf-list::-webkit-scrollbar { width: 6px; }
.nf-list::-webkit-scrollbar-track { background: transparent; }
.nf-list::-webkit-scrollbar-thumb {
  background: var(--brd2);
  border-radius: 3px;
}
.nf-list::-webkit-scrollbar-thumb:hover {
  background: var(--t3);
}

/* ═══ ITEM ═══ */
.nf-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: var(--bg3);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  position: relative;
  animation: nf-item-in .25s ease;
  color: var(--t1);
}
@keyframes nf-item-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.nf-item:hover {
  background: var(--bg4);
  border-color: var(--brd);
  transform: translateX(2px);
}
.nf-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 2px;
}
.nf-urg-alta::before    { background: var(--red); }
.nf-urg-media::before   { background: var(--org); }
.nf-urg-baja::before    { background: var(--acc); }
.nf-urg-info::before    { background: var(--t3); }

.nf-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.nf-item-content {
  flex: 1;
  min-width: 0;
}
.nf-item-msg {
  font-size: 13px;
  line-height: 1.4;
  color: var(--t1);
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nf-item-time {
  font-size: 11px;
  color: var(--t3);
  margin-top: 3px;
}
.nf-dismiss {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--t3);
  cursor: pointer;
  opacity: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
  flex-shrink: 0;
}
.nf-item:hover .nf-dismiss {
  opacity: 1;
}
.nf-dismiss:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}

/* ═══ EMPTY STATE ═══ */
.nf-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--t3);
}
.nf-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: .85;
}
.nf-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 4px;
}
.nf-empty-sub {
  font-size: 12px;
  color: var(--t3);
}

/* ═══ LOADING ═══ */
.nf-loading {
  padding: 48px 24px;
  text-align: center;
  color: var(--t3);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.nf-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--brd2);
  border-top-color: var(--acc);
  border-radius: 50%;
  animation: nf-spin .8s linear infinite;
}
@keyframes nf-spin {
  to { transform: rotate(360deg); }
}

/* ═══ MOBILE ═══ */
@media (max-width: 480px) {
  .nf-panel {
    top: calc(48px + var(--safe-t, 0px));
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 72px - var(--safe-b, 0px));
  }
  .nf-tab-label {
    font-size: 11px;
  }
  .nf-mark-all span {
    display: none; /* hide "Limpiar" text on small screens, keep icon */
  }
}