
/* =========================================================
   DATA ADMIN ANALYTICS · AIG EMBEDDED
   Dedicated graphs, meters, pies, and group cards
========================================================= */

.wda-analytics-group-nav {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--wda-slate-200);
  scrollbar-width: thin;
}

.wda-analytics-group-nav button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--wda-slate-200);
  color: var(--wda-slate-700);
  background: white;
  font-size: 12px;
  font-weight: 800;
}

.wda-analytics-group-nav button.is-active {
  color: white;
  background: var(--wda-navy-800);
}

.wda-analytics-groups {
  min-height: 0;
}

.wda-analytics-waiting {
  padding: 44px var(--wda-page-pad);
  color: var(--wda-slate-500);
}

.wda-analytics-group {
  display: none;
}

.wda-analytics-group.is-active {
  display: block;
}

.wda-group-head {
  display: flex;
  min-height: 40px;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 7px 12px;
  border-bottom: 1px solid var(--wda-slate-200);
  background: var(--wda-slate-050);
}
.wda-group-head > .wda-kicker { flex: 0 0 auto; }
.wda-group-head p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--wda-slate-500);
  font-size: 9px;
  line-height: 1.35;
  text-align: right;
}

.wda-group-overview {
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  border-bottom: 1px solid var(--wda-slate-200);
}

.wda-analytic-card {
  min-width: 0;
  min-height: 104px;
  padding: 11px 12px;
  border-right: 1px solid var(--wda-slate-200);
  background: white;
}

.wda-analytic-card:last-child {
  border-right: 0;
}

.wda-analytic-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.wda-analytic-card-head span {
  color: var(--wda-slate-500);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.wda-analytic-card-head b {
  color: var(--wda-blue-600);
  font-size: 11px;
}

.wda-analytic-card > strong {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: var(--wda-navy-950);
  font-size: clamp(22px,1.8vw,36px);
  line-height: .95;
  text-overflow: ellipsis;
}

.wda-analytic-card small {
  display: block;
  margin-top: 6px;
  color: var(--wda-slate-500);
  font-size: 10px;
}

.wda-mini-spark {
  height: 26px;
  margin-top: 8px;
}

.wda-mini-spark svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.wda-group-trend {
  display: block;
  border-bottom: 1px solid var(--wda-slate-200);
}
.wda-meter-row {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  border-bottom: 1px solid var(--wda-slate-200);
}
.wda-meter-row > article {
  min-width: 0;
  border-right: 1px solid var(--wda-slate-200);
}
.wda-meter-row > article:last-child { border-right: 0; }

.wda-visual-panel {
  min-width: 0;
  min-height: 210px;
  padding: 14px;
  border-right: 1px solid var(--wda-slate-200);
  background: white;
}

.wda-visual-panel:last-child {
  border-right: 0;
}

.wda-visual-panel.navy {
  color: white;
  background: var(--wda-navy-950);
}

.wda-visual-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 9px;
}

