/* Maharajshri Analytics Hub — decision-focused v2 additions. */
.insight-panel {
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 0, rgba(242,165,54,.17), transparent 30%),
    linear-gradient(145deg, rgba(29,54,70,.9), rgba(8,27,42,.96));
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
}

.insight-card {
  min-height: 112px;
  padding: 15px;
  border: 1px solid rgba(235,174,75,.24);
  border-radius: 13px;
  background: rgba(3,20,32,.52);
}

.insight-card[data-tone="attention"] {
  border-color: rgba(240,90,72,.45);
  background: rgba(91,39,34,.28);
}

.insight-card[data-tone="positive"] {
  border-color: rgba(85,197,137,.38);
  background: rgba(31,91,68,.2);
}

.insight-card span {
  display: block;
  margin-bottom: .35rem;
  color: #ffd079;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.insight-card strong {
  display: block;
  margin-bottom: .3rem;
  color: #fff0d7;
  font: 1.16rem/1.2 Georgia,serif;
}

.insight-card p {
  margin: 0;
  color: #acbdc8;
  font-size: .83rem;
  line-height: 1.45;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-mini {
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg,rgba(255,255,255,.05),rgba(9,28,43,.9));
}

.metric-mini span {
  color: #9fb0bd;
  font-size: .76rem;
  font-weight: 750;
  text-transform: uppercase;
}

.metric-mini strong {
  display: block;
  margin-top: .25rem;
  color: #ffe4b4;
  font: 1.55rem Georgia,serif;
}

.hourly-chart {
  display: grid;
  grid-template-columns: repeat(24,minmax(13px,1fr));
  align-items: end;
  gap: 5px;
  min-height: 230px;
  padding: 24px 4px 30px;
  border-bottom: 1px solid rgba(219,169,87,.25);
}

.hour-column {
  position: relative;
  min-height: 5px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg,#ffd172,#d97e1c);
  box-shadow: 0 0 14px rgba(239,158,39,.12);
}

.hour-column.is-peak {
  background: linear-gradient(180deg,#fff0b4,#ef8d27);
  box-shadow: 0 0 22px rgba(255,183,65,.32);
}

.hour-column span {
  position: absolute;
  left: 50%;
  bottom: -25px;
  transform: translateX(-50%);
  color: #90a4b2;
  font-size: .65rem;
}

.performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(180px,1fr));
  gap: 12px;
}

.performance-card {
  padding: 16px;
  border: 1px solid rgba(235,174,75,.24);
  border-radius: 13px;
  background: rgba(4,21,34,.54);
}

.performance-card span {
  color: #9fb0bd;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.performance-card strong {
  display: block;
  margin: .35rem 0;
  color: #ffe2aa;
  font: 1.6rem Georgia,serif;
}

.performance-card small {
  color: #8fa3b0;
}

.table-wrap tbody tr:hover {
  background: rgba(255,191,86,.045);
}

.table-wrap td b {
  color: #ffe2af;
}

