/* ────────────────────────────────────────────────────────────────────
 * Spartan CRM — Management alerts bar (SM-COMMS-RESP-01)
 * Companion to modules/39-disgruntled-watch.js
 *
 * A DISGRUNTLED-CLIENT escalation, straight to management. Deliberately a
 * different visual language from the red "Team Response Watch" / AI email
 * reminder bars — a charcoal ground with an amber→red severity flare and a
 * warning-triangle — so "an unhappy client needs a human NOW" doesn't read as
 * "someone is slow to reply". Pulse speeds up with severity.
 *   low/medium → .ma-pulse-normal (amber, 2.2s)
 *   high       → .ma-pulse-high   (orange-red, 1.3s)
 *   critical   → .ma-pulse-critical (deep red, 0.85s)
 * All motion gated by prefers-reduced-motion.
 * ──────────────────────────────────────────────────────────────────── */

#management-alerts-root {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 8900; /* below response-watch (8950) + email-reminders (9000); JS sets `top` to stack */
  pointer-events: none;
}
#management-alerts-root .ma-banner {
  pointer-events: auto;
  display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center;
  padding: 10px 18px;
  background: linear-gradient(180deg, #1c1917 0%, #292524 100%);
  color: #fff; font-family: 'Archivo', system-ui, sans-serif; font-size: 13px;
  border-bottom: 2px solid rgba(251,191,36,.55);
  box-shadow: 0 6px 22px -2px rgba(0,0,0,.5);
}
.ma-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(251,191,36,.18); border: 1px solid rgba(251,191,36,.5);
  display: flex; align-items: center; justify-content: center; color: #FBBF24; flex-shrink: 0;
}
.ma-icon svg { width: 20px; height: 20px; }
.ma-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ma-h {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-family: 'Archivo Narrow', sans-serif; font-size: 10px; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.9);
}
.ma-sep { opacity: .45; }
.ma-tag { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.24); padding: 2px 6px; border-radius: 4px; }
.ma-tag.ma-count { background: #FBBF24; color: #1c1917; border-color: #FBBF24; }
.ma-tag.ma-ch { background: rgba(251,191,36,.18); border-color: rgba(251,191,36,.5); color: #FDE68A; }
.ma-tag.ma-state { background: rgba(0,0,0,.35); letter-spacing: .06em; }
.ma-title {
  font-size: 14px; font-weight: 800; color: #fff; letter-spacing: -.005em; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: calc(100vw - 540px);
}
.ma-text {
  font-size: 12px; color: rgba(253,230,138,.92); line-height: 1.35; font-style: italic;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: calc(100vw - 540px);
}
.ma-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ma-more, .ma-action {
  padding: 7px 12px; border-radius: 7px; font-family: 'Archivo Narrow', sans-serif;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
  border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: #fff;
  transition: background .15s, transform .15s;
}
.ma-more:hover, .ma-action:hover { background: rgba(255,255,255,.2); transform: translateY(-1px); }
.ma-action.ma-open { background: #FBBF24; color: #1c1917; border-color: #FBBF24; }
.ma-action.ma-open:hover { background: #FCD34D; }

@keyframes ma-pulse-normal   { 0%,100% { box-shadow: 0 6px 22px -2px rgba(0,0,0,.5), 0 0 0 0 rgba(251,191,36,.5); } 50% { box-shadow: 0 6px 22px -2px rgba(0,0,0,.5), 0 0 0 7px rgba(251,191,36,0); } }
@keyframes ma-pulse-high     { 0%,100% { box-shadow: 0 6px 22px -2px rgba(0,0,0,.6), inset 0 0 0 2px rgba(251,146,60,.5), 0 0 0 0 rgba(249,115,22,.7); } 50% { box-shadow: 0 6px 22px -2px rgba(0,0,0,.7), inset 0 0 0 3px rgba(251,146,60,.8), 0 0 0 10px rgba(249,115,22,0); } }
@keyframes ma-pulse-critical { 0%,100% { box-shadow: 0 8px 30px -2px rgba(0,0,0,.7), inset 0 0 0 3px rgba(239,68,68,.8); transform: translateY(0);} 50% { box-shadow: 0 8px 42px -2px rgba(220,38,38,1), inset 0 0 0 5px rgba(239,68,68,1); transform: translateY(-1px);} }
.ma-banner.ma-pulse-normal   { animation: ma-pulse-normal 2.2s ease-in-out infinite; }
.ma-banner.ma-pulse-high     { animation: ma-pulse-high 1.3s ease-in-out infinite; border-bottom-color: rgba(249,115,22,.7); }
.ma-banner.ma-pulse-critical { animation: ma-pulse-critical 0.85s ease-in-out infinite; background: linear-gradient(180deg,#450a0a 0%,#1c1917 100%); border-bottom-color: rgba(239,68,68,.9); }

@media (prefers-reduced-motion: reduce) {
  .ma-banner, .ma-banner.ma-pulse-normal, .ma-banner.ma-pulse-high, .ma-banner.ma-pulse-critical { animation: none !important; }
  .ma-banner { box-shadow: 0 8px 28px -2px rgba(0,0,0,.6), inset 0 0 0 2.5px rgba(251,191,36,.7); }
}
@media (max-width: 900px) {
  #management-alerts-root .ma-banner { grid-template-columns: 36px 1fr; gap: 10px; padding: 10px 14px; }
  #management-alerts-root .ma-actions { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
  .ma-title, .ma-text { max-width: 100%; }
}
