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

.notif-bell-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  flex-shrink: 0;
}

.notif-bell-btn:hover {
  background: var(--surface2);
  border-color: var(--border-strong);
  color: var(--text);
}

.notif-bell-btn svg {
  width: 17px;
  height: 17px;
  pointer-events: none;
}

/* Badge */
.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 17px;
  text-align: center;
  pointer-events: none;
}

/* ── Desktop header bell slot ─────────────────────────────────────────────── */

.notif-bell-desktop-slot {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ── Mobile top bar bell ──────────────────────────────────────────────────── */

.notif-bell-mobile {
  /* Shown inside mobile-top-app-bar (display:none on desktop) */
  width: 40px;
  height: 40px;
  border-radius: 8px;
  justify-self: end;
  align-self: center;
}

@media (max-width: 960px) {
  .notif-bell-desktop-slot {
    display: none;
  }
}

/* ── Dropdown ──────────────────────────────────────────────────────────────── */

.notif-dropdown {
  position: fixed;
  /* --notif-dropdown-w defines the preferred desktop width; JS only feeds dynamic viewport coordinates. */
  --notif-dropdown-w: 320px;
  --notif-dropdown-left: 12px;
  --notif-dropdown-top: 64px;
  --notif-dropdown-max-h: calc(100vh - var(--notif-dropdown-top) - 12px);
  top: var(--notif-dropdown-top);
  left: var(--notif-dropdown-left);
  z-index: var(--z-popover, 9000);
  display: flex;
  flex-direction: column;
  width: min(var(--notif-dropdown-w), calc(100vw - 24px));
  max-height: min(420px, var(--notif-dropdown-max-h));
  max-width: calc(100vw - 16px);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft), 0 4px 24px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.notif-dropdown[hidden] {
  display: none;
  pointer-events: none;
}

.notif-dropdown-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.notif-dropdown-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
}

.notif-read-all-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.notif-read-all-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface2);
}

.notif-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: inherit;
  overflow-y: auto;
}

.notif-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ── Notification items ───────────────────────────────────────────────────── */

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.notif-item:hover {
  background: var(--surface2);
}

.notif-item.notif-read {
  opacity: 0.55;
}

.notif-item-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--muted);
}

.notif-item-body {
  min-width: 0;
}

.notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 2px;
}

.notif-item-msg {
  font-size: 12px;
  color: var(--muted-strong);
  line-height: 1.45;
}

/* Type colors */
.notif-tipo-danger .notif-item-dot  { background: var(--red); }
.notif-tipo-warning .notif-item-dot { background: var(--yellow); }
.notif-tipo-success .notif-item-dot { background: var(--green); }
.notif-tipo-info .notif-item-dot    { background: var(--blue); }

.notif-tipo-danger .notif-item-title  { color: var(--red); }
.notif-tipo-warning .notif-item-title { color: var(--yellow); }
.notif-tipo-success .notif-item-title { color: var(--green); }

.notif-item.notif-read .notif-item-title {
  color: var(--muted-strong);
}

/* Compact sidebar: bell still shows */
body.shell-compact .notif-bell-btn {
  width: 40px;
  height: 40px;
}

/* Shell header-minimal needs height when bell is the only content */
.shell-header-minimal .notif-bell-desktop-slot {
  padding: 12px 4px;
}

@media (max-width: 960px) {
  .shell-header-minimal .notif-bell-desktop-slot {
    padding: 0;
  }
}

@media (max-width: 400px) {
  .notif-dropdown {
    width: calc(100vw - 24px);
  }
}
