/* EDISON · la placa 2D (estilo Aorus White): PCB blanca premium sobre escenario oscuro, como una foto de producto.
   Disipadores plata angulares, cables oscuros tipo fuente que se iluminan por dentro. Solo datos reales. */
.placa-page { margin: 0; min-height: 100dvh; background: radial-gradient(130% 100% at 50% -10%, #0b0d12 0%, #050608 60%, #000 100%); color: var(--text); font-family: var(--sans); overflow: hidden; }
#placa-root { min-height: 100dvh; display: flex; flex-direction: column; }

.placa-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 20px clamp(16px, 4vw, 40px) 6px; z-index: 3; }
.placa-home { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text-2); text-decoration: none; transition: background .2s var(--ease), color .2s var(--ease); }
.placa-home:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.placa-home svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.placa-title { text-align: center; }
.placa-title .kicker { font: 500 13px/1.3 var(--sans); letter-spacing: 0; color: var(--text-3); }
.placa-title h1 { margin: 5px 0 0; font: 600 clamp(22px, 3vw, 32px)/1 var(--display); letter-spacing: -.03em; }
.placa-up { text-align: right; }
.placa-up b { display: block; font: 600 24px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.placa-up span { font: 500 10px/1.5 var(--sans); letter-spacing: .02em; color: var(--text-3); }

.placa-wrap { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 328px; gap: clamp(8px, 2vw, 28px); padding: 4px clamp(14px, 3.5vw, 40px) 26px; min-height: 0; }
.placa-stage { position: relative; min-height: 0; display: grid; place-items: center; padding: 8px; }
.pl-svg { width: 100%; height: 100%; max-height: 78dvh; filter: drop-shadow(0 40px 80px rgba(0, 0, 0, .6)); }

/* ---------- La PCB blanca y su detalle ---------- */
.pl-board { fill: url(#pl-g-board); stroke: rgba(0, 0, 0, .14); stroke-width: 1.5; }
.pl-trace { fill: none; stroke: #ccd1d8; stroke-width: 1.4; opacity: .7; }
.pl-mount { fill: #d6dae0; }
.pl-mount-in { fill: #9aa1ab; }
.pl-slot { fill: #e3e6ea; stroke: #c3c8d0; stroke-width: 1; }
.pl-pcie { fill: #e0e3e8; stroke: #c3c8d0; stroke-width: 1; }

/* Disipadores plata angulares (sello Aorus) con sus aletas y tornillos. */
.pl-hs { fill: url(#pl-g-hs); }
.pl-hs-edge { fill: none; stroke: #aeb4be; stroke-width: 1.6; }
.pl-fin { stroke: #c6cbd3; stroke-width: 1.4; }
.pl-screw { fill: #aab0ba; }
.pl-name { fill: #1c2026; font: 600 17px/1 var(--sans); letter-spacing: -.01em; }
.pl-sub { fill: #6a7078; font: 500 12.5px/1 var(--sans); }

/* El socket del procesador = EDISON, con su «die» en ámbar brillando (el corazón). */
.pl-socket { fill: url(#pl-g-socket); stroke: #aeb4be; stroke-width: 1.6; }
.pl-socket-in { fill: #cfd4db; stroke: #b7bdc6; stroke-width: 1.2; }
.pl-die { fill: #ffb340; filter: drop-shadow(0 0 10px rgba(255, 150, 40, .75)); animation: pl-die 2.6s var(--ease) infinite; }
.pl-die.bad { fill: #ff5a5d; filter: drop-shadow(0 0 10px rgba(255, 60, 70, .8)); }
@keyframes pl-die { 0%, 100% { opacity: .9; } 50% { opacity: 1; } }
.pl-core-name { fill: #14181d; font: 700 18px/1 var(--display); letter-spacing: -.02em; text-anchor: middle; }
.pl-core-sub { fill: #5f656d; font: 500 12.5px/1 var(--sans); text-anchor: middle; }

/* LEDs de estado: sólo reflejan /api/health/detalle. */
.pl-led { fill: #b9bfc8; }
.pl-led.ok { fill: #3f8cff; filter: drop-shadow(0 0 5px rgba(63, 140, 255, .9)); }
.pl-led.bad { fill: #ff4347; filter: drop-shadow(0 0 5px rgba(255, 67, 71, .9)); }
.pl-led.wait { fill: #ffab2e; filter: drop-shadow(0 0 5px rgba(255, 171, 46, .85)); }
.pl-led.off { fill: #c2c7cf; }

/* Cables tipo fuente de alimentación: oscuros (contraste sobre blanco) y con luz que viaja por dentro al mandar datos. */
.pl-cable-base { fill: none; stroke: #2a2e35; stroke-width: 11; stroke-linecap: round; }
.pl-cable-core { fill: none; stroke: #0e1116; stroke-width: 5; stroke-linecap: round; }
.pl-cable-flow { fill: none; stroke-width: 4.5; stroke-linecap: round; opacity: 0; stroke-dasharray: 4 21; stroke-dashoffset: 0; }
.pl-cable-flow.cool { stroke: #52a2ff; color: #52a2ff; }
.pl-cable-flow.amber { stroke: #ffb340; color: #ffb340; }
.pl-cable-flow.bad { stroke: #ff5a5d; color: #ff5a5d; }
/* !important a propósito: el flujo es la función en vivo de la placa; gana a la regla global de movimiento reducido. */
.pl-comp.active .pl-cable-flow { opacity: 1; animation: pl-flow var(--dur, 2.4s) linear infinite !important; filter: drop-shadow(0 0 4px currentColor) drop-shadow(0 0 9px currentColor); }
@keyframes pl-flow { to { stroke-dashoffset: -25; } }
/* El flujo de luz de los cables es la función de la placa (muestra datos reales en vivo), así que anima siempre;
   el latido decorativo del «die» sí respeta la preferencia de movimiento reducido. */
@media (prefers-reduced-motion: reduce) { .pl-die { animation: none; } }

/* ---------- Panel lateral: agentes y errores (real) ---------- */
.placa-side { align-self: center; display: flex; flex-direction: column; gap: 22px; overflow-y: auto; padding: 4px; max-height: 80dvh; }
.placa-side h2 { margin: 0 0 12px; font: 600 11px/1 var(--sans); letter-spacing: .02em; text-transform: none; color: var(--text-3); }
.pl-list { display: grid; gap: 2px; }
.pl-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 9px 2px; border-top: 1px solid rgba(255, 255, 255, .05); }
.pl-list .pl-row:first-child { border-top: 0; }
.pl-row .t { min-width: 0; }
.pl-row .t strong { display: block; font: 500 13.5px/1.25 var(--sans); letter-spacing: -.01em; }
.pl-row .t small { display: block; color: var(--text-3); font-size: 11.5px; margin-top: 2px; overflow-wrap: anywhere; }
.pl-row time { color: var(--text-3); font: 500 10.5px/1 var(--mono); white-space: nowrap; align-self: start; }
.pl-dot { width: 8px; height: 8px; border-radius: 50%; background: #5b6168; }
.pl-dot.ok { background: #3f8cff; box-shadow: 0 0 8px rgba(63, 140, 255, .7); }
.pl-dot.bad { background: #ff4347; box-shadow: 0 0 8px rgba(255, 67, 71, .7); }
.pl-dot.wait { background: #ffab2e; box-shadow: 0 0 8px rgba(255, 171, 46, .6); }
.pl-clean { color: var(--text-3); font-size: 12.5px; line-height: 1.5; margin: 4px 0; }

@media (max-width: 920px) {
  .placa-page { overflow: auto; }
  .placa-wrap { grid-template-columns: minmax(0, 1fr); }
  .pl-svg { max-height: none; }
  .placa-side { align-self: start; flex-direction: row; max-height: none; gap: 24px; }
  .placa-side section { flex: 1; min-width: 0; }
}
@media (max-width: 560px) {
  .placa-top { grid-template-columns: auto 1fr; }
  .placa-up { display: none; }
  .placa-side { flex-direction: column; }
}
