/* CanPro Data Platform: live status monitor. Dark by design: it is a monitor. */
:root {
  --bg: #070d18; --bg2: #0b1424; --panel: rgba(17, 28, 47, .72); --panel-solid: #111c2f; --line: rgba(148, 170, 205, .14);
  --ink: #e9f0fa; --muted: #8fa1ba; --faint: #5b6c85;
  --online: #3ee08f; --online-rgb: 62, 224, 143; --cyan: #4cc9f0; --planned: #4a5b74; --attention: #ffb547;
  --building: #ff8c42; --building-rgb: 255, 140, 66; --gold: #f5c542; --gold-rgb: 245, 197, 66;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1200px 600px at 50% -10%, #12233f 0%, transparent 60%), var(--bg);
  color: var(--ink); font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased;
}
.app { max-width: 1360px; margin: 0 auto; padding: 18px 24px 28px; }

/* top bar */
.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); }
.brand b { color: var(--ink); font-weight: 700; }
.brand img { border-radius: 6px; }
.chip { display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 14px; border-radius: 999px; font-weight: 600;
        letter-spacing: .02em; border: 1px solid rgba(var(--online-rgb), .35); background: rgba(var(--online-rgb), .08); color: var(--online); }
.chip-attention { border-color: rgba(255, 181, 71, .4); background: rgba(255, 181, 71, .08); color: var(--attention); }
.chip-building { border-color: rgba(var(--building-rgb), .45); background: rgba(var(--building-rgb), .08); color: var(--building); }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; position: relative; flex: none; }
.chip-dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; animation: ring 2.4s ease-out infinite; }
@keyframes ring { 0% { transform: scale(.5); opacity: .8; } 80%, 100% { transform: scale(1.6); opacity: 0; } }
.clock { justify-self: end; text-align: right; }
.clock-time { font: 500 20px/1 var(--mono); letter-spacing: .04em; }
.clock-meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.hb { width: 6px; height: 6px; border-radius: 50%; background: var(--online); transition: transform .3s, box-shadow .3s; }
.hb.beat { transform: scale(1.8); box-shadow: 0 0 10px var(--online); }
.hb.stale { background: var(--attention); }

/* the network */
.stage-panel { position: relative; border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
               background: linear-gradient(180deg, rgba(17, 28, 47, .55), rgba(9, 16, 29, .55)); }
