:root {
  --bep-green: #1f7a4d;
  --bep-green-dark: #19663f;
  --bep-navy: #123d72;
  --bep-ink: #1f2d3d;
  --bep-muted: #64748b;
  --bep-bg: #f4f7fb;
  --bep-line: #dde3ec;
  --bep-white: #fff;
}

* { box-sizing: border-box; }
html { background: var(--bep-bg); }
body {
  min-height: 100vh;
  margin: 0;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  color: var(--bep-ink);
  background: radial-gradient(circle at 100% 0, #e3f2ea 0, transparent 38%), var(--bep-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
}
button, a { -webkit-tap-highlight-color: transparent; }

.notifications-shell {
  width: min(760px, calc(100% - 28px));
  margin: auto;
  padding: 22px 0 34px;
}
.notifications-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}
.notifications-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--bep-green-dark);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.02em;
}
.notifications-brand-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #e3f2ea, #cde8da);
  color: #1f7a4d;
  font-size: 20px;
}
.notifications-back,
.notifications-mark-all,
.notification-cta {
  border: 0;
  border-radius: 13px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.notifications-back {
  padding: 10px 14px;
  color: var(--bep-green-dark);
  background: rgba(255, 255, 255, .9);
  border: 1px solid #cfded3;
}
.notifications-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 0 2px;
}
.notifications-kicker {
  color: var(--bep-green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
}
.notifications-hero h1,
.notification-card h1 {
  margin: 5px 0 0;
  color: var(--bep-navy);
  letter-spacing: -.03em;
}
.notifications-hero h1 { font-size: clamp(27px, 7vw, 36px); }
.notifications-mark-all {
  flex: 0 0 auto;
  padding: 11px 13px;
  color: var(--bep-green);
  background: #e8f4e9;
}
.notifications-mark-all[hidden] { display: none; }
.notifications-mark-all:disabled { opacity: .55; cursor: wait; }
.notifications-list { display: grid; gap: 12px; }
.notification-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 18px;
  overflow: hidden;
  color: inherit;
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--bep-line);
  border-radius: 20px;
  box-shadow: 0 11px 28px rgba(28, 74, 55, .07);
  text-decoration: none;
}
.notification-item:active { transform: scale(.99); }
.notification-item.is-unread {
  border-color: #bdddbf;
  box-shadow: 0 13px 34px rgba(30, 108, 79, .12);
}
.notification-item.is-unread::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--bep-green);
}
.notification-item h2 {
  margin: 0 0 7px;
  color: var(--bep-navy);
  font-size: 18px;
  line-height: 1.25;
}
.notification-preview {
  display: -webkit-box;
  overflow: hidden;
  color: #53667a;
  font-size: 14px;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.notification-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
  color: #83909d;
  font-size: 12px;
}
.notification-new {
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--bep-green);
  background: #e5f3e8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
}
.notification-arrow {
  align-self: center;
  color: var(--bep-green);
  font-size: 25px;
}
.notifications-state,
.notification-card {
  padding: 26px;
  color: var(--bep-muted);
  background: rgba(255, 255, 255, .95);
  border: 1px solid var(--bep-line);
  border-radius: 24px;
  box-shadow: 0 16px 42px rgba(28, 74, 55, .09);
}
.notifications-state { text-align: center; font-weight: 750; }
.notifications-state strong { display: block; margin-bottom: 5px; color: var(--bep-navy); }
.notification-card > .notifications-state { padding: 30px 8px; background: transparent; border: 0; box-shadow: none; }
.notification-card h1 { font-size: clamp(27px, 7vw, 38px); }
.notification-date { margin: 10px 0 22px; color: #7d8c99; font-size: 13px; }
.notification-message { white-space: pre-wrap; font-size: 17px; line-height: 1.65; }
.notification-cta {
  display: block;
  margin-top: 25px;
  padding: 15px;
  color: #fff;
  background: linear-gradient(145deg, var(--bep-green-dark), var(--bep-green));
  box-shadow: 0 12px 28px rgba(29, 107, 79, .22);
  text-align: center;
}
.notification-cta[hidden] { display: none; }

@media (max-width: 480px) {
  .notifications-shell { width: min(100% - 24px, 760px); padding-top: 15px; }
  .notifications-brand { font-size: 18px; }
  .notifications-brand-icon { width: 38px; height: 38px; }
  .notifications-back { padding: 9px 12px; font-size: 13px; }
  .notifications-hero { align-items: flex-start; flex-direction: column; }
  .notifications-mark-all { align-self: stretch; }
  .notification-card, .notifications-state { padding: 22px 19px; }
}

/* ─── Skeleton loader (Fase 2) ─── */
.skeleton-item {
  padding: 18px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--bep-line);
  border-radius: 20px;
  box-shadow: 0 11px 28px rgba(28, 74, 55, .07);
}
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #e8eef4 25%, #f4f8fb 50%, #e8eef4 75%);
  background-size: 200% 100%;
  animation: bepShimmer 1.3s linear infinite;
}
.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
@keyframes bepShimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ─── Stati lista: icona + retry (Fase 2) ─── */
.notifications-state .state-icon {
  display: block;
  width: 38px;
  height: 38px;
  margin: 0 auto 12px;
  color: #b6c2d2;
  stroke-width: 1.6;
}
.notifications-state .state-retry {
  margin-top: 16px;
  padding: 10px 20px;
  border-radius: 12px;
  border: 1.5px solid var(--bep-navy);
  color: var(--bep-navy);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.notifications-state .state-retry:active { transform: scale(.98); }