@media (max-width: 1180px) {
  .insight-grid,
  .metric-strip {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media (max-width: 680px) {
  .insight-grid,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .hourly-chart {
    gap: 2px;
  }

  .hour-column span {
    display: none;
  }

  .hour-column:nth-child(4n+1) span {
    display: block;
  }
}

/* Interactive owner-only listener map. Leaflet is hosted locally; the standard
   non-satellite OpenStreetMap layer is used only while this dashboard is open. */
.map-panel header {
  align-items: center;
}

.map-head-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  color: #b8c6cf;
  font-size: .78rem;
}

.map-view-actions {
  display: flex;
  gap: 6px;
}

.map-view-actions button {
  min-height: 34px;
  padding: .38rem .7rem;
  border: 1px solid rgba(238,169,65,.42);
  border-radius: 8px;
  background: #0b2232;
  color: #f6dfbd;
  cursor: pointer;
  font: inherit;
  font-size: .76rem;
  font-weight: 650;
}

.map-view-actions button:hover {
  border-color: #f1aa3f;
  background: rgba(235,151,37,.2);
}

.map-view-actions button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.map-panel .world-map {
  height: clamp(390px,54vh,620px);
  min-height: 390px;
  overflow: hidden;
  border-color: rgba(239,174,71,.38);
  background: linear-gradient(145deg,#dce8e8,#eaf0eb);
}

.map-panel .world-map > p.map-empty {
  z-index: 700;
  inset: auto 50% 24px auto;
  transform: translateX(50%);
  width: max-content;
  max-width: calc(100% - 40px);
  padding: .45rem .75rem;
  border-radius: 999px;
  background: rgba(7,24,39,.82);
  color: #e9d3b2;
  text-align: center;
  pointer-events: none;
}

.map-status {
  margin: .58rem .15rem 0;
  color: #8fa4b1;
  font-size: .78rem;
}

.leaflet-container {
  font: 14px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif;
}

.leaflet-tile-pane {
  filter: saturate(.66) brightness(1.04) contrast(.93);
}

.leaflet-bar {
  border: 1px solid rgba(88,62,33,.28) !important;
  box-shadow: 0 5px 14px rgba(25,40,46,.18) !important;
}

.leaflet-bar a {
  background: #fffaf1 !important;
  color: #69451f !important;
  border-color: #d9c3a4 !important;
}

.leaflet-bar a:hover {
  background: #f3dfbd !important;
}

.leaflet-control-attribution {
  background: rgba(255,252,245,.88) !important;
  color: #4b5a60 !important;
  font-size: 10px !important;
}

.leaflet-control-attribution a {
  color: #7b4b20 !important;
}

.listener-div-icon {
  background: transparent !important;
  border: 0 !important;
}

.listener-map-marker {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid #fff8e9;
  border-radius: 50%;
  background: #9a8d7a;
  box-shadow: 0 3px 12px rgba(38,52,56,.38),0 0 0 4px rgba(146,127,96,.18);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  cursor: pointer;
}

.listener-map-marker.recorded.is-cluster {
  width: 34px;
  height: 34px;
  background: #766a5d;
  box-shadow: 0 4px 14px rgba(38,52,56,.42),0 0 0 5px rgba(150,128,94,.2);
}

.listener-map-marker.live {
  width: 32px;
  height: 32px;
  background: #e6473a;
  box-shadow: 0 0 0 6px rgba(230,71,58,.2),0 4px 16px rgba(124,24,20,.42);
  animation: map-live-pulse 1.8s ease-out infinite;
}

.listener-map-marker.live.is-cluster {
  width: 38px;
  height: 38px;
  background: #c72f27;
}

.map-popup {
  min-width: 185px;
  color: #24343d;
}

.map-popup strong {
  display: block;
  margin-bottom: 5px;
  color: #5e391c;
  font: 700 1rem Georgia,serif;
}

.map-popup p {
  margin: .2rem 0 .4rem;
}

.map-popup small {
  color: #6f7d83;
}

.map-popup ul {
  margin: .45rem 0 0;
  padding-left: 1.05rem;
}

.map-popup li {
  margin: .22rem 0;
}

.map-popup.live strong {
  color: #b52820;
}

.leaflet-popup-content-wrapper {
  border: 1px solid #d7ad72;
  border-radius: 12px;
  background: #fffaf0;
  box-shadow: 0 10px 26px rgba(28,43,48,.25);
}

.leaflet-popup-tip {
  background: #fffaf0;
}

@keyframes map-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(230,71,58,.5),0 4px 16px rgba(124,24,20,.42); }
  70% { box-shadow: 0 0 0 12px rgba(230,71,58,0),0 4px 16px rgba(124,24,20,.42); }
  100% { box-shadow: 0 0 0 0 rgba(230,71,58,0),0 4px 16px rgba(124,24,20,.42); }
}

@media (max-width: 700px) {
  .map-panel header { align-items: flex-start; }
  .map-head-tools { justify-content: flex-start; }
  .map-panel .world-map { height: 420px; min-height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  .listener-map-marker.live { animation: none; }
}
