/* Complementos de la auditoría final: malla cerebral y calendarios compartidos. */

/* ---------- malla poligonal real ---------- */
body.nv5 .neuromap-stage-wrap { isolation: isolate; }
body.nv5 .neuromap-wireframe {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  opacity: 1;
  filter: saturate(1.08) contrast(1.04);
}
body.nv5 .neuromap-wireframe-active .neuromap-canvas {
  position: relative;
  z-index: 2;
  opacity: 0;
  pointer-events: auto;
}
body.nv5 .neuromap-wireframe-active .neuromap-overlay { z-index: 3; }
body.nv5 .neuromap-wireframe-active .neuromap-stage-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(330px 210px at 50% 49%, rgba(22, 211, 220, .08), transparent 72%),
    radial-gradient(260px 170px at 75% 38%, rgba(255, 118, 112, .035), transparent 74%);
  mix-blend-mode: screen;
}

.nv-dashboard-hero.nv-wire-ready .nv-brain-preview { opacity: 0 !important; pointer-events: none; }
.nv-wire-preview {
  position: absolute;
  inset: 62px 0 0;
  z-index: 1;
  width: 100%;
  height: calc(100% - 62px);
  display: block;
  cursor: pointer;
  touch-action: manipulation;
  outline: none;
}
.nv-wire-preview:focus-visible {
  outline: 2px solid #3ddcff;
  outline-offset: -8px;
  border-radius: 18px;
}

/* ---------- política de tareas sin peso ---------- */
body.nv5 .neuromap-stat-archive {
  max-width: 112px;
  border-color: rgba(73, 203, 218, .17) !important;
  background: rgba(4, 30, 40, .72) !important;
}
body.nv5 .neuromap-stat-archive span {
  white-space: normal;
  line-height: 1.15;
}

