/**
 * KSE Hero Dashboard — hyper-modern command center illustration
 */

.kse-hero__dashboard-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(1240px, 100%);
  margin: 0 auto;
  padding: 0 clamp(0.75rem, 3vw, 1.5rem) clamp(2.5rem, 6vw, 4.5rem);
  flex-shrink: 0;
  --dash-lift: 6px;
  box-sizing: border-box;
}

/* Scale-to-fit viewport — preserves desktop layout on mobile */
.kse-hero__dashboard-viewport {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.kse-hero__dashboard-scaler {
  position: relative;
}

.kse-hero__dashboard-glow {
  position: absolute;
  inset: -8% 4% 12%;
  background: radial-gradient(ellipse 60% 50% at 50% 30%, rgba(68, 82, 214, 0.18) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.kse-hero__dashboard-scaler::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(123, 133, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.1) 30%,
    rgba(68, 82, 214, 0.18) 55%,
    rgba(123, 133, 255, 0.35) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 3;
}

.kse-dashboard {
  position: relative;
  z-index: 1;
  width: 1140px;
  max-width: none;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(16, 16, 28, 0.98) 0%, rgba(4, 4, 12, 0.99) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--kse-mock-shadow-dark);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.88);
  text-align: left;
  overflow: hidden;
  transform: translateY(var(--dash-lift));
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease;
}

.kse-hero__dashboard-wrap.is-visible .kse-dashboard {
  --dash-lift: 0px;
  transform: translateY(0);
  box-shadow: var(--kse-mock-shadow-dark-lifted);
}

.kse-dashboard__defs { position: absolute; overflow: hidden; }

/* Chrome */
.kse-dashboard__chrome {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.kse-dashboard__dots { display: flex; gap: 0.35rem; }

.kse-dashboard__dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.3);
}

.kse-dashboard__dots span:nth-child(1) { background: #f87171; }
.kse-dashboard__dots span:nth-child(2) { background: #fbbf24; }
.kse-dashboard__dots span:nth-child(3) { background: #34d399; }

.kse-dashboard__tabs {
  display: flex;
  gap: 0.15rem;
  padding: 0.15rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.kse-dashboard__tabs span {
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.55rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
}

.kse-dashboard__tabs span.is-active {
  background: rgba(68, 82, 214, 0.35);
  color: #fff;
  box-shadow: 0 0 12px rgba(68, 82, 214, 0.3);
}

.kse-dashboard__url {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-family: var(--kse-mono);
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.45);
}

.kse-dashboard__url ion-icon { font-size: 0.72rem; color: #34d399; }

.kse-dashboard__sync {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--kse-mono);
  font-size: 0.52rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.kse-dashboard__sync-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #34d399;
}

@keyframes kse-sync-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* Live ticker */
.kse-dashboard__ticker {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(90deg, rgba(68, 82, 214, 0.12) 0%, rgba(0, 0, 0, 0.35) 8%, rgba(0, 0, 0, 0.35) 100%);
  overflow: hidden;
}

.kse-dashboard__ticker-label {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 0.65rem;
  font-family: var(--kse-mono);
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--kse-brand-bright);
  background: rgba(68, 82, 214, 0.35);
  border-right: 1px solid rgba(123, 133, 255, 0.35);
  box-shadow: inset -8px 0 16px rgba(68, 82, 214, 0.2);
}

.kse-dashboard__ticker-static {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0.38rem 0.75rem;
  font-family: var(--kse-mono);
  font-size: 0.52rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.42);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Shell */
.kse-dashboard__shell {
  display: grid;
  grid-template-columns: 168px 1fr;
}

.kse-dashboard__sidebar {
  display: flex;
  flex-direction: column;
  padding: 0.85rem 0.7rem;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(68, 82, 214, 0.06) 100%);
}

.kse-dashboard__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
  padding: 0 0.25rem;
}

.kse-dashboard__brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--kse-brand), var(--kse-brand-mid));
  font-family: var(--kse-mono);
  font-size: 0.52rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 4px 16px rgba(68, 82, 214, 0.45);
}