.wda-visual-head span {
  color: var(--wda-blue-600);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.wda-visual-panel.navy .wda-visual-head span {
  color: var(--wda-blue-200);
}

.wda-visual-head h4 {
  margin: 4px 0 0;
  color: var(--wda-navy-950);
  font-size: 16px;
}

.wda-visual-panel.navy .wda-visual-head h4 {
  color: white;
}

.wda-line-chart {
  height: 138px;
}

.wda-line-chart svg {
  width: 100%;
  height: 100%;
}

.wda-chart-grid {
  stroke: #dce4eb;
  stroke-width: 1;
}

.wda-visual-panel.navy .wda-chart-grid {
  stroke: rgba(255,255,255,.14);
}

.wda-chart-line {
  fill: none;
  stroke: #326da8;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wda-visual-panel.navy .wda-chart-line {
  stroke: #8ebce4;
}

.wda-chart-area {
  fill: rgba(50,109,168,.12);
}

.wda-visual-panel.navy .wda-chart-area {
  fill: rgba(142,188,228,.16);
}

.wda-chart-point {
  fill: white;
  stroke: #326da8;
  stroke-width: 2.5;
}

.wda-visual-panel.navy .wda-chart-point {
  fill: var(--wda-navy-950);
  stroke: #8ebce4;
}

.wda-gauge-wrap,
.wda-donut-wrap {
  display: grid;
  min-height: 150px;
  place-items: center;
  text-align: center;
}

.wda-gauge {
  position: relative;
  width: 140px;
  aspect-ratio: 2 / 1.08;
  overflow: hidden;
}

.wda-gauge-arc {
  position: absolute;
  inset: 0;
  border-radius: 140px 140px 0 0;
  background: conic-gradient(
    from 270deg at 50% 100%,
    #b34141 0 18%,
    #d39431 18% 38%,
    #128264 38% 50%,
    transparent 50% 100%
  );
}

.wda-gauge-inner {
  position: absolute;
  inset: 18px 18px 0;
  border-radius: 116px 116px 0 0;
  background: white;
}

.wda-gauge-needle {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 56px;
  height: 3px;
  transform-origin: 0 50%;
  transform: rotate(calc(-180deg + (var(--gauge-value, 0) * 1.8deg)));
  background: var(--wda-navy-950);
}

.wda-gauge-knob {
  position: absolute;
  left: calc(50% - 10px);
  bottom: -2px;
  width: 20px;
  height: 20px;
  border: 5px solid white;
  border-radius: 50%;
  background: var(--wda-navy-950);
  box-shadow: 0 0 0 1px var(--wda-slate-300);
}

.wda-gauge-value {
  margin-top: -4px;
  color: var(--wda-navy-950);
  font-size: 26px;
  font-weight: 850;
}

.wda-gauge-label {
  color: var(--wda-slate-500);
  font-size: 11px;
}

.wda-donut {
  display: grid;
  width: 126px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(
    var(--wda-blue-600) calc(var(--donut-value,0) * 1%),
    var(--wda-slate-100) 0
  );
}

.wda-donut::before {
  content: "";
  grid-area: 1 / 1;
  width: 88px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: white;
}

.wda-donut-copy {
  position: relative;
  z-index: 1;
  grid-area: 1 / 1;
}

.wda-donut-copy strong,
.wda-donut-copy span {
  display: block;
}

.wda-donut-copy strong {
  color: var(--wda-navy-950);
  font-size: 25px;
}

.wda-donut-copy span {
  color: var(--wda-slate-500);
  font-size: 10px;
}

.wda-group-distribution {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(300px,.65fr);
}
.wda-group-distribution-single { grid-template-columns: 1fr; }

.wda-bars-panel,
.wda-pie-panel {
  min-height: 170px;
  padding: 14px;
  background: white;
}

.wda-bars-panel {
  border-right: 1px solid var(--wda-slate-200);
}

.wda-bar-list {
  display: grid;
  gap: 13px;
  margin-top: 18px;
}

.wda-bar-row {
  display: grid;
  gap: 6px;
}

.wda-bar-row header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--wda-slate-700);
  font-size: 11px;
}

.wda-bar-track {
  height: 10px;
  overflow: hidden;
  background: var(--wda-slate-100);
}

.wda-bar-fill {
  height: 100%;
  background: linear-gradient(90deg,var(--wda-navy-800),var(--wda-blue-400));
}

