:root{
  --color-bg:        #05101f;
  --color-bg-2:      #091a34;
  --color-primary:   #1d63ff;
  --color-teal:      #0ca7b6;
  --color-glow:      #22e4ff;
  --color-accent:    #ff9b26;
  --color-text-main: #f4fbff;
  --color-text-sub:  #9bb4d2;
  --color-text-on-light: #10263D;
  --color-text-on-light-sub: #4B6480;
  --color-border:    rgba(90,160,255,0.2);

  --card-bg: rgba(6,17,36,0.78);
  --card-bg-strong: rgba(4,12,28,0.9);
  --card-border: rgba(72,147,255,0.28);
  --card-shadow: 0 22px 60px rgba(0,0,0,0.42);
  --grid-line: rgba(90,160,255,0.09);

  --alert-1: #FF4444;
  --alert-2: #FF6A00;
  --alert-3: #F59E0B;
}

*{ box-sizing: border-box; }
html,body{
  margin:0; padding:0; height:100%; width:100%;
  overflow:hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(39,113,255,0.22), transparent 32%),
    radial-gradient(circle at 85% 22%, rgba(34,228,255,0.10), transparent 20%),
    radial-gradient(circle at 18% 75%, rgba(35,92,255,0.12), transparent 28%),
    linear-gradient(180deg, #030814 0%, #071325 34%, #08162d 100%);
  color: var(--color-text-main);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  letter-spacing: 0.2px;
}
body::after{
  content:"";
  position: fixed; inset:0;
  pointer-events:none;
  background:
    linear-gradient(90deg, rgba(7,18,36,0.24) 0%, transparent 12%, transparent 88%, rgba(7,18,36,0.24) 100%),
    radial-gradient(circle at 50% 0%, rgba(61,133,255,0.15), transparent 24%);
  z-index: 1;
}

/* scan-line overlay */
body::before{
  content:"";
  position: fixed; inset:0;
  pointer-events:none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.015) 0px,
    rgba(255,255,255,0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 9999;
  mix-blend-mode: overlay;
}

/* Layout */
.app{
  height:100vh; width:100vw;
  display:grid;
  grid-template-rows: 56px 1fr;
  position: relative;
  isolation: isolate;
}