.kse-dashboard__brand-name {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.kse-dashboard__brand-sub {
  display: block;
  font-size: 0.52rem;
  color: rgba(255, 255, 255, 0.35);
}

.kse-dashboard__nav-label {
  margin: 0 0 0.35rem;
  padding: 0 0.45rem;
  font-family: var(--kse-mono);
  font-size: 0.48rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
}

.kse-dashboard__nav-label:not(:first-of-type) { margin-top: 0.85rem; }

.kse-dashboard__nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.kse-dashboard__nav-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.5rem;
  border-radius: 8px;
  font-size: 0.62rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.42);
  transition: background 0.2s, color 0.2s;
}

.kse-dashboard__nav-item ion-icon { font-size: 0.88rem; opacity: 0.75; }

.kse-dashboard__nav-item.is-active {
  background: linear-gradient(90deg, rgba(68, 82, 214, 0.35) 0%, rgba(68, 82, 214, 0.12) 100%);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(123, 133, 255, 0.35), 0 4px 16px rgba(68, 82, 214, 0.15);
}

.kse-dashboard__nav-item.is-active ion-icon { opacity: 1; color: var(--kse-brand-bright); }

.kse-dashboard__nav-item b {
  margin-left: auto;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.2);
  font-size: 0.45rem;
  font-weight: 600;
  font-style: normal;
  color: #34d399;
  letter-spacing: 0.04em;
}

.kse-dashboard__nav-count {
  margin-left: auto;
  font-family: var(--kse-mono);
  font-size: 0.48rem;
  color: rgba(255, 255, 255, 0.35);
}

.kse-dashboard__nav-count--warn { color: #fbbf24; }

.kse-dashboard__sidebar-foot {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.52rem;
  color: rgba(255, 255, 255, 0.3);
}

.kse-dashboard__sidebar-foot kbd {
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--kse-mono);
  font-size: 0.48rem;
}

/* Main */
.kse-dashboard__main {
  position: relative;
  z-index: 4;
  padding: 0.85rem 1rem 1.15rem;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(68, 82, 214, 0.08) 0%, transparent 55%);
}

.kse-dashboard__topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.kse-dashboard__topbar-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.2rem;
  font-family: var(--kse-mono);
  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}

.kse-dashboard__live-pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #34d399;
}

.kse-dashboard__topbar-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: #fff;
}

.kse-dashboard__topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.kse-dashboard__search {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.35);
}

.kse-dashboard__search kbd {
  margin-left: 0.35rem;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--kse-mono);
  font-size: 0.48rem;
  color: rgba(255, 255, 255, 0.3);
}

.kse-dashboard__search ion-icon { font-size: 0.78rem; }

.kse-dashboard__icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
}

.kse-dashboard__icon-btn em {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 0.85rem;
  height: 0.85rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: #f87171;
  font-style: normal;
  font-size: 0.45rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kse-dashboard__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--kse-brand), var(--kse-brand-bright));
  font-size: 0.52rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(68, 82, 214, 0.4);
}

/* KPIs */
.kse-dashboard__kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.kse-dashboard__kpi {
  position: relative;
  padding: 0.6rem 0.7rem;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.kse-dashboard__kpi::after {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 40%;
  height: 60%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 133, 255, 0.2) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.kse-dashboard__kpi:hover::after { opacity: 1; }

.kse-dashboard__kpi::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(68, 82, 214, 0.15) 0%, transparent 55%);
  pointer-events: none;
}

.kse-dashboard__kpi:hover {
  border-color: rgba(123, 133, 255, 0.3);
  box-shadow: 0 8px 24px rgba(68, 82, 214, 0.15);
  transform: translateY(-2px);
}

.kse-dashboard__kpi--ring { text-align: center; }
.kse-dashboard__kpi--accent {
  background: linear-gradient(135deg, rgba(68, 82, 214, 0.18) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-color: rgba(68, 82, 214, 0.25);
}

.kse-dashboard__kpi p {
  position: relative;
  margin: 0 0 0.35rem;
  font-size: 0.52rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.38);
}