.wda-pie-layout {
  display: flex;
  min-height: 145px;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.wda-pie {
  width: 118px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--pie-background, conic-gradient(#326da8 0 100%));
}

.wda-pie::after {
  content: "";
  display: block;
  width: 62px;
  aspect-ratio: 1;
  margin: 28px;
  border-radius: 50%;
  background: white;
}

.wda-pie-legend {
  display: grid;
  gap: 8px;
}

.wda-pie-legend div {
  display: grid;
  grid-template-columns: 9px minmax(0,1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--wda-slate-700);
  font-size: 11px;
}

.wda-pie-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.wda-meter-pie-panel {
  min-height: 210px;
  padding: 14px;
  background: #fff;
}
.wda-meter-pie-panel .wda-pie-layout { min-height: 145px; }

@media (max-width: 1300px) {
  .wda-group-overview {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }

  .wda-analytic-card:nth-child(3n) {
    border-right: 0;
  }

}

@media (max-width: 900px) {
  .wda-meter-row,
  .wda-group-distribution {
    grid-template-columns: 1fr;
  }

  .wda-meter-row > article,
  .wda-visual-panel,
  .wda-bars-panel {
    border-right: 0;
    border-bottom: 1px solid var(--wda-slate-200);
  }
}

@media (max-width: 620px) {
  .wda-group-overview {
    grid-template-columns: 1fr;
  }

  .wda-analytic-card {
    border-right: 0;
    border-bottom: 1px solid var(--wda-slate-200);
  }

  .wda-group-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .wda-group-head p:last-child { text-align: left; }
}

/* =========================================================
   PROGRESSIVE BUTTON / DOUBLE-SUBMIT GUARD
========================================================= */

button.wda-is-processing,
input[type="submit"].wda-is-processing,
[role="button"].wda-is-processing {
  position: relative;
  cursor: progress !important;
  opacity: .48 !important;
  filter: saturate(.45);
  pointer-events: none !important;
  transform: none !important;
  transition: opacity 140ms ease, filter 140ms ease;
}

button.wda-is-processing::after,
[role="button"].wda-is-processing::after {
  content: "";
  width: 13px;
  height: 13px;
  margin-left: 9px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: wdaButtonSpin .72s linear infinite;
}

@keyframes wdaButtonSpin {
  to { transform: rotate(360deg); }
}

#dataAdminWorkspace button:disabled,
#dataAdminWorkspace input[type="submit"]:disabled,
.wda-row-detail-drawer button:disabled {
  cursor: not-allowed;
}


/* =========================================================
   REAL STORAGE ANALYTICS V24
========================================================= */

.wda-real-trend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--wda-slate-200);
}

.wda-real-trend-grid .wda-visual-panel {
  border-right: 1px solid rgba(255,255,255,.12);
}

.wda-real-meter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--wda-slate-200);
}

.wda-real-distribution-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(280px,.72fr);
}

.wda-real-distribution-grid > article {
  min-width: 0;
  border-right: 1px solid var(--wda-slate-200);
}

.wda-real-distribution-grid > article:last-child {
  border-right: 0;
}

.wda-real-distribution-grid .wda-bar-list {
  max-height: 330px;
  overflow-y: auto;
  padding-right: 6px;
}

.wda-real-distribution-grid .wda-bar-row header span {
  max-width: 75%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wda-line-chart.compact {
  height: 150px;
}

#wdaAnalyticsScan {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--wda-blue-600);
  color: var(--wda-blue-600);
  background: white;
  font-weight: 800;
}

#wdaAnalyticsScan:hover {
  color: white;
  background: var(--wda-blue-600);
}

#wdaAnalyticsScan:disabled {
  cursor: progress;
  opacity: .55;
}

@media (max-width: 1050px) {
  .wda-real-trend-grid,
  .wda-real-meter-grid {
    grid-template-columns: 1fr;
  }

  .wda-real-distribution-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .wda-real-distribution-grid .wda-pie-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .wda-real-distribution-grid {
    grid-template-columns: 1fr;
  }

  .wda-real-distribution-grid .wda-pie-panel {
    grid-column: auto;
  }
}


/* =========================================================
   V26 VISIBILITY + LEGENDS
========================================================= */