/* ---------- TOP BAR ---------- */
.topbar{
  position: relative;
  z-index: 4;
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  align-items:center;
  height:56px;
  padding: 0 20px;
  background:
    linear-gradient(180deg, rgba(2,9,20,0.98) 0%, rgba(6,16,34,0.88) 100%);
  backdrop-filter: blur(18px) saturate(135%);
  box-shadow: 0 12px 28px rgba(0,0,0,0.26), inset 0 -1px 0 rgba(58,122,255,0.18);
}
.topbar::before{
  content:"";
  position:absolute;
  left:50%;
  top:4px;
  transform:translateX(-50%);
  width:min(560px, 42vw);
  height:46px;
  border:1px solid rgba(74,144,255,0.42);
  border-top-color: rgba(122,198,255,0.25);
  border-bottom-color: rgba(34,228,255,0.18);
  background:
    linear-gradient(180deg, rgba(12,31,63,0.16) 0%, rgba(4,14,29,0.02) 100%);
  clip-path: polygon(4% 0, 22% 0, 25% 18%, 75% 18%, 78% 0, 96% 0, 100% 50%, 96% 100%, 4% 100%, 0 50%);
  box-shadow:
    0 0 20px rgba(39,113,255,0.2),
    inset 0 0 18px rgba(34,228,255,0.05);
  pointer-events:none;
}
.topbar::after{
  content:"";
  position:absolute; left:0; right:0; bottom:0;
  height:1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(34,228,255,0) 8%,
    rgba(68,136,255,0.85) 26%,
    rgba(108,184,255,1) 50%,
    rgba(68,136,255,0.85) 74%,
    rgba(34,228,255,0) 92%,
    transparent 100%);
  box-shadow: 0 0 12px rgba(68,136,255,0.45);
}
.brand-left{ display:flex; align-items:center; gap:10px; color: #d9ebff; font-size:11px; letter-spacing:1px; min-width:200px; }
.brand-dot{ width:8px; height:8px; border-radius:50%; background: var(--color-glow); box-shadow: 0 0 8px var(--color-glow); animation: pulse 1.6s ease-in-out infinite; }
.brand-left .sep{ opacity:.35; }
.brand-left .time{ font-family:"Rajdhani", monospace; color: #F2F8FF; letter-spacing: 1.5px; font-size: 12px; }

.brand-title{
    text-align: center;
  position: relative;
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 3px;
  background: linear-gradient(180deg, #ffffff 0%, #eef6ff 58%, #b7d6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 0 6px rgba(142,210,255,0.16))
    drop-shadow(0 0 16px rgba(39,113,255,0.28));
  text-align:center;
  white-space: nowrap;
  padding: 0 76px;
}
.brand-title::before,
.brand-title::after{
  content:"";
  position:absolute;
  top:50%;
  width:62px;
  height:12px;
  transform:translateY(-50%);
  border-top:1px solid rgba(90,165,255,0.55);
  border-bottom:1px solid rgba(34,228,255,0.14);
  opacity:0.9;
}
.brand-title::before{
  left:0;
  clip-path: polygon(0 100%, 14% 0, 100% 0, 86% 100%);
  background: linear-gradient(90deg, rgba(34,228,255,0.02), rgba(58,122,255,0.16));
  box-shadow: -8px 0 14px rgba(39,113,255,0.12);
}
.brand-title::after{
  right:0;
  clip-path: polygon(14% 0, 100% 100%, 0 100%, 86% 0);
  background: linear-gradient(90deg, rgba(58,122,255,0.16), rgba(34,228,255,0.02));
  box-shadow: 8px 0 14px rgba(39,113,255,0.12);
}
.brand-title .cn{ margin-right:12px; }
.brand-title .en{
  font-size: 11px;
  letter-spacing: 3px;
  opacity: 0.5;
  font-weight: 500;
}

.brand-right{ display:flex; justify-content:flex-end; align-items:center; gap:12px; }
.lang-group{
  display:inline-flex;
  border: 1px solid rgba(68,136,255,0.32);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(7,18,34,0.84);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 10px rgba(29,99,255,0.12);
}
.lang-btn{
  padding: 5px 12px;
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--color-text-sub);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all .2s ease;
}
.lang-btn.active{
  background: var(--color-primary);
  color: #fff;
  box-shadow: inset 0 0 14px rgba(34,228,255,0.22), 0 0 12px rgba(29,99,255,0.22);
}
.lang-btn:not(.active):hover{ color: #fff; background: rgba(255,255,255,0.04); }

.sys-status{
  display:flex; align-items:center; gap:6px;
  font-size:11px; color: #d9ebff;
  padding: 4px 10px;
  border: 1px solid rgba(68,136,255,0.28);
  border-radius: 12px;
  background: rgba(7,18,34,0.84);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 12px rgba(34,228,255,0.06);
}
.sys-status .dot{ width:6px;height:6px;border-radius:50%;background:var(--color-glow);box-shadow:0 0 6px var(--color-glow); }

/* ---------- MAIN GRID ---------- */
.main{
  display:grid;
  grid-template-columns: 388px minmax(360px, 1fr) 300px;
  gap:14px;
  padding: 16px;
  height: calc(100vh - 56px);
  overflow:hidden;
  position: relative;
  z-index: 3;
  pointer-events: none;
}
.col{ display:grid; gap:14px; min-height:0; min-width: 0; pointer-events:none; }
.col.left  { grid-template-rows: 1.3fr 1.18fr 0.9fr 1fr; }
.col.center{ grid-template-rows: 108px minmax(184px, 21vh); align-content:end; }
.col.right { grid-template-rows: 1.1fr 1.1fr 1.3fr; }

/* ---------- CARDS ---------- */
.card{
  position: relative;
  background:
    linear-gradient(180deg, rgba(78,144,255,0.12) 0%, rgba(255,255,255,0.015) 100%),
    linear-gradient(160deg, rgba(6,18,38,0.92) 0%, rgba(5,13,29,0.84) 100%);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  border-radius: 18px;
  padding: 10px 12px;
  display:flex; flex-direction:column;
  min-height:0; min-width:0;
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
  opacity: 0;
  transform: translateY(8px);
  animation: fadeUp .6s ease forwards;
  box-shadow: var(--card-shadow), inset 0 1px 0 rgba(116,184,255,0.08), inset 0 0 22px rgba(27,84,196,0.08);
  pointer-events:auto;
  overflow:hidden;
}
.card:hover{
  border-color: rgba(96,190,255,0.55);
  box-shadow: 0 22px 56px rgba(0,0,0,0.42), 0 0 26px rgba(39,113,255,0.14), inset 0 0 26px rgba(34,228,255,0.05);
  transform: translateY(-1px);
}
.card::before{
  content:"";
  position:absolute; top:0; left:10px; right:10px;
  height:1px;
  background: linear-gradient(90deg, transparent, rgba(74,150,255,0.9), rgba(34,228,255,0.6), transparent);
  opacity: .92;
}
/* card corner accents */
.card::after{
  content:"";
  position:absolute;
  top: -1px; left: -1px;
  width: 14px; height: 14px;
  border-top: 1px solid rgba(86,176,255,0.9);
  border-left: 1px solid rgba(86,176,255,0.9);
  border-top-left-radius: 12px;
  opacity: .7;
  pointer-events:none;
}
.card .corner-br{
  position:absolute; bottom:-1px; right:-1px;
  width:14px; height:14px;
  border-bottom: 1px solid rgba(86,176,255,0.6);
  border-right: 1px solid rgba(86,176,255,0.6);
  border-bottom-right-radius: 12px;
  pointer-events:none;
}

.card-header{
  display:flex; align-items:center; justify-content: space-between;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.card-title{
  font-family: "Noto Sans SC", sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: #fff;
  display:flex; align-items:center; gap:8px;
}
.card-title::before{
  content:"";
  width: 3px; height: 13px;
  background: linear-gradient(180deg, #39cfff, #2368ff);
  box-shadow: 0 0 8px rgba(34,228,255,0.8);
  border-radius: 1px;
}
.card-title .en-sub{
  font-family: "Orbitron", sans-serif;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--color-text-sub);
  opacity: 0.6;
  font-weight: 400;
  margin-left: 4px;
}
.card-meta{
  font-family: "Rajdhani", monospace;
  font-size: 10px;
  color: var(--color-text-sub);
  letter-spacing: 0.5px;
}

.card-body{ flex:1; min-height:0; min-width:0; position:relative; display:flex; flex-direction:column; }

/* ---------- KPI grid ---------- */
.kpi-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  height:100%;
}
.asset-kpi-grid{
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.kpi{
  padding: 6px 6px;
  border: 1px solid rgba(160,210,255,0.12);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  display:flex; flex-direction:column; justify-content:space-between;
  position:relative;
  overflow:hidden;
}
.asset-overview-card .card-body{ padding-top: 2px; }
.asset-overview-card{
  width: calc(100% + 144px);
  margin-right: -144px;
  z-index: 4;
}
.asset-overview-card .kpi{
  min-height: 76px;
  padding: 10px 11px;
  border-color: rgba(160,210,255,0.14);
}
.asset-overview-card .kpi:nth-child(5){
  grid-column: span 2;
}
.asset-overview-card .kpi .label{
  font-size: 14px;
  line-height: 1.32;
  font-weight: 600;
  color: #dbeeff;
  letter-spacing: 0.2px;
  text-shadow: 0 0 8px rgba(80,170,255,0.16);
  margin-top: 6px;
}
.asset-overview-card .kpi .value{
  display:flex;
  align-items:flex-end;
  flex-wrap:wrap;
  gap: 2px 4px;
  font-size: 28px;
  line-height: 1.08;
  white-space: normal;
}
.asset-overview-card .kpi .value .split2{
  font-size: 18px;
}
.asset-overview-card .kpi .value .unit{
  font-size: 13px;
  margin-left: 0;
}
.asset-overview-card .kpi .value .divider{
  color: var(--color-text-sub);
  opacity: 0.75;
  padding: 0 2px;
}
.kpi:hover{ border-color: rgba(0,191,166,0.35); }
.kpi .icon{
  width:14px; height:14px;
  display:inline-flex; align-items:center; justify-content:center;
  color: var(--color-glow);
  opacity: .85;
}
.kpi .label{
  font-size: 10px;
  color: var(--color-text-sub);
  line-height: 1.2;
  margin-top: 4px;
}
.kpi .value{
   font-family: "Rajdhani", monospace;
  font-weight: 700;
  font-size: 22px;
  color: var(--color-glow);
  letter-spacing: 0.5px;
  margin-top: 3px;
  line-height: 1;
  white-space: nowrap;
}
.kpi .value .split{ color:#fff; }
.kpi .value .split2{ color: var(--color-text-sub); font-size:13px; }
.kpi .value .unit{ font-size: 10px; color: var(--color-text-sub); margin-left: 2px; font-weight:500; }
.kpi .bar{
  height: 3px; width:100%;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow:hidden;
  margin-top: 4px;
}
.kpi .bar > span{
  display:block; height:100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-glow));
  box-shadow: 0 0 6px rgba(0,191,166,0.5);
  border-radius: 2px;
  transition: width .6s ease;
}

/* ---------- Province distribution ---------- */
.province-wrap{
  display:grid;
  grid-template-columns: 55% 45%;
  gap: 8px;
  height:100%;
  min-height:0;
}
.donut-wrap{ position: relative; min-width:0; min-height:0; }
.donut-center{
  position:absolute; inset:0;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  pointer-events:none;
}
.donut-center .label{ font-size:9px; color: var(--color-text-sub); letter-spacing:1px; }
.donut-center .num{ font-family:"Orbitron", sans-serif; font-size: 18px; color:#fff; font-weight:700; letter-spacing: 1px; }
.province-list{
  min-width:0; min-height:0;
  overflow:hidden;
  display:flex; flex-direction:column;
  gap: 3px;
  font-size: 10px;
}
.province-row{
  display:grid;
  grid-template-columns: 34% 22% 1fr;
  align-items:center;
  gap: 4px;
  padding: 2px 0;
  cursor:pointer;
  border-radius: 3px;
  transition: background .2s ease;
}
.province-row:hover, .province-row.active{
  background: rgba(84,170,255,0.12);
}
.province-row .pname{ color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:flex;align-items:center; gap:4px;}
.province-row .pname::before{
  content:""; width:6px;height:6px;border-radius:50%;
  background: var(--c, #00BFA6);
  flex-shrink:0;
}
.province-row .pnum{ font-family:"Rajdhani", monospace; color: var(--color-text-sub); font-weight:600; }
.province-row .pbar{
  height:4px; background: rgba(255,255,255,0.05); border-radius:2px; overflow:hidden; position:relative;
}
.province-row .pbar > span{
  position:absolute; left:0; top:0; bottom:0;
  background: linear-gradient(90deg, rgba(0,191,166,0.3), var(--color-glow));
  border-radius:2px;
  box-shadow: 0 0 4px rgba(0,191,166,0.5);
}

/* ---------- MAP ---------- */
.map-card {
    margin-top: 200px;
    padding: 0;
    overflow: hidden;
    min-height: 100px;
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(560px, 100%);
    justify-self: center;
    align-self: start;
    background:
        linear-gradient(180deg, rgba(6, 18, 38, 0.82) 0%, rgba(4, 12, 26, 0.54) 100%);
}
.map-card .card-header{
  padding: 12px 14px 8px;
  margin:0;
  background: linear-gradient(180deg, rgba(8,22,43,0.92) 0%, rgba(8,22,43,0.36) 100%);
  border-bottom: 1px solid rgba(74,150,255,0.12);
}
.map-card .card-title{
  color: var(--color-text-main);
  text-shadow: 0 0 8px rgba(34,228,255,0.14);
}
.map-card .card-title::before{
  background: linear-gradient(180deg, #34dcff, #2368ff);
  box-shadow: 0 0 8px rgba(34,228,255,0.65);
}
.map-card .card-title .en-sub,
.map-card .card-meta{
  color: var(--color-text-sub);
  opacity: 0.86;
}
#map {
    position: fixed;
    inset: 0;
    background: #0d1a2a;
    z-index: 0;
}
#map::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(34,132,255,0.08), transparent 34%),
    radial-gradient(circle at 80% 78%, rgba(34,228,255,0.04), transparent 28%);
  pointer-events: none;
  z-index: 210;
}

/* 蓝色滤镜覆盖层 */
#map-filter {
  position: fixed;
  inset: 0;
  z-index: 215;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(15,55,140,0.32) 0%, rgba(25,85,200,0.22) 30%, rgba(10,45,120,0.28) 60%, rgba(15,60,160,0.34) 100%);
  mix-blend-mode: overlay;
}

#map::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3,8,15,0.55) 0%, transparent 15%, transparent 85%, rgba(3,8,15,0.55) 100%),
    linear-gradient(180deg, rgba(3,8,15,0.45) 0%, transparent 12%, transparent 88%, rgba(3,8,15,0.45) 100%);
  pointer-events: none;
  z-index: 220;
}


.map-legend{
  position:absolute;
  bottom: 12px; left: 14px;
  display:flex; gap:14px; align-items:center;
  padding: 8px 12px;
  background: rgba(8,20,38,0.78);
  border: 1px solid rgba(74,150,255,0.16);
  border-radius: 12px;
  z-index: 500;
  font-size: 11px;
  color: var(--color-text-main);
  backdrop-filter: blur(14px) saturate(145%);
  box-shadow: 0 10px 24px rgba(0,0,0,0.24), inset 0 0 14px rgba(29,99,255,0.08);
}
.map-legend .item{ display:flex; align-items:center; gap:6px; }
.map-legend .item .d{ width:8px; height:8px; border-radius:50%; }
.map-coverage{
  position:absolute; bottom:10px; right: 12px;
  padding: 8px 12px;
  background: rgba(8,20,38,0.78);
  border: 1px solid rgba(74,150,255,0.16);
  border-radius: 12px;
  z-index: 500;
  font-size: 11px;
  color: var(--color-text-main);
  backdrop-filter: blur(14px) saturate(145%);
  font-family: "Rajdhani", monospace;
  letter-spacing: 1px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.24), inset 0 0 14px rgba(29,99,255,0.08);
}
.map-coverage .n{ color: var(--color-glow); font-weight: 700; font-size: 13px; margin: 0 4px; text-shadow: 0 0 10px rgba(34,228,255,0.32); }

