/* =====================================================================
   EdgeWarden — página Plataforma (componentes exclusivos desta página)
   Depende dos tokens de ew.css.
   ===================================================================== */

/* ---------- Hero: ficha técnica ---------- */
.pf-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(32px, 6vw, 88px); align-items: end; }
@media (max-width: 960px) { .pf-hero { grid-template-columns: 1fr; } }
.readout { margin: 0; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: rgba(8,18,38,.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); overflow: hidden; }
.readout__h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: var(--fs-xs); color: var(--text-3); }
.readout dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.readout dl > div { padding: 16px 18px; border-top: 1px solid var(--line); }
.readout dl > div:nth-child(-n+2) { border-top: 0; }
.readout dl > div:nth-child(even) { border-left: 1px solid var(--line); }
.readout dt { order: 2; font-size: var(--fs-xs); color: var(--text-3); line-height: 1.4; margin-top: 4px; }
.readout dd { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.75rem; line-height: 1; color: var(--text-1); letter-spacing: -.01em; }
.readout dl > div { display: flex; flex-direction: column; }

/* ---------- Diagrama de fluxo ---------- */
.flow { border: 1px solid var(--line); border-radius: var(--r-xl); background: radial-gradient(800px 360px at 60% 20%, rgba(47,107,255,.10), transparent 70%), #060d1e; padding: clamp(10px, 2vw, 24px); }
.flow__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-md); }
.flow__scroll:focus-visible { outline: 2px solid var(--in); outline-offset: 4px; }
.flow__svg { width: 100%; height: auto; }
.flow__hint { display: none; font-size: var(--fs-xs); color: var(--text-4); margin: 10px 4px 0; }
@media (max-width: 760px) {
  .flow__svg { width: 980px; max-width: none; }
  .flow__hint { display: flex; align-items: center; gap: 6px; }
  .flow__hint svg { width: 14px; height: 14px; }
}
.flow__legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; padding: 12px 6px 2px; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--text-3); }
.flow__legend span { display: inline-flex; align-items: center; gap: 8px; }
.flow__legend i { width: 18px; height: 0; border-top: 2px solid; }
.flow__legend .lg-in { border-color: var(--in); }
.flow__legend .lg-db { border-color: #6f9dff; border-top-style: dashed; }
.flow__legend .lg-bgp { border-color: var(--out); }
.flow__legend .lg-atk { border-color: var(--attack); }
.flow__legend .lg-ok { border-color: var(--ok); }
.flow__legend .lg-hv { border-color: var(--ok); border-top-style: dotted; }
.flow__legend .lg-warn { border-color: var(--warn); }

.fl-box { fill: #0a1632; stroke: var(--line-strong); stroke-width: 1; transition: stroke .5s, fill .5s; }
.fl-box--edge { fill: rgba(12,24,48,.55); stroke: var(--line); }
.fl-router { fill: #0d1c3a; stroke: #2a4270; }
.fl-t { font-family: var(--font-display); font-weight: 600; font-size: 16px; fill: var(--text-1); }
.fl-s { font-family: var(--font-mono); font-size: 12px; fill: var(--text-3); }
.fl-xs { font-family: var(--font-mono); font-size: 11px; fill: var(--text-4); }
.fl-r { font-family: var(--font-body); font-weight: 500; font-size: 13px; fill: var(--text-2); }
.fl-path { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.fl-path--in { stroke: rgba(60,198,228,.6); }
.fl-path--db { stroke: rgba(111,157,255,.55); stroke-dasharray: 5 5; }
.fl-path--bgp { stroke: rgba(182,156,255,.6); }
.fl-path--ctl { stroke: rgba(111,157,255,.6); }
.fl-path--atk { stroke: rgba(255,97,112,.7); }
.fl-path--ok { stroke: rgba(61,214,140,.7); }
.fl-path--hv { stroke: rgba(61,214,140,.55); stroke-dasharray: 2 5; }
.fl-path--warn { stroke: rgba(244,203,85,.6); }
.fl-pkt { pointer-events: none; }
.fl-pkt--in { fill: var(--in); filter: drop-shadow(0 0 4px var(--in)); }
.fl-pkt--db { fill: #8fb2ff; }
.fl-pkt--bgp { fill: var(--out); filter: drop-shadow(0 0 4px var(--out)); }
.fl-pkt--ctl { fill: #8fb2ff; filter: drop-shadow(0 0 4px #6f9dff); }
.fl-pkt--atk { fill: var(--attack); filter: drop-shadow(0 0 4px var(--attack)); }
.fl-pkt--ok { fill: var(--ok); filter: drop-shadow(0 0 4px var(--ok)); }
.fl-pkt--warn { fill: var(--warn); filter: drop-shadow(0 0 4px var(--warn)); }
.fl-ring { fill: none; stroke: var(--line-strong); stroke-width: 3; }
.fl-ring-p { fill: none; stroke: var(--in); stroke-width: 3; stroke-linecap: round; }
.fl-node.is-hot .fl-box { stroke: var(--ok); fill: #0b2030; }
.fl-node--motor.is-hot .fl-box { stroke: var(--in); }

/* Etapas abaixo do diagrama (sequência real) */
.stages { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 24px; counter-reset: stg; }
@media (max-width: 1024px) { .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .stages { grid-template-columns: 1fr; } }
.stages li { counter-increment: stg; border-top: 1px solid var(--line-strong); padding-top: 14px; font-size: var(--fs-sm); color: var(--text-3); line-height: 1.55; }
.stages li::before { content: counter(stg, decimal-leading-zero); display: block; font: 500 var(--fs-xs) var(--font-mono); color: var(--in); margin-bottom: 6px; }
.stages strong { display: block; color: var(--text-1); font-weight: 600; font-size: var(--fs-base); margin-bottom: 4px; }

/* ---------- Stack em linhas ---------- */
.tech { border-top: 1px solid var(--line); }
.tech__row { --c: var(--in); display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr) minmax(0, 260px); gap: 12px 40px; align-items: baseline; padding: 24px 0; border-bottom: 1px solid var(--line); }
.tech__name { display: flex; align-items: baseline; gap: 14px; }
.tech__name::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent), 0 0 12px var(--c); transform: translateY(-2px); }
.tech__name h3 { margin: 0; font-size: var(--fs-md); }
.tech__name small { display: block; font-family: var(--font-body); font-size: var(--fs-xs); color: var(--text-3); font-weight: 400; margin-top: 4px; letter-spacing: 0; }
.tech__row p { margin: 0; color: var(--text-2); font-size: var(--fs-sm); }
.tech__tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tech__tags code { font-size: 12px; }
@media (max-width: 960px) {
  .tech__row { grid-template-columns: 1fr; gap: 10px; padding: 20px 0; }
  .tech__tags { justify-content: flex-start; padding-left: 23px; }
  .tech__row p { padding-left: 23px; }
}

/* ---------- Papéis de nó ---------- */
.roles th .role-h { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-family: var(--font-display); font-size: var(--fs-base); }
.roles th .role-h svg { width: 17px; height: 17px; color: var(--in); }
.roles thead th { white-space: normal; vertical-align: bottom; }
.roles thead th small { display: block; font-family: var(--font-body); font-weight: 400; color: var(--text-3); font-size: 12px; margin-top: 2px; }
.roles tbody th { color: var(--text-2); font-weight: 500; }
.roles td.yes::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 8px; vertical-align: 1px; }
.roles td.no::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--text-4); margin-right: 8px; vertical-align: 1px; }
.roles table { min-width: 640px; }

.watch { margin-top: 28px; }
.watch__track { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.watch__track li { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--text-3); line-height: 1.35; }
.watch__track li b { display: block; height: 30px; border-radius: 7px; border: 1px solid rgba(61,214,140,.45); background: rgba(61,214,140,.12); position: relative; }
.watch__track li b::after { content: "200"; position: absolute; inset: 0; display: grid; place-items: center; font: 500 11px var(--font-mono); color: var(--ok); }
.watch__track li.fail b { border-color: rgba(255,97,112,.5); background: rgba(255,97,112,.12); }
.watch__track li.fail b::after { content: "falha"; color: #ff8a95; }
.watch__track li.pull b { border-color: rgba(244,203,85,.5); background: rgba(244,203,85,.1); }
.watch__track li.pull b::after { content: "retira"; color: var(--warn); }
/* Rótulos traduzidos das páginas en/ e es/ */
:lang(en) .watch__track li.fail b::after { content: "fail"; }
:lang(en) .watch__track li.pull b::after { content: "pull"; }
:lang(es) .watch__track li.fail b::after { content: "falla"; }
.watch__track time { font-family: var(--font-mono); color: var(--text-4); }
@media (max-width: 640px) { .watch__track { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 14px; } }

/* ---------- XDP ---------- */
.heur { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.heur > div { padding: 22px 22px 20px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.heur > div:nth-child(3n+1) { border-left: 0; }
.heur > div:nth-child(-n+3) { border-top: 0; }
.heur h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: var(--fs-base); margin: 0 0 8px; }
.heur h3 svg { width: 18px; height: 18px; color: var(--attack); flex: none; }
.heur p { font-size: var(--fs-sm); color: var(--text-3); margin: 0; }
.heur .lim { display: block; margin-top: 12px; font: 500 12px var(--font-mono); color: var(--text-2); }
@media (max-width: 1024px) {
  .heur { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heur > div { border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
  .heur > div:nth-child(odd) { border-left: 0; }
  .heur > div:nth-child(-n+2) { border-top: 0; }
}
@media (max-width: 640px) {
  .heur { grid-template-columns: 1fr; }
  .heur > div { border-left: 0 !important; border-top: 1px solid var(--line); }
  .heur > div:first-child { border-top: 0; }
}
.refl { margin-top: 36px; }
.refl__h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; margin-bottom: 14px; }
.refl__h h3 { margin: 0; font-size: var(--fs-md); }
.refl__h p { margin: 0; font-size: var(--fs-sm); color: var(--text-3); }
.refl ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 8px; }
.refl li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 12px; border: 1px solid rgba(255,97,112,.22); border-radius: var(--r-sm); background: rgba(255,97,112,.05); font-size: var(--fs-sm); color: var(--text-1); }
.refl li span { font: 500 12px var(--font-mono); color: #ff9aa4; }

/* ---------- Appliance ---------- */
.nic { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 18px 18px 14px; }
.nic svg { width: 100%; height: auto; }
.nic figcaption { margin-top: 10px; font-size: var(--fs-xs); color: var(--text-3); line-height: 1.5; }
.nic .n-card { fill: #0d1c3a; stroke: #2f4a7a; }
.nic .n-chassis { fill: #081226; stroke: var(--line-strong); }
.nic .n-port { fill: #050b18; stroke: var(--in); }
.nic .n-rt { fill: #10203d; stroke: var(--line-strong); }
.nic .n-link { fill: none; stroke-width: 2; }
.nic .n-a { stroke: var(--in); }
.nic .n-b { stroke: var(--out); }
.nic .n-t { font-family: var(--font-display); font-weight: 600; font-size: 14px; fill: var(--text-1); }
.nic .n-s { font-family: var(--font-mono); font-size: 11px; fill: var(--text-3); }
.nic .n-lacp { font-family: var(--font-mono); font-size: 11px; }
.edges { display: grid; gap: 10px; margin: 24px 0 0; }
.edge-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(12,24,48,.6); }
.edge-row strong { color: var(--text-1); font-weight: 600; }
.edge-row p { grid-column: 1 / -1; margin: 0; font-size: var(--fs-sm); color: var(--text-3); }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status--ok { color: var(--ok); border: 1px solid rgba(61,214,140,.35); background: rgba(61,214,140,.08); }
.status--warn { color: var(--warn); border: 1px solid rgba(244,203,85,.35); background: rgba(244,203,85,.08); }
@media (max-width: 480px) { .edge-row { grid-template-columns: 1fr; } .edge-row .status { justify-self: start; } }

/* ---------- Protocolos ---------- */
.protos { display: grid; gap: 22px; }
.protos div h3 { font-size: var(--fs-sm); font-family: var(--font-body); color: var(--text-3); font-weight: 500; margin: 0 0 10px; letter-spacing: 0; }
.protos ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.protos li { padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: rgba(12,24,48,.7); font: 400 13px var(--font-mono); color: var(--text-1); }
.protos li small { color: var(--text-3); font-size: 11.5px; margin-left: 4px; }
.vendors td:first-child { color: var(--text-1); font-weight: 600; white-space: nowrap; }
.vendors td:first-child small { display: block; font-weight: 400; color: var(--text-3); font-size: 12px; }
.vendors table { min-width: 620px; }

/* ---------- Integrações ---------- */
.ints { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.ints li { display: grid; grid-template-columns: 34px 1fr; align-content: start; gap: 4px 14px; padding: 20px 20px 20px 0; border-bottom: 1px solid var(--line); }
.ints li svg { width: 20px; height: 20px; color: var(--in); margin-top: 2px; }
.ints strong { color: var(--text-1); font-weight: 600; }
.ints span { grid-column: 2; font-size: var(--fs-sm); color: var(--text-3); line-height: 1.5; }
@media (max-width: 960px) { .ints { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .ints { grid-template-columns: 1fr; } }

/* ---------- Licença: carência ---------- */
.grace { margin-top: 26px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.grace__h { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-xs); color: var(--text-3); margin-bottom: 12px; }
.grace__bar { position: relative; height: 12px; border-radius: 99px; background: linear-gradient(90deg, rgba(61,214,140,.55), rgba(61,214,140,.25) 70%, rgba(244,203,85,.5)); }
.grace__bar i { position: absolute; top: -4px; width: 2px; height: 20px; background: var(--abyss); }
.grace__scale { display: flex; justify-content: space-between; margin-top: 10px; font: 500 12px var(--font-mono); color: var(--text-3); }
.caps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- Dimensionamento ---------- */
.sizing table { min-width: 720px; }
.sizing thead th { white-space: normal; vertical-align: bottom; font-size: var(--fs-sm); }
.sizing thead th small { display: block; font-weight: 400; color: var(--text-3); font-size: 12px; margin-top: 2px; }
.sizing tbody th { color: var(--text-3); font-weight: 500; white-space: nowrap; }
.sizing td { color: var(--text-1); }
.sizing .is-rec { background: rgba(47,107,255,.07); }
.sizing thead .is-rec { box-shadow: inset 0 2px 0 var(--shield); }
.sizing-notes { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
@media (max-width: 760px) { .sizing-notes { grid-template-columns: 1fr; } }

/* ---------- Ajustes gerais ---------- */
figure.flow, figure.nic, figure.readout { margin: 0; }
.pf-grid > * { min-width: 0; }
.table-wrap tbody tr:last-child th { border-bottom: 0; }
.modes tbody th { white-space: nowrap; color: var(--text-2); font-weight: 500; }
.modes table { min-width: 460px; }
.stages code { white-space: nowrap; }
.split > *, .pf-hero > * { min-width: 0; }
.modes thead th { white-space: normal; }
.modes thead .plan { margin-top: 4px; }
