/* backdrop-filter isolates the header; lift that context above Inicio's
   animated content so its notification panel remains visible and clickable.
   Keep it below modal dialogs (z-index 1000+). */
.topbar:has(.global-notification-shell) {
  position: relative;
  z-index: 90;
}

.global-notification-shell {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 80;
}

.global-notification-bell {
  position: relative;
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #d9e4ee;
  border-radius: 16px;
  background: #f5fafc;
  color: #082336;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.global-notification-bell:hover,
.global-notification-bell[aria-expanded="true"] {
  transform: translateY(-1px);
  border-color: #78dce5;
  background: #eafcfd;
  box-shadow: 0 10px 24px rgba(7, 28, 45, 0.11);
}

.global-notification-bell svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.global-notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #ff4d67;
  color: #fff;
  font-size: 0.69rem;
  font-weight: 950;
  line-height: 1;
  box-sizing: border-box;
}

.global-notification-badge[hidden] {
  display: none;
}

.global-notification-panel {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(390px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid rgba(210, 225, 236, 0.95);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(7, 28, 45, 0.2);
  backdrop-filter: blur(18px);
  transform-origin: top right;
  animation: global-notification-in 150ms ease-out;
}

.global-notification-panel[hidden] {
  display: none;
}

@keyframes global-notification-in {
  from { opacity: 0; transform: translateY(-7px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.global-notification-header,
.global-notification-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.global-notification-header {
  border-bottom: 1px solid #e6eef4;
}

.global-notification-header strong {
  color: #082336;
  font-size: 1rem;
}

.global-notification-header span {
  color: #61748e;
  font-size: 0.78rem;
  font-weight: 800;
}

.global-notification-list {
  max-height: min(430px, calc(100vh - 220px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #b9d3de transparent;
}

.global-notification-item {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 14px 18px 14px 22px;
  border-bottom: 1px solid #edf2f6;
  background: #fff;
}

.global-notification-item.unread {
  background: #f3fdfe;
}

.global-notification-item.unread::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 20px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00c9da;
}

.global-notification-item-title {
  color: #13283b;
  font-size: 0.91rem;
  font-weight: 900;
  line-height: 1.3;
}

.global-notification-item p {
  margin: 0;
  color: #60728a;
  font-size: 0.82rem;
  line-height: 1.42;
}

.global-notification-meta {
  color: #8391a4;
  font-size: 0.72rem;
  font-weight: 750;
}

.global-notification-quotes {
  display: grid;
  gap: 7px;
  margin-top: 3px;
}

.global-notification-quote-row {
  display: grid;
  gap: 6px;
}

.global-notification-quote-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  padding: 8px;
  border: 1px solid #dceaf0;
  border-radius: 12px;
  background: #f8fcfd;
}

.global-notification-status {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  border: 1px solid #cfdfe7;
  border-radius: 9px;
  background: #fff;
  color: #173047;
  padding: 5px 7px;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
}

.global-notification-quote-action {
  min-height: 34px;
  border: 1px solid #b9d6df;
  border-radius: 9px;
  background: #fff;
  color: #086877;
  padding: 5px 9px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

.global-notification-quote-action.approve {
  border-color: #9fd9c1;
  background: #e8f8f1;
  color: #08734f;
}

.global-notification-quote-action.reject {
  border-color: #e9aaa5;
  background: #fff0ef;
  color: #a62a24;
}

.global-notification-review {
  grid-column: 1 / -1;
  justify-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.68rem;
  font-weight: 900;
}

.global-notification-review.approved {
  background: #e8f8f1;
  color: #08734f;
}

.global-notification-review.rejected {
  background: #feeceb;
  color: #a62a24;
}

.global-notification-followup {
  grid-column: 1 / -1;
}

.global-notification-followup summary {
  color: #086877;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 900;
}

.global-notification-followup[open] {
  display: grid;
  gap: 6px;
}

.global-notification-followup textarea,
.global-notification-followup input {
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  border: 1px solid #cfdfe7;
  border-radius: 9px;
  padding: 7px;
  font: inherit;
  font-size: 0.75rem;
}

.global-notification-link,
.global-notification-quote-link,
.global-notification-footer a,
.global-notification-read-all {
  text-decoration: none;
}

.global-notification-link,
.global-notification-quote-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #086877;
  font-size: 0.78rem;
  font-weight: 900;
}

.global-notification-quote-link {
  padding: 9px 10px;
  border-radius: 12px;
  background: #eaf8fa;
}

.global-notification-link:hover,
.global-notification-quote-link:hover,
.global-notification-footer a:hover {
  color: #003e49;
}

.global-notification-empty,
.global-notification-loading {
  padding: 32px 20px;
  color: #687b91;
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.5;
}

.global-notification-footer {
  border-top: 1px solid #e6eef4;
  background: #f7fbfc;
}

.global-notification-footer a,
.global-notification-read-all {
  color: #0a6875;
  font-size: 0.8rem;
  font-weight: 900;
}

.global-notification-read-all {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

@media (max-width: 720px) {
  .global-notification-shell {
    order: -1;
  }

  .global-notification-bell {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .global-notification-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: auto;
    left: -24px;
    width: calc(100vw - 32px);
    max-height: calc(100vh - 92px);
    transform-origin: top left;
  }

  .global-notification-list {
    max-height: calc(100vh - 220px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .global-notification-panel { animation: none; }
  .global-notification-bell { transition: none; }
}

/* Let the list shrink while header and footer remain accessible. */
.global-notification-panel > .global-notification-list { min-height: 0; flex: 1 1 auto; }
.global-notification-header, .global-notification-footer { flex-shrink: 0; }
