/* Campanita de avisos (public/js/notices.js) */
.notices {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}
.notices[hidden] { display: none; }

.notices-btn {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 1.05rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.notices-btn:hover,
.notices-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
  color: var(--text);
}
.notices-btn:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

.notices-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--bg-body);
}
.notices-dot[hidden] { display: none; }

.notices-btn.is-ringing i { animation: notices-ring 0.9s ease-in-out; transform-origin: 50% 10%; }
@keyframes notices-ring {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-12deg); }
  45% { transform: rotate(8deg); }
  60% { transform: rotate(-5deg); }
  75% { transform: rotate(2deg); }
}
@media (prefers-reduced-motion: reduce) {
  .notices-btn.is-ringing i { animation: none; }
}

.notices-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(400px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  background: #0f1522;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  z-index: 1002;
  overflow: hidden;
}
.notices-panel[hidden] { display: none; }

.notices-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}
.notices-head h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.notices-list {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notice-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border);
}
.notice-item:last-child { border-bottom: 0; }
.notice-item.is-unread { background: rgba(var(--primary-rgb), 0.07); }

.notice-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
}
.notice-danger .notice-icon { background: rgba(var(--danger-rgb), 0.14); color: var(--danger-light); }
.notice-warning .notice-icon { background: rgba(var(--warning-rgb), 0.14); color: var(--warning-light); }
.notice-success .notice-icon { background: rgba(var(--success-rgb), 0.14); color: var(--success-light); }
.notice-info .notice-icon { background: rgba(var(--primary-rgb), 0.14); color: var(--primary-light); }

.notice-text { min-width: 0; }
.notice-text h3 {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  margin: 0 0 0.3rem;
  overflow-wrap: anywhere;
}
.notice-text p {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 0.4rem;
  overflow-wrap: anywhere;
}
.notice-text time {
  font-size: 0.74rem;
  color: var(--text-muted-darker);
}

.notices-empty {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}
.notices-empty i { font-size: 1.6rem; opacity: 0.5; margin-bottom: 0.6rem; }
.notices-empty p { margin: 0 0 0.3rem; color: var(--text-secondary); font-weight: 600; }
.notices-empty span { font-size: 0.82rem; line-height: 1.5; }

/* Celular: la lista ocupa el ancho de la pantalla con margen de 16px. */
@media (max-width: 600px) {
  .notices-panel {
    position: fixed;
    top: 72px;
    left: 16px;
    right: 16px;
    width: auto;
    max-height: calc(100vh - 96px);
  }
}