.wda-visual-panel.chart-light {
  background: linear-gradient(180deg, #f9fbfd 0%, #eef4f8 100%);
}

.wda-visual-panel.chart-light .wda-visual-head h4,
.wda-visual-panel.soft-panel .wda-visual-head h4 {
  color: var(--wda-navy-950);
}

.wda-visual-panel.chart-light .wda-chart-grid {
  stroke: #cfdae4;
}

.wda-visual-panel.chart-light .wda-chart-line {
  stroke: #245a92;
}

.wda-visual-panel.chart-light .wda-chart-area {
  fill: rgba(36,90,146,.14);
}

.wda-visual-panel.chart-light .wda-chart-point {
  fill: #ffffff;
  stroke: #245a92;
}

.wda-chart-legend-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(36,90,146,.12);
}

.wda-chart-legend-grid div {
  min-width: 0;
}

.wda-chart-legend-grid span {
  display: block;
  color: var(--wda-slate-500);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.wda-chart-legend-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--wda-navy-900);
  font-size: 15px;
}

.wda-status-chip-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin-top: 12px;
}

.wda-status-chip-row.measurement {
  grid-template-columns: repeat(4, minmax(0,1fr));
}

.wda-status-chip {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--wda-slate-200);
  background: var(--wda-slate-050);
}

.wda-status-chip i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
  background: var(--wda-slate-300);
}

.wda-status-chip i.exact { background: #326da8; }
.wda-status-chip i.estimated { background: #68a1d6; }
.wda-status-chip i.partial { background: #d39431; }
.wda-status-chip i.unavailable { background: #b34141; }

.wda-status-chip span {
  display: block;
  color: var(--wda-slate-500);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.wda-status-chip strong {
  margin-left: auto;
  color: var(--wda-navy-950);
  font-size: 16px;
}

.wda-storage-detail-panel {
  padding: 18px var(--wda-page-pad) 22px;
  border-top: 1px solid var(--wda-slate-200);
  background: white;
}

.wda-storage-detail-panel .wda-visual-head {
  margin-bottom: 12px;
}

.wda-storage-detail-panel .wda-visual-head p {
  max-width: 480px;
  margin: 0;
  color: var(--wda-slate-500);
  line-height: 1.5;
}

.wda-source-table-wrap {
  overflow: auto;
  border: 1px solid var(--wda-slate-200);
}

.wda-source-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

.wda-source-table th,
.wda-source-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--wda-slate-200);
  text-align: left;
  vertical-align: middle;
}

.wda-source-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--wda-slate-500);
  background: #f8fbfd;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.wda-source-table td {
  color: var(--wda-navy-900);
  font-size: 13px;
}

.wda-source-table tbody tr:hover td {
  background: #fbfdff;
}

.wda-accuracy-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  color: white;
  background: var(--wda-slate-400);
  font-size: 11px;
  font-weight: 800;
  text-transform: capitalize;
}

.wda-accuracy-pill.exact { background: #326da8; }
.wda-accuracy-pill.estimated { background: #68a1d6; }
.wda-accuracy-pill.partial { background: #d39431; }
.wda-accuracy-pill.unavailable,
.wda-accuracy-pill.unknown { background: #b34141; }

@media (max-width: 1220px) {
  .wda-chart-legend-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .wda-status-chip-row,
  .wda-status-chip-row.measurement,
  .wda-chart-legend-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .wda-status-chip-row,
  .wda-status-chip-row.measurement,
  .wda-chart-legend-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   V27 LIVE LOCAL INVENTORY CONNECTION
========================================================= */

.wda-analytics-toolbar button {
  white-space: nowrap;
}

.wda-analytic-card small {
  min-height: 24px;
}

.wda-source-table td:first-child {
  font-weight: 750;
}

.wda-source-table td:nth-child(2),
.wda-source-table td:nth-child(3),
.wda-source-table td:nth-child(5),
.wda-source-table td:nth-child(6) {
  font-variant-numeric: tabular-nums;
}