/* custom leaflet markers */
.city-marker{
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--c, #00BFA6);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.08), 0 0 8px var(--c, #00BFA6);
  position: relative;
}
.city-marker.pulse::before{
  content:"";
  position:absolute; inset:-6px;
  border-radius:50%;
  background: var(--c);
  opacity: 0.35;
  animation: pulseRing 1.8s ease-out infinite;
}
.city-marker.alert{
  animation: alertBlink 1.1s ease-in-out infinite;
}
@keyframes pulseRing{
  0%{ transform: scale(0.6); opacity:.5; }
  100%{ transform: scale(2.2); opacity: 0; }
}
@keyframes alertBlink{
  0%,100%{ box-shadow: 0 0 0 2px rgba(255,255,255,0.1), 0 0 6px #FF6A00; }
  50%{ box-shadow: 0 0 0 2px rgba(255,106,0,0.4), 0 0 14px #FF6A00; }
}

.leaflet-popup-content-wrapper{
  background: rgba(8,18,31,0.92) !important;
  color: #fff !important;
  border: 1px solid rgba(125,188,255,0.18) !important;
  border-radius: 14px !important;
  box-shadow: 0 18px 38px rgba(0,0,0,0.42), 0 0 18px rgba(0,191,166,0.15) !important;
  font-family: "Noto Sans SC", sans-serif !important;
  backdrop-filter: blur(14px);
}
.leaflet-popup-tip{ background: rgba(8,18,31,0.92) !important; border: 1px solid rgba(125,188,255,0.18) !important; }
.leaflet-popup-close-button{ color: #A0B3C5 !important; }
.pop{ min-width: 150px; padding: 4px 2px; }
.pop .t{ font-size: 13px; font-weight: 600; margin-bottom: 4px; color:#fff; }
.pop .row{ display:flex; justify-content:space-between; font-size: 11px; color: var(--color-text-sub); margin: 2px 0; }
.pop .row b{ color: var(--color-glow); font-family: "Rajdhani"; font-weight:700; }
.pop .status{ display:inline-block; padding: 1px 6px; font-size: 10px; border-radius: 3px; margin-top:4px; }
.pop .status.ok{ background: rgba(0,191,166,0.15); color: var(--color-glow); }
.pop .status.charging{ background: rgba(10,77,158,0.35); color: #7CB7FF; }
.pop .status.alert{ background: rgba(255,106,0,0.18); color: var(--color-accent); }

/* ---------- Alert donut ---------- */
.alert-legend{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  font-size: 10px;
  margin-top: 6px;
  flex-shrink:0;
}
.alert-legend .al{
  display:flex; flex-direction:column; align-items:flex-start; gap:2px;
  padding: 4px 6px;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 4px;
  background: rgba(255,255,255,0.015);
}
.alert-legend .al .name{ color: var(--color-text-sub); display:flex; align-items:center; gap:4px; font-size:10px; }
.alert-legend .al .name::before{ content:""; width:6px; height:6px; border-radius:50%; background: var(--c); }
.alert-legend .al .v{ font-family:"Rajdhani",monospace; font-size: 14px; font-weight: 700; color:#fff; letter-spacing:0.5px; }
.alert-legend .al .tr{ font-size: 10px; font-family:"Rajdhani",monospace; }
.tr.up{ color: var(--alert-1); }
.tr.down{ color: var(--color-glow); }
.tr.flat{ color: var(--color-text-sub); }

/* ---------- Valuation ---------- */
.val-big{
  text-align:center;
  padding: 6px 0 2px;
  flex-shrink: 0;
}
.val-big .num{
  font-family:"Orbitron", sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--color-glow);
  letter-spacing: 2px;
  text-shadow: 0 0 14px rgba(0,191,166,0.4);
  display:inline-flex; align-items: baseline; gap: 4px;
}
.val-big .sym{ font-size: 18px; opacity:0.8; }
.val-big .unit{ font-size: 13px; color: var(--color-text-sub); font-weight:500; }
.val-big .delta{
  margin-top: 2px;
  font-size: 10px;
  color: var(--color-glow);
  font-family: "Rajdhani", monospace;
  letter-spacing: 0.5px;
}
.val-rows{
  margin-top: 8px;
  display:flex; flex-direction:column; gap: 6px;
  flex-shrink:0;
}
.val-row{
  display:grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  font-size: 11px;
  align-items:center;
}
.val-row .lbl{ color: var(--color-text-sub); font-size: 11px; }
.val-row .v{ font-family:"Rajdhani", monospace; color:#fff; font-weight:600; font-size:12px; }
.val-row .bar{
  grid-column: 1 / -1;
  height: 3px; background: rgba(255,255,255,0.06);
  border-radius: 2px; overflow:hidden;
}
.val-row .bar > span{
  display:block; height:100%;
  background: linear-gradient(90deg, rgba(0,191,166,0.4), var(--color-glow));
  box-shadow: 0 0 4px rgba(0,191,166,0.5);
  border-radius:2px;
}
.sparkline-wrap{
  flex: 1;
  min-height: 0;
  margin-top: 6px;
  position: relative;
}

/* ---------- chart containers ---------- */
.chart-holder{ position: relative; flex: 1; min-height:0; min-width:0; }
.chart-holder canvas{ max-width:100%; }

.residual-forecast-card .card-header{ margin-bottom: 6px; }
.residual-split{
  display:grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(220px, 0.88fr);
  gap: 10px;
  height:100%;
  min-height:0;
}
.forecast-panel{
  min-width:0;
  min-height:0;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(160,210,255,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.045) 0%, rgba(255,255,255,0.015) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
  display:flex;
  flex-direction:column;
}
.forecast-panel .mini-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.forecast-panel .mini-title{
  font-size: 11px;
  color:#fff;
}
.forecast-panel .mini-sub{
  font-family:"Orbitron", sans-serif;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--color-text-sub);
  opacity: 0.72;
}
.residual-main .chart-holder{ min-height:0; }
.value-side{
  gap: 8px;
  justify-content:space-between;
}
.value-hero,
.cashflow-wrap{
  display:flex;
  flex-direction:column;
  min-height:0;
}
.value-row{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 8px;
}
.value-num{
  font-family:"Orbitron","Rajdhani",sans-serif;
  font-size: 24px;
  line-height: 1;
  color:#fff;
  letter-spacing: 0.5px;
}
.value-num .accent{ color: var(--color-glow); }
.value-num .unit{
  font-size: 11px;
  color: var(--color-text-sub);
  margin-left: 4px;
}
.value-change{
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,191,166,0.2);
  background: rgba(0,191,166,0.1);
  color: #9ff3df;
  font-family:"Rajdhani", sans-serif;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}
.value-change.down{
  border-color: rgba(255,106,0,0.26);
  background: rgba(255,106,0,0.12);
  color: #ffd3bf;
}
.value-meta{
  margin-top: 4px;
  font-size: 10px;
  color: var(--color-text-sub);
}
.spark-wrap{
  position:relative;
  flex:1;
  min-height: 44px;
  margin-top: 6px;
}
.cashflow-summary{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
}
.cf-item{
  min-width:0;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(160,210,255,0.1);
  background: rgba(255,255,255,0.03);
}
.cf-item .k{
  font-size: 9px;
  color: var(--color-text-sub);
  margin-bottom: 3px;
}
.cf-item .v{
  font-family:"Orbitron","Rajdhani",sans-serif;
  font-size: 13px;
  line-height: 1.1;
  color:#fff;
}
.cf-item .v .unit{
  font-size: 10px;
  color: var(--color-text-sub);
  margin-left: 3px;
}
.cashflow-chart{
  position:relative;
  flex:1;
  min-height: 62px;
}
.spark-wrap canvas,
.cashflow-chart canvas{
  max-width:100%;
}

/* ---------- animations ---------- */
@keyframes fadeUp{
  to{ opacity:1; transform: translateY(0); }
}
@keyframes pulse{
  0%,100%{ opacity:1; box-shadow: 0 0 6px currentColor; }
  50%{ opacity:.55; box-shadow: 0 0 12px currentColor; }
}

/* stagger */
.col.left  .card:nth-child(1){ animation-delay: .05s; }
.col.left  .card:nth-child(2){ animation-delay: .10s; }
.col.left  .card:nth-child(3){ animation-delay: .15s; }
.col.left  .card:nth-child(4){ animation-delay: .20s; }
.col.center .card:nth-child(1){ animation-delay: .12s; }
.col.center .card:nth-child(2){ animation-delay: .22s; }
.col.right .card:nth-child(1){ animation-delay: .18s; }
.col.right .card:nth-child(2){ animation-delay: .26s; }
.col.right .card:nth-child(3){ animation-delay: .34s; }

/* tweak scrollbar hide for leaflet */
.leaflet-control-attribution, .leaflet-control-zoom{ display:none !important; }

/* ── X-Ray pill buttons ── */
.xpill{
  background:rgba(8,18,31,0.78);
  border:1px solid rgba(125,188,255,0.16);
  border-radius:100px;
  color:rgba(255,255,255,0.74);
  font-family:"Noto Sans SC",sans-serif;
  font-size:10px;
  padding:3px 9px;
  cursor:pointer;
  transition:all .15s;
  backdrop-filter: blur(12px);
}
.xpill:hover{ background:rgba(74,140,208,0.18); color:#fff; }
.xpill-on{
  background:var(--pc,#e87820);
  border-color:var(--pc,#e87820);
  color:#fff;
  box-shadow:0 0 8px var(--pc,rgba(232,120,32,.4));
}

@media (max-width: 1380px){
  .main{
    grid-template-columns: 348px 1fr 280px;
    gap: 12px;
    padding: 12px;
  }
  .col.left{ grid-template-rows: 1.3fr 1.18fr 0.9fr 1fr; }
  .col.center{ grid-template-rows: 104px minmax(170px, 20vh); align-content:end; }
  .residual-split{ grid-template-columns: minmax(0, 1fr) minmax(210px, 0.86fr); }
  .asset-overview-card{
    width: calc(100% + 70px);
    margin-right: -70px;
  }
}

@media (max-width: 1180px){
  html,body{ overflow:auto; }
  .app{ min-height:100vh; height:auto; }
  .topbar{ height:48px; padding:0 12px; }
  .brand-title{ font-size:14px; letter-spacing:1px; }
  .main{
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    gap: 10px;
    padding: 10px;
    overflow:visible;
    height:auto;
  }
  .col{ grid-template-rows:none !important; gap:10px; }
  .col.center{ grid-column: 1 / -1; }
  .asset-overview-card{ width:100%; margin-right:0; }
  .map-card{ width:100%; min-height:200px; }
  .residual-split{ grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px){
  .topbar{ height:44px; padding:0 10px; }
  .brand-title{ font-size:12px; letter-spacing:0.5px; }
  .brand-left, .brand-right{ display:none; }
  .main{
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }
  .col{ gap:8px; }
  .col.center{ grid-column:1; }
  .asset-overview-card{ width:100%; margin-right:0; }
  .map-card{ min-height:180px; }
  .residual-split{ grid-template-columns: 1fr; }
  .kpi-grid{ grid-template-columns: repeat(3, 1fr); gap:6px; }
  .card{ padding:10px; border-radius:10px; }
  .card-title{ font-size:11px; }
  .chart-holder{ min-height:80px; }
  .forecast-panel{ padding:8px; }
  .xray-card{ min-height:200px; }
}

@media (max-width: 480px){
  .brand-title{ font-size:11px; }
  .main{ padding:6px; gap:6px; }
  .kpi-grid{ grid-template-columns: repeat(2, 1fr); }
  .card{ padding:8px; }
  .map-card{ min-height:160px; }
}