.kse-dashboard__kpi strong {
  position: relative;
  display: block;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kse-dashboard__kpi-unit {
  font-size: 0.65rem;
  font-weight: 500;
  opacity: 0.65;
}

.kse-dashboard__kpi em {
  position: relative;
  display: block;
  margin-top: 0.2rem;
  font-style: normal;
  font-size: 0.48rem;
  color: rgba(255, 255, 255, 0.32);
}

.kse-dashboard__kpi-trend--up { color: #34d399 !important; }
.kse-dashboard__kpi-trend--down { color: #fbbf24 !important; }

.kse-dashboard__ring-wrap {
  position: relative;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 0.25rem;
}

.kse-dashboard__ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.kse-dashboard__ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3;
}

.kse-dashboard__ring-fill {
  fill: none;
  stroke: url(#kseRingGrad);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 113;
  stroke-dashoffset: 113;
  transition: stroke-dashoffset 1.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.kse-dashboard.is-live .kse-dashboard__ring-fill {
  stroke-dashoffset: var(--ring-offset, 7);
}

.kse-dashboard__ring-wrap strong {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.kse-dashboard__spark {
  display: block;
  width: 100%;
  height: 18px;
  margin: 0.25rem 0;
}

.kse-dashboard__spark path {
  fill: none;
  stroke: var(--kse-brand-bright);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  opacity: 0.7;
  transition: stroke-dashoffset 1.5s ease 0.3s;
}

.kse-dashboard.is-live .kse-dashboard__spark path {
  stroke-dashoffset: 0;
}

.kse-dashboard__spark--warn path { stroke: #fbbf24; opacity: 0.6; }

.kse-dashboard__coverage-bar {
  height: 3px;
  margin: 0.35rem 0 0.15rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.kse-dashboard__coverage-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--kse-brand), var(--kse-brand-bright));
  box-shadow: 0 0 8px rgba(68, 82, 214, 0.5);
  transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.4s;
}

.kse-dashboard.is-live .kse-dashboard__coverage-bar span {
  width: calc(var(--bar, 99) * 1%);
}

/* Panels */
.kse-dashboard__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.kse-dashboard__bottom {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.75fr;
  gap: 0.5rem;
  align-items: stretch;
}

.kse-dashboard__map-panel,
.kse-dashboard__status-panel,
.kse-dashboard__heat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.kse-dashboard__bottom .kse-dashboard__panel-head {
  flex-shrink: 0;
}

.kse-dashboard__chart-panel,
.kse-dashboard__alerts-panel,
.kse-dashboard__map-panel,
.kse-dashboard__status-panel,
.kse-dashboard__heat-panel {
  position: relative;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.kse-dashboard__chart-panel::before,
.kse-dashboard__alerts-panel::before,
.kse-dashboard__map-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(110, 231, 255, 0.35), transparent);
  opacity: 0.6;
  pointer-events: none;
}

.kse-dashboard__insight {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0.55rem 0.25rem;
  padding: 0.32rem 0.55rem;
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(68, 82, 214, 0.22) 0%, rgba(123, 133, 255, 0.08) 100%);
  border: 1px solid rgba(123, 133, 255, 0.25);
  font-size: 0.52rem;
  color: rgba(110, 231, 255, 0.85);
  box-shadow: 0 0 20px rgba(68, 82, 214, 0.15);
}

.kse-dashboard__insight ion-icon {
  font-size: 0.75rem;
  color: var(--kse-brand-bright);
  animation: kse-insight-spark 2s ease-in-out infinite;
}

@keyframes kse-insight-spark {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

.kse-dashboard__chart-panel:hover,
.kse-dashboard__alerts-panel:hover,
.kse-dashboard__map-panel:hover,
.kse-dashboard__status-panel:hover,
.kse-dashboard__heat-panel:hover {
  border-color: rgba(123, 133, 255, 0.25);
  box-shadow: 0 4px 20px rgba(68, 82, 214, 0.12);
}

.kse-dashboard__panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.55rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.42);
}

.kse-dashboard__head-badge {
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
  font-family: var(--kse-mono);
  font-size: 0.48rem;
}

.kse-dashboard__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(68, 82, 214, 0.35);
  color: var(--kse-brand-bright);
  font-family: var(--kse-mono);
  font-size: 0.48rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kse-dashboard__pill--ok {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

.kse-dashboard__pill-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

/* Chart */
.kse-dashboard__chart-wrap {
  position: relative;
  padding: 0.35rem 0.5rem 0.5rem;
}

.kse-dashboard__chart {
  display: block;
  width: 100%;
  height: 72px;
}

.kse-dashboard__chart-grid {
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 1;
}

.kse-dashboard__chart-line {
  fill: none;
  stroke: var(--kse-brand-bright);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kse-dashboard__chart-area { fill: url(#kseDashFill); opacity: 0; transition: opacity 1.2s ease 0.6s; }
.kse-dashboard.is-live .kse-dashboard__chart-area { opacity: 1; }

.kse-dashboard__chart-dot {
  fill: #fff;
  opacity: 0;
  transition: opacity 0.4s ease 1.2s;
}

.kse-dashboard.is-live .kse-dashboard__chart-dot {
  opacity: 1;
}

.kse-dashboard__chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
  margin-top: 0.35rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.kse-dashboard__chart-bars span {
  flex: 1;
  height: 0;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, rgba(123, 133, 255, 0.5) 0%, rgba(68, 82, 214, 0.15) 100%);
  transition: height 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i, 0) * 0.05s);
}

.kse-dashboard.is-live .kse-dashboard__chart-bars span {
  height: var(--h);
}

.kse-dashboard__chart-bars span:nth-child(1) { --i: 0; }
.kse-dashboard__chart-bars span:nth-child(2) { --i: 1; }
.kse-dashboard__chart-bars span:nth-child(3) { --i: 2; }
.kse-dashboard__chart-bars span:nth-child(4) { --i: 3; }
.kse-dashboard__chart-bars span:nth-child(5) { --i: 4; }
.kse-dashboard__chart-bars span:nth-child(6) { --i: 5; }
.kse-dashboard__chart-bars span:nth-child(7) { --i: 6; }
.kse-dashboard__chart-bars span:nth-child(8) { --i: 7; }

/* Alerts */
.kse-dashboard__alerts {
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kse-dashboard__alert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.5rem;
  border-radius: 7px;
  font-size: 0.55rem;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.4s ease, transform 0.4s ease, background 0.2s;
}

.kse-dashboard.is-live .kse-dashboard__alert {
  opacity: 1;
  transform: translateX(0);
}

.kse-dashboard.is-live .kse-dashboard__alert:nth-child(1) { transition-delay: 0.5s; }
.kse-dashboard.is-live .kse-dashboard__alert:nth-child(2) { transition-delay: 0.65s; }
.kse-dashboard.is-live .kse-dashboard__alert:nth-child(3) { transition-delay: 0.8s; }
.kse-dashboard.is-live .kse-dashboard__alert:nth-child(4) { transition-delay: 0.95s; }

.kse-dashboard__alert:hover { background: rgba(255, 255, 255, 0.04); }

.kse-dashboard__alert-tag {
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: var(--kse-mono);
  font-size: 0.45rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.kse-dashboard__alert--high .kse-dashboard__alert-tag {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
}

.kse-dashboard__alert--med .kse-dashboard__alert-tag {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
}

.kse-dashboard__alert--low .kse-dashboard__alert-tag {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
}

.kse-dashboard__alert-msg {
  color: rgba(255, 255, 255, 0.58);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kse-dashboard__alert time {
  font-family: var(--kse-mono);
  font-size: 0.48rem;
  color: rgba(255, 255, 255, 0.28);
}

/* Graph */
.kse-dashboard__graph {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  margin: 0.45rem 0.55rem 0.55rem;
  border-radius: 9px;
  background:
    radial-gradient(ellipse 55% 70% at 50% 52%, rgba(68, 82, 214, 0.14) 0%, transparent 70%),
    rgba(68, 82, 214, 0.06);
  border: 1px solid rgba(68, 82, 214, 0.18);
  overflow: hidden;
}

.kse-dashboard__graph-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(68, 82, 214, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68, 82, 214, 0.07) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.55;
  mask-image: radial-gradient(ellipse 85% 80% at 50% 50%, #000 20%, transparent 100%);
}

.kse-dashboard__graph-radar {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(72%, 11rem);
  height: min(88%, 100%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.kse-dashboard__graph-radar span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(123, 133, 255, 0.25);
  opacity: 0;
}

.kse-dashboard.is-live .kse-dashboard__graph-radar span {
  animation: kse-radar-ring 3.5s ease-out infinite;
}

.kse-dashboard__graph-radar span:nth-child(1) { animation-delay: 0s; }
.kse-dashboard__graph-radar span:nth-child(2) { animation-delay: 1.15s; }
.kse-dashboard__graph-radar span:nth-child(3) { animation-delay: 2.3s; }

@keyframes kse-radar-ring {
  0% { transform: scale(0.35); opacity: 0.65; }
  100% { transform: scale(1.15); opacity: 0; }
}

.kse-dashboard__graph-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.kse-dashboard__graph-hub-glow {
  fill: url(#kseGraphHubGlow);
  opacity: 0;
  transition: opacity 1s ease 0.3s;
}

.kse-dashboard.is-live .kse-dashboard__graph-hub-glow {
  opacity: 1;
}

.kse-dashboard__graph-hub-ring {
  fill: none;
  stroke: rgba(123, 133, 255, 0.35);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.6s ease 0.5s;
}

.kse-dashboard.is-live .kse-dashboard__graph-hub-ring {
  opacity: 1;
  animation: kse-hub-ring-spin 24s linear infinite;
}

@keyframes kse-hub-ring-spin {
  to { transform: rotate(360deg); }
}

.kse-dashboard__graph-edge {
  fill: none;
  stroke: url(#kseGraphEdge);
  stroke-width: 1.25;
  stroke-linecap: round;
  filter: url(#kseGraphGlow);
  stroke-dasharray: 280;
  stroke-dashoffset: 280;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.kse-dashboard__graph-edge--cross {
  stroke: url(#kseGraphEdgeCross);
  stroke-width: 1;
  stroke-dasharray: 6 5;
  opacity: 0.7;
}

.kse-dashboard.is-live .kse-dashboard__graph-edge {
  stroke-dashoffset: 0;
}

.kse-dashboard__graph-edge:nth-child(2) { transition-delay: 0.45s; }
.kse-dashboard__graph-edge:nth-child(3) { transition-delay: 0.55s; }
.kse-dashboard__graph-edge:nth-child(4) { transition-delay: 0.65s; }
.kse-dashboard__graph-edge:nth-child(5) { transition-delay: 0.15s; }
.kse-dashboard__graph-edge:nth-child(6) { transition-delay: 0.25s; }
.kse-dashboard__graph-edge:nth-child(7) { transition-delay: 0.35s; }
.kse-dashboard__graph-edge:nth-child(8) { transition-delay: 0.5s; }
.kse-dashboard__graph-edge:nth-child(9) { transition-delay: 0.6s; }
.kse-dashboard__graph-edge:nth-child(10) { transition-delay: 0.7s; }
.kse-dashboard__graph-edge:nth-child(11) { transition-delay: 0.8s; }

.kse-dashboard__node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%) scale(0.85);
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.2rem 0.42rem;
  border-radius: 6px;
  background: rgba(8, 10, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--kse-mono);
  font-size: 0.46rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.72);
  z-index: 2;
  opacity: 0;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: opacity 0.45s ease, transform 0.45s ease, border-color 0.2s, box-shadow 0.2s;
  transition-delay: calc(0.35s + var(--d, 0) * 0.08s);
}

.kse-dashboard.is-live .kse-dashboard__node {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.kse-dashboard__node-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--node-accent, #34d399);
  box-shadow: 0 0 6px var(--node-accent, #34d399);
  flex-shrink: 0;
}

.kse-dashboard__node--monitor { --node-accent: #34d399; border-color: rgba(52, 211, 153, 0.25); }
.kse-dashboard__node--assess { --node-accent: #fbbf24; border-color: rgba(251, 191, 36, 0.25); }
.kse-dashboard__node--simulate { --node-accent: #a78bfa; border-color: rgba(167, 139, 250, 0.25); }
.kse-dashboard__node--govern { --node-accent: var(--kse-brand-bright); border-color: rgba(123, 133, 255, 0.35); }

.kse-dashboard__node--hub {
  left: 50%;
  top: 50%;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  padding: 0.32rem 0.55rem 0.28rem;
  background: linear-gradient(145deg, var(--kse-brand-mid), var(--kse-brand));
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  box-shadow:
    0 0 24px rgba(68, 82, 214, 0.55),
    0 0 0 1px rgba(110, 231, 255, 0.15) inset;
  transition-delay: 0.1s;
  z-index: 3;
}

.kse-dashboard__node-core {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.kse-dashboard__node-sub {
  font-size: 0.38rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.kse-dashboard__node--hub { position: absolute; }

/* Status */
.kse-dashboard__status-list {
  margin: 0;
  padding: 0.4rem 0.55rem 0.55rem;
  list-style: none;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  gap: 0.4rem;
}

.kse-dashboard__status-list li {
  display: grid;
  grid-template-columns: auto 1fr 2.5rem auto;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.55rem;
}

.kse-dashboard__status-name {
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kse-dashboard__status-track {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.kse-dashboard__status-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--kse-brand), #34d399);
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.kse-dashboard.is-live .kse-dashboard__status-track span {
  width: calc(var(--bar, 0) * 1%);
}

.kse-dashboard__status-val {
  font-family: var(--kse-mono);
  font-size: 0.48rem;
  color: rgba(255, 255, 255, 0.35);
  text-align: right;
}

.kse-dashboard__status-val--warn { color: #fbbf24; }

.kse-dashboard__status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.5);
}

.kse-dashboard__status-dot--warn {
  background: #fbbf24;
}

/* Heatmap */
.kse-dashboard__heatmap {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  flex: 1 1 auto;
  align-content: stretch;
  padding: 0.45rem 0.55rem 0.6rem;
}

.kse-dashboard__heatmap span {
  aspect-ratio: 1;
  border-radius: 3px;
  background: rgba(68, 82, 214, calc(var(--o) * 0.85));
  border: 1px solid rgba(123, 133, 255, calc(var(--o) * 0.3));
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.kse-dashboard.is-live .kse-dashboard__heatmap span {
  opacity: 1;
  transform: scale(1);
}

.kse-dashboard.is-live .kse-dashboard__heatmap span:nth-child(n) {
  transition-delay: calc(0.03s * var(--i, 0));
}

.kse-dashboard__heatmap span:nth-child(1) { --i: 1; }
.kse-dashboard__heatmap span:nth-child(2) { --i: 2; }
.kse-dashboard__heatmap span:nth-child(3) { --i: 3; }
.kse-dashboard__heatmap span:nth-child(4) { --i: 4; }
.kse-dashboard__heatmap span:nth-child(5) { --i: 5; }
.kse-dashboard__heatmap span:nth-child(6) { --i: 6; }
.kse-dashboard__heatmap span:nth-child(7) { --i: 7; }
.kse-dashboard__heatmap span:nth-child(8) { --i: 8; }
.kse-dashboard__heatmap span:nth-child(9) { --i: 9; }
.kse-dashboard__heatmap span:nth-child(10) { --i: 10; }

@media (prefers-reduced-motion: reduce) {
  .kse-dashboard__shine,
  .kse-dashboard__scan,
  .kse-dashboard__sync-dot,
  .kse-dashboard__pill-dot,
  .kse-dashboard__node-pulse,
  .kse-dashboard__node-orbit,
  .kse-dashboard__chart-dot,
  .kse-dashboard__ticker-inner,
  .kse-dashboard__ambient,
  .kse-dashboard__graph-radar span,
  .kse-dashboard__graph-hub-ring,
  .kse-dashboard__insight ion-icon,
  .kse-hero__dashboard-glow,
  .kse-hero__dashboard-orbit,
  .kse-hero__dashboard-scaler::before {
    animation: none !important;
  }
  .kse-dashboard { transform: none; --dash-tilt-x: 0deg; --dash-tilt-y: 0deg; }
}