/* ---------- vigilancia de calendarios compartidos ---------- */
body.nv5 .shared-calendar-monitor {
  position: relative;
  overflow: hidden;
  border-color: rgba(63, 191, 239, .22) !important;
  background:
    radial-gradient(520px 260px at 92% -12%, rgba(31, 166, 255, .16), transparent 70%),
    radial-gradient(380px 260px at 8% 14%, rgba(102, 66, 226, .11), transparent 72%),
    linear-gradient(145deg, rgba(11, 24, 48, .96), rgba(4, 12, 28, .96)) !important;
  box-shadow: 0 22px 64px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .025);
}
body.nv5 .shared-calendar-monitor::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .34;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(67, 219, 245, .45) 0 1px, transparent 2px),
    radial-gradient(circle at 75% 66%, rgba(119, 96, 255, .34) 0 1px, transparent 2px),
    linear-gradient(122deg, transparent 48.5%, rgba(51, 171, 235, .045) 49%, transparent 49.5%);
  background-size: 89px 89px, 121px 121px, 58px 58px;
  mask-image: radial-gradient(ellipse at 60% 30%, #000 0 25%, transparent 80%);
}
.shared-calendar-head,
.shared-calendar-summary,
.shared-calendar-list,
.shared-calendar-toggle,
.shared-calendar-actions,
.shared-calendar-empty,
.shared-calendar-unread,
.shared-calendar-monitor [data-shared-calendar-message] { position: relative; z-index: 1; }
.shared-calendar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.shared-calendar-head h2 { margin: 4px 0 7px !important; color: #f2f8ff; }
.shared-calendar-head p { max-width: 760px; margin: 0; }
.shared-calendar-kicker {
  color: #4bcfff;
  font: 600 10px/1 Sora, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.shared-calendar-orbit {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(70, 204, 255, .32);
  border-radius: 17px;
  color: #69dbff;
  background: rgba(13, 92, 153, .22);
  box-shadow: 0 0 30px rgba(41, 160, 255, .16), inset 0 0 18px rgba(45, 189, 255, .08);
  font-size: 25px;
}
.shared-calendar-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 13px;
}
.shared-calendar-summary > span {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid rgba(99, 151, 225, .15);
  border-radius: 15px;
  color: #dce9fa;
  background: rgba(5, 16, 34, .65);
}
.shared-calendar-summary b { display: block; color: #eff8ff; font: 600 20px/1 Sora, sans-serif; }
.shared-calendar-summary small { display: block; margin-top: 5px; color: #7788a4; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.shared-calendar-list { display: grid; gap: 8px; margin-bottom: 13px; }
.shared-calendar-source {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 9px 12px;
  border: 1px solid rgba(98, 147, 216, .13);
  border-radius: 14px;
  color: #d9e6f7;
  background: rgba(10, 24, 47, .62);
}
.shared-calendar-source.has-error { border-color: rgba(255, 117, 132, .28); background: rgba(79, 23, 40, .28); }
.shared-calendar-source > div { min-width: 0; display: grid; gap: 3px; }
.shared-calendar-source b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #eaf4ff; font-size: 13px; }
.shared-calendar-source small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #788aa5; font-size: 11px; }
.shared-calendar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #44dfb0;
  box-shadow: 0 0 13px rgba(68, 223, 176, .58);
}
.has-error .shared-calendar-dot { background: #ff7a89; box-shadow: 0 0 13px rgba(255, 90, 112, .45); }
.shared-calendar-toggle {
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas: "control copy";
  align-items: center;
  gap: 11px;
  min-height: 64px;
  margin: 0 0 13px !important;
  padding: 10px 12px;
  border: 1px solid rgba(95, 149, 224, .14);
  border-radius: 15px;
  color: #dce8f8 !important;
  background: rgba(6, 18, 37, .70);
  cursor: pointer;
}
.shared-calendar-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.shared-calendar-toggle > span {
  grid-area: control;
  position: relative;
  width: 42px;
  height: 24px;
  border: 1px solid rgba(104, 145, 211, .22);
  border-radius: 999px;
  background: rgba(35, 50, 78, .82);
  transition: background .18s ease, border-color .18s ease;
}
.shared-calendar-toggle > span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #91a0b7;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.shared-calendar-toggle input:checked + span {
  border-color: rgba(56, 206, 255, .50);
  background: linear-gradient(90deg, #0879c5, #584bd5);
}
.shared-calendar-toggle input:checked + span::after {
  transform: translateX(18px);
  background: #fff;
  box-shadow: 0 0 13px rgba(90, 221, 255, .60);
}
.shared-calendar-toggle input:focus-visible + span { outline: 3px solid rgba(61, 216, 255, .36); outline-offset: 3px; }
.shared-calendar-toggle > div { grid-area: copy; min-width: 0; display: grid; gap: 3px; }
.shared-calendar-toggle b { color: #e7f1ff; font-size: 13px; }
.shared-calendar-toggle small { color: #7b8ba6; font-size: 11px; line-height: 1.35; }
.shared-calendar-actions { justify-content: space-between; }
.shared-calendar-actions .muted { margin-left: auto; }
.shared-calendar-unread {
  margin: 12px 0 0;
  padding: 9px 11px;
  border: 1px solid rgba(62, 205, 235, .18);
  border-radius: 12px;
  color: #bfefff;
  background: rgba(9, 70, 88, .35);
  font-size: 12px;
}
.shared-calendar-empty {
  display: grid;
  gap: 5px;
  padding: 17px;
  border: 1px dashed rgba(91, 155, 228, .24);
  border-radius: 16px;
  color: #8191ab;
  background: rgba(6, 18, 37, .55);
}
.shared-calendar-empty b { color: #dbe8f8; }
.shared-calendar-monitor [data-shared-calendar-message] { min-height: 19px; margin: 11px 0 0; }
.shared-calendar-today-alert { align-items: center !important; border-color: rgba(68, 190, 240, .24) !important; }
.shared-calendar-today-alert .btn { flex: 0 0 auto; }

@media (max-width: 760px) {
  body.nv5 .neuromap-wireframe { top: 0; height: 100%; }
  .nv-wire-preview { inset: 58px 0 0; height: calc(100% - 58px); }
  body.nv5 .neuromap-stat-archive { display: none; }
  .shared-calendar-head { gap: 10px; }
  .shared-calendar-orbit { width: 42px; height: 42px; flex-basis: 42px; border-radius: 14px; }
  .shared-calendar-summary { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .shared-calendar-summary > span { padding: 9px; }
  .shared-calendar-summary b { font-size: 17px; }
  .shared-calendar-summary small { font-size: 8px; }
  .shared-calendar-actions { align-items: stretch; }
  .shared-calendar-actions .btn { width: 100%; }
  .shared-calendar-actions .muted { width: 100%; margin: 0; }
  .shared-calendar-today-alert { align-items: flex-start !important; flex-wrap: wrap; }
  .shared-calendar-today-alert .btn { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .shared-calendar-toggle > span,
  .shared-calendar-toggle > span::after { transition: none; }
}