.net { display: block; width: 100%; height: auto; }
.grid-dot { fill: rgba(148, 170, 205, .09); }
.vig-a { stop-color: #0d1a2e; stop-opacity: 0; } .vig-b { stop-color: #070d18; stop-opacity: .85; }
.core-a { stop-color: #1b3150; } .core-b { stop-color: #0d1828; }
.live-a { stop-color: var(--cyan); } .live-b { stop-color: var(--online); }
.cap { fill: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.enclosure { fill: rgba(76, 201, 240, .025); stroke: rgba(76, 201, 240, .16); stroke-dasharray: 2 6; }
.link { fill: none; stroke-width: 1.6; }
.link-live { stroke: url(#live); stroke-opacity: .32; }
.link-planned { stroke: var(--planned); stroke-opacity: .5; stroke-dasharray: 3 6; }
.particle { fill: #b9ffd9; }

.node { cursor: default; outline: none; }
.node .disc { fill: var(--panel-solid); stroke: var(--planned); stroke-width: 1.5; transition: stroke .3s; }
.node.st-online .disc { stroke: rgba(var(--online-rgb), .75); }
.node.st-attention .disc { stroke: var(--attention); }
.node.st-building .disc { stroke: rgba(var(--building-rgb), .85); }
.node.tone-gold.st-online .disc { stroke: rgba(var(--gold-rgb), .9); }
.tone-gold .halo { fill: rgba(var(--gold-rgb), .12); }
.tone-gold .pulse { stroke: var(--gold); }
.node.st-planned .disc { stroke-dasharray: 3 4; fill: transparent; }
.node:hover .disc, .node:focus .disc { stroke-width: 2.4; }
.node-stage .disc { fill: url(#core); stroke-width: 1.8; }
.node-stage .inner { fill: none; stroke: rgba(76, 201, 240, .18); }
.halo { fill: rgba(var(--online-rgb), .10); }
.pulse { fill: none; stroke: var(--online); stroke-width: 1.5; }
.glyph { fill: none; stroke: #cfe3ff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.node-stage .glyph { stroke: #e8f6ff; stroke-width: 1.3; }
.st-planned .glyph { stroke: var(--faint); }
.num { fill: var(--cyan); font: 500 10.5px var(--mono); letter-spacing: .12em; }
.label { fill: var(--ink); font-size: 13.5px; font-weight: 600; }
.label-lg { font-size: 15px; }
.stat { fill: var(--muted); font-size: 12px; }
.st-planned .label, .st-planned .stat { fill: var(--faint); }
.tag { fill: var(--online); font: 600 10px var(--mono); letter-spacing: .14em; }
.tag-dot { fill: var(--online); }
.st-attention .tag, .st-attention .tag-dot { fill: var(--attention); }
.st-building .tag, .st-building .tag-dot { fill: var(--building); }
.tone-gold.st-online .tag, .tone-gold.st-online .tag-dot { fill: var(--gold); }
.tone-gold .num { fill: var(--gold); }
.mono { fill: var(--ink); font: 600 15px var(--mono); letter-spacing: .04em; }
.st-planned .mono { fill: var(--faint); }
.sat { stroke: var(--bg); stroke-width: 2; }
.sat-connected, .sat-online { fill: var(--online); }
.sat-planned { fill: var(--planned); }
.sat-attention { fill: var(--attention); }
.sat-building { fill: var(--building); }

.tip { position: absolute; z-index: 5; pointer-events: none; min-width: 180px; max-width: 280px; padding: 10px 12px; border-radius: 10px;
       background: rgba(10, 18, 32, .96); border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(0,0,0,.45); font-size: 12.5px; }
.tip b { display: block; font-size: 13px; margin-bottom: 4px; }
.tip span { display: block; color: var(--muted); }
.net-list { display: none; }

/* lower panels */
.panels { display: grid; grid-template-columns: 1.05fr 1.15fr 1fr; gap: 14px; margin-top: 14px; }
.panel { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; backdrop-filter: blur(6px); }
.panel h2 { margin: 0 0 14px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
            display: flex; align-items: center; gap: 10px; }
.h2-meta { font-weight: 500; letter-spacing: .04em; text-transform: none; color: var(--faint); margin-left: auto; }

.vitals-grid { display: grid; align-content: start; grid-template-columns: 132px 1fr 1fr; grid-template-rows: auto auto; gap: 10px 18px; align-items: center; }
.ring-wrap { grid-row: 1 / 3; text-align: center; }
.ring { width: 120px; height: 120px; }
.ring-bg { fill: none; stroke: rgba(148, 170, 205, .12); stroke-width: 9; }
.ring-fg { fill: none; stroke: var(--online); stroke-width: 9; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(var(--online-rgb), .5)); }
.ring-warn { stroke: var(--attention); }
.ring-n { fill: var(--ink); font: 600 28px var(--mono); }
.ring-l { fill: var(--muted); font-size: 10.5px; }
.ring-cap { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.kpi { display: flex; flex-direction: column; padding: 8px 0 8px 14px; border-left: 1px solid var(--line); }
.kpi-n { font: 600 26px/1.1 var(--mono); letter-spacing: -.01em; }
.kpi-l { font-size: 12px; color: var(--muted); }

.tl { display: grid; gap: 11px; margin-bottom: 16px; }
.tl-row { display: grid; grid-template-columns: 82px 1fr 34px; align-items: center; gap: 10px; }
.tl-name { font-size: 13px; font-weight: 500; }
.tl-planned .tl-name { color: var(--faint); }
.tl-track { position: relative; height: 22px; border-radius: 6px; background: linear-gradient(90deg, rgba(148,170,205,.04), rgba(148,170,205,.08)); }
.tl-tick { position: absolute; top: 4px; bottom: 4px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--cyan);
           box-shadow: 0 0 8px rgba(76, 201, 240, .7); }
.tl-now { position: absolute; right: 0; top: -3px; bottom: -3px; width: 2px; background: var(--online); box-shadow: 0 0 8px var(--online); }
.tl-next { height: 2px; border-top: 2px dashed var(--planned); }
.tl-axis { display: grid; grid-template-columns: 82px 1fr 1fr 34px; gap: 10px; font: 10.5px var(--mono); color: var(--faint); }
.tl-axis span:first-child { grid-column: 2; }
.tl-axis span:nth-child(2) { grid-column: 3; text-align: right; }
.tl-axis-next { display: none; }
.auto { align-self: flex-start; margin-top: auto !important; display: inline-flex; align-items: center; gap: 9px; margin-top: 14px; font-size: 12.5px; color: var(--muted);
        padding: 6px 12px; border-radius: 999px; border: 1px dashed var(--planned); }
.auto-online { color: var(--online); border-style: solid; border-color: rgba(var(--online-rgb), .4); }
.auto-planned .chip-dot { background: var(--planned); }
.auto-planned .chip-dot::after { display: none; }

.live-tag { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; color: var(--online); font: 600 10.5px var(--mono); letter-spacing: .14em; }
.live-tag .chip-dot { width: 6px; height: 6px; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ev { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 6px 4px; border-radius: 8px; }
.ev:first-child { background: rgba(var(--online-rgb), .05); }
.ev-icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(76, 201, 240, .1); }
.ev-icon svg { width: 15px; height: 15px; fill: none; stroke: var(--cyan); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ev-delivery .ev-icon { background: rgba(var(--online-rgb), .1); } .ev-delivery .ev-icon svg { stroke: var(--online); }
.ev-attention .ev-icon { background: rgba(255,181,71,.12); } .ev-attention .ev-icon svg { stroke: var(--attention); }
.ev-body { min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-body b { font-weight: 600; }
.ev-who { display: block; font-size: 11.5px; color: var(--muted); }
.x { color: var(--faint); font: 11px var(--mono); }
.ev-ago { font: 11px var(--mono); color: var(--faint); white-space: nowrap; }

.foot { display: flex; gap: 18px; align-items: center; justify-content: center; margin-top: 18px; font-size: 11.5px; color: var(--faint); flex-wrap: wrap; }
.foot span { display: inline-flex; align-items: center; gap: 6px; }
.k { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.k-online { background: var(--online); box-shadow: 0 0 8px var(--online); }
.k-connected { background: var(--online); }
.k-planned { border: 1.5px dashed var(--planned); }
.k-attention { background: var(--attention); }
.k-building { background: var(--building); }
.foot-by { margin-left: 12px; padding-left: 18px; border-left: 1px solid var(--line); }
.offline { padding: 80px; text-align: center; color: var(--attention); }
.offline-msg { display: inline-flex; align-items: center; gap: 10px; }

@media (max-width: 1080px) { .panels { grid-template-columns: 1fr 1fr; } .activity { grid-column: 1 / -1; } }
@media (max-width: 760px) {
  .app { padding: 14px 16px 24px; }
  .bar { grid-template-columns: 1fr auto; }
  .bar .chip { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .net { display: none; }
  .net-list { display: grid; gap: 6px; list-style: none; margin: 0; padding: 14px; }
  .net-list li { display: grid; grid-template-columns: 12px auto 1fr; gap: 10px; align-items: center; font-size: 13px; padding: 8px 10px;
                 border-radius: 10px; background: rgba(17, 28, 47, .8); border: 1px solid var(--line); }
  .net-list li span:last-child { color: var(--muted); text-align: right; }
  .net-list .kind-stage { border-color: rgba(76, 201, 240, .3); }
  .dotx { width: 8px; height: 8px; border-radius: 50%; background: var(--planned); }
  .net-list .st-online .dotx { background: var(--online); box-shadow: 0 0 8px var(--online); }
  .net-list .st-building .dotx { background: var(--building); }
  .net-list .tone-gold.st-online .dotx { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
  .panels { grid-template-columns: 1fr; }
  .vitals-grid { grid-template-columns: 112px 1fr; }
  .ring-wrap { grid-row: 1 / 5; }
  .foot-by { margin-left: 0; padding-left: 0; border: 0; width: 100%; text-align: center; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .chip-dot::after { animation: none; } }
