/* Panel de notificaciones Workori. Hoja estática compatible con CSP. */
.wn-bell {
  position: relative;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.wn-bell__btn {
  position: relative;
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(181, 204, 238, 0.86);
  border-radius: 15px;
  background: linear-gradient(145deg, #fff 0%, #f2f7ff 100%);
  color: var(--cp-blue, var(--blue));
  box-shadow: 0 6px 18px rgba(7, 95, 228, 0.09);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.wn-bell__btn:hover,
.wn-bell__btn[aria-expanded="true"] {
  border-color: rgba(7, 95, 228, 0.42);
  background: #fff;
  box-shadow: 0 10px 24px rgba(7, 95, 228, 0.16);
  transform: translateY(-1px);
}

.wn-bell__btn:focus-visible,
.wn-bell__close:focus-visible,
.wn-bell__mark-all:focus-visible,
.wn-bell__item:focus-visible,
.wn-bell__messages-link:focus-visible {
  outline: 3px solid rgba(7, 95, 228, 0.28);
  outline-offset: 2px;
}

.wn-bell__svg { width: 21px; height: 21px; }

.wn-bell__badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #ef3340;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 850;
  line-height: 1;
  box-shadow: 0 3px 9px rgba(239, 51, 64, 0.32);
}

.wn-bell__badge[hidden],
.wn-bell__mark-all[hidden] { display: none; }

.wn-bell__panel {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  display: none;
  width: min(430px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid rgba(193, 211, 236, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.985);
  color: #12203a;
  text-align: left;
  box-shadow: 0 26px 70px rgba(19, 50, 96, 0.2), 0 8px 24px rgba(7, 95, 228, 0.09);
  transform-origin: top right;
}

.wn-bell__panel::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue) 0%, #1a79f0 48%, var(--teal) 100%);
  content: "";
}

.wn-bell__panel.wn-open {
  display: block;
  animation: wn-panel-in 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.wn-bell__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #e7eef8;
  background: linear-gradient(180deg, rgba(241, 247, 255, 0.82), rgba(255, 255, 255, 0.96));
}

.wn-bell__heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wn-bell__heading-icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--blue), #1b79ef);
  color: #fff;
  box-shadow: 0 8px 18px rgba(7, 95, 228, 0.22);
}
.wn-bell__heading-icon .wn-bell__svg { width: 18px; height: 18px; }
.wn-bell__heading h2 { margin: 0; color: #0b1b36; font-size: 1.03rem; line-height: 1.2; }
.wn-bell__summary { margin: 3px 0 0; color: #65738a; font-size: 0.76rem; font-weight: 650; }
.wn-bell__head-actions { display: flex; align-items: center; gap: 7px; }
.wn-bell__mark-all {
  padding: 7px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}
.wn-bell__mark-all:hover { background: rgba(7, 95, 228, 0.08); }
.wn-bell__mark-all:disabled { opacity: 0.55; cursor: wait; }
.wn-bell__close {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid #dbe6f5;
  border-radius: 10px;
  background: #fff;
  color: #4d5d75;
  cursor: pointer;
}
.wn-bell__close:hover { border-color: #bfd1ea; color: var(--blue); background: #f5f9ff; }
.wn-bell__close svg { width: 17px; height: 17px; }

.wn-bell__list { max-height: min(480px, calc(100vh - 190px)); overflow-y: auto; overscroll-behavior: contain; }
.wn-bell__item {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 8px;
  gap: 12px;
  width: 100%;
  padding: 15px 18px;
  border: 0;
  border-bottom: 1px solid #edf2f8;
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}
.wn-bell__item:hover { z-index: 1; background: #f6f9fe; }
.wn-bell__item.wn-unread { background: linear-gradient(90deg, rgba(7, 95, 228, 0.075), rgba(255, 255, 255, 0.98) 72%); }
.wn-bell__item.wn-unread::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--blue); content: ""; }
.wn-bell__item-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: #edf4ff;
  color: var(--blue);
}
.wn-bell__item[data-kind="reply"] .wn-bell__item-icon,
.wn-bell__item[data-kind="new_message"] .wn-bell__item-icon,
.wn-bell__item[data-kind="admin_message"] .wn-bell__item-icon { background: #e8f8f6; color: #008d83; }
.wn-bell__item[data-kind="payment"] .wn-bell__item-icon,
.wn-bell__item[data-kind="quote"] .wn-bell__item-icon { background: #fff5df; color: #b97800; }
.wn-bell__item-icon svg { width: 20px; height: 20px; }
.wn-bell__item-icon svg path { stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wn-bell__item-content { display: block; min-width: 0; }
.wn-bell__item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.wn-bell__item-title { overflow: hidden; color: #14233d; font-size: 0.86rem; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.wn-bell__item-time { flex: 0 0 auto; color: #8490a2; font-size: 0.69rem; font-weight: 650; }
.wn-bell__item-body {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 4px;
  color: #526179;
  font-size: 0.78rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.wn-bell__item-meta { display: flex; margin-top: 8px; }
.wn-bell__reference { padding: 3px 7px; border-radius: 999px; background: #eef3f9; color: #5b6a80; font-size: 0.66rem; font-weight: 750; }
.wn-bell__unread-dot { align-self: center; width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.wn-bell__item.wn-unread .wn-bell__unread-dot { background: var(--blue); box-shadow: 0 0 0 4px rgba(7, 95, 228, 0.1); }

.wn-bell__state { display: grid; min-height: 230px; place-items: center; align-content: center; padding: 34px 28px; text-align: center; }
.wn-bell__state-icon { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 13px; border-radius: 16px; background: #fff0f1; color: #d92d3a; font-size: 1.2rem; font-weight: 850; }
.wn-bell__state-icon--check { background: #e8f8f6; color: #008d83; }
.wn-bell__state strong { color: #182742; font-size: 0.91rem; }
.wn-bell__state p { max-width: 290px; margin: 7px 0 0; color: #6b788c; font-size: 0.78rem; line-height: 1.5; }
.wn-bell__state button { margin-top: 14px; padding: 8px 13px; border: 1px solid #c7d8ef; border-radius: 10px; background: #fff; color: var(--blue); font: inherit; font-size: 0.76rem; font-weight: 750; cursor: pointer; }
.wn-bell__loading { display: grid; min-height: 230px; place-items: center; align-content: center; gap: 10px; padding: 30px; }
.wn-bell__loading span { width: 82%; height: 12px; border-radius: 999px; background: linear-gradient(90deg, #edf2f8 20%, #f8faff 48%, #edf2f8 78%); background-size: 220% 100%; animation: wn-shimmer 1.2s linear infinite; }
.wn-bell__loading span:nth-child(2) { width: 68%; }
.wn-bell__loading span:nth-child(3) { width: 48%; }

.wn-bell__foot { padding: 11px 15px; border-top: 1px solid #e7eef8; background: #fafcff; }
.wn-bell__messages-link { display: flex; min-height: 38px; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; color: var(--blue); font-size: 0.77rem; font-weight: 780; text-decoration: none; }
.wn-bell__messages-link:hover { background: #eef5ff; }
.wn-bell__messages-link svg { width: 16px; height: 16px; }

[data-pwa-role="provider"] .wn-bell__btn,
.provider-portal-header .wn-bell__btn { color: var(--pp-accent, #008d83); border-color: rgba(0, 169, 157, 0.25); }
[data-pwa-role="provider"] .wn-bell__panel::before,
.provider-portal-header .wn-bell__panel::before { background: linear-gradient(90deg, #007d74, var(--teal)); }

@keyframes wn-panel-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes wn-shimmer { to { background-position-x: -220%; } }

@media (max-width: 640px) {
  .wn-bell { position: static; }
  .wn-bell__panel { position: fixed; top: 72px; right: 10px; left: 10px; width: auto; max-height: calc(100dvh - 84px); border-radius: 20px; }
  .wn-bell__list { max-height: calc(100dvh - 252px); }
  .wn-bell__head { padding: 18px 15px 14px; }
  .wn-bell__mark-all { max-width: 104px; white-space: normal; line-height: 1.15; }
  .wn-bell__item { grid-template-columns: 38px minmax(0, 1fr) 7px; gap: 10px; padding: 14px; }
  .wn-bell__item-icon { width: 38px; height: 38px; border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .wn-bell__panel.wn-open, .wn-bell__loading span { animation: none; }
  .wn-bell__btn, .wn-bell__item { transition: none; }
}
