/* Demonstration pages (dashboard, operation) · shared layout on styles.css tokens */

/* ---------- KPI row ---------- */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-panel);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.kpi-card-accent { border-top: 3px solid var(--color-red-cross); }
.kpi-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--color-ink-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ---------- Dashboard board ---------- */

.board-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(260px, 3fr);
  gap: 14px;
  align-items: stretch;
}
.board-map {
  position: relative;
  min-height: 520px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-panel);
  overflow: hidden;
  background: var(--color-surface);
}
.board-map arcgis-map { position: absolute; inset: 0; display: block; }

.board-side {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-panel);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.board-side-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-ink-strong);
}
.top-five { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.top-five-hint { font-size: 13px; color: var(--color-subtle); }
.top-five-row {
  width: 100%;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 8px;
  align-items: baseline;
  text-align: left;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-control);
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
}
.top-five-row:hover { border-color: var(--color-red-cross); }
.top-five-mag { font-family: var(--font-mono); font-weight: 700; font-size: 13px; color: var(--color-red-dark); }
.top-five-place { font-size: 12px; color: var(--color-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-five-when { font-size: 11px; color: var(--color-subtle); white-space: nowrap; }

.histogram { display: grid; gap: 5px; }
.hist-row {
  display: grid;
  grid-template-columns: 52px 1fr 44px;
  gap: 8px;
  align-items: center;
}
.hist-label { font-size: 11px; color: var(--color-muted); }
.hist-bar { height: 10px; border-radius: 5px; overflow: hidden; background: var(--color-surface-raised); }
.hist-fill { display: block; height: 100%; background: var(--color-red-cross); border-radius: 5px; }
.hist-count { font-family: var(--font-mono); font-size: 11px; color: var(--color-ink); text-align: right; }

.board-refresh { margin: auto 0 0; font-size: 11px; color: var(--color-subtle); }

/* ---------- Operation frame ---------- */

.ops-frame {
  position: relative;
  height: 620px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-panel);
  overflow: hidden;
  background: var(--color-surface);
}
.ops-frame arcgis-map { position: absolute; inset: 0; display: block; }

.ops-card {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 300px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-top: 3px solid var(--color-red-cross);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-panel);
  padding: 16px 18px;
  z-index: 6;
}
.ops-card-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: none;
  font-size: 20px;
  color: var(--color-muted);
  cursor: pointer;
  line-height: 1;
}
.ops-card-close:hover { color: var(--color-ink-strong); }
.ops-card-kicker {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-red-dark);
}
.ops-card-title { margin: 0 0 8px; font-size: 18px; line-height: 1.25; color: var(--color-ink-strong); }
.ops-card-body p { margin: 0 0 4px; font-size: 13px; color: var(--color-ink); }

.ops-legend {
  position: absolute;
  left: 16px;
  bottom: 28px;
  z-index: 5;
  display: flex;
  gap: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-control);
  padding: 7px 12px;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-ink); }
.legend-swatch { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.legend-radar { background: linear-gradient(90deg, #7ec97e, #e8d24d, #d8001b); }
.legend-cone { background: rgba(120, 120, 130, 0.45); }
.legend-chapter { background: transparent; border: 1.5px solid rgba(216, 0, 27, 0.6); }

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .board-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .ops-frame { height: 480px; }
  .ops-card { left: 12px; right: 12px; width: auto; }
}

/* Two-card KPI row (Demo 3 storms) */
.kpi-row-pair { grid-template-columns: 1fr 1fr; max-width: 620px; }
