:root {
  --bg: #eef1f4; --card: #fff; --text: #17202b; --muted: #5f6b78; --line: #dce2e8; --head: #f7f9fb;
  --ok: #12a150; --degraded: #d98b0b; --down: #d7263d; --idle: #95a1ad; --accent: #0b6bcb;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Mono", "SF Mono", "DejaVu Sans Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0a0e13; --card: #111821; --text: #dbe3ec; --muted: #7f8c9a; --line: #1e2935; --head: #0d131a;
    --ok: #22c55e; --degraded: #f0a020; --down: #f04458; --idle: #5b6773; --accent: #38bdf8; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.4 system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
small { color: var(--muted); font-weight: 400; }
.top { display: flex; align-items: stretch; gap: 24px; padding: 0 20px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font: 700 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.brand::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.brand:hover { text-decoration: none; }
.top nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.top nav a { padding: 14px 10px 12px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--text); text-decoration: none; }
.top nav a.on { color: var(--text); border-bottom-color: var(--accent); }
.logout { display: flex; gap: 10px; align-items: center; color: var(--muted); margin: 0; }
button, .search input, .search select, .login input { font: inherit; padding: 5px 12px; border-radius: 3px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
button { cursor: pointer; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
h1 { font-size: 18px; margin: 4px 0; letter-spacing: .01em; } h2 { font-size: 16px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
h2 small { margin-left: auto; } h3 { font-size: 15px; margin: 0 0 8px; } h4 { font-size: 13px; margin: 0 0 4px; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; margin-bottom: 10px; overflow-x: auto; }
.banner { --state: var(--idle); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 10px 16px; border-radius: 4px; margin-bottom: 12px;
  color: var(--text); background: color-mix(in srgb, var(--state) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--state) 45%, var(--line)); border-left: 4px solid var(--state); }
.banner strong { font-size: 15px; color: var(--state); text-transform: uppercase; letter-spacing: .04em; }
.banner span { font: 13px var(--mono); color: var(--muted); }
.banner time { margin-left: auto; font: 13px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.banner.ok { --state: var(--ok); } .banner.degraded { --state: var(--degraded); } .banner.down { --state: var(--down); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--idle); margin-right: 8px; flex: none; vertical-align: 1px; }
.dot.ok { background: var(--ok); box-shadow: 0 0 5px color-mix(in srgb, var(--ok) 70%, transparent); }
.dot.degraded { background: var(--degraded); box-shadow: 0 0 5px color-mix(in srgb, var(--degraded) 70%, transparent); }
.dot.down { background: var(--down); box-shadow: 0 0 6px var(--down); animation: led-blink 1.2s steps(2, jump-none) infinite; }
@keyframes led-blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot.down { animation: none; } }
.pill { font: 600 11px var(--mono); letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; color: #fff; background: var(--idle); vertical-align: middle; }
.pill.ok { background: var(--ok); } .pill.degraded { background: var(--degraded); } .pill.down { background: var(--down); }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font: 600 11px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 5px 8px; background: var(--head); border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid td { padding: 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid tbody tr:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.grid tr:last-child td { border-bottom: 0; }
.grid .n { text-align: right; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.grid tr.down td { background: color-mix(in srgb, var(--down) 10%, transparent); }
.grid tr.degraded td { background: color-mix(in srgb, var(--degraded) 10%, transparent); }
.grid tr.standby td, .grid tr.nodata td { color: var(--muted); }
.warn { color: var(--down); font-weight: 600; }
.tag { font: 11px var(--mono); letter-spacing: .03em; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--line); color: var(--muted); background: var(--head); }
.empty, .note { color: var(--muted); } .note { font-size: 13px; margin: 8px 0 0; }
.ranges { display: flex; gap: 4px; } .ranges a { padding: 4px 10px; border-radius: 3px; font-size: 13px; color: var(--muted); border: 1px solid var(--line); background: var(--card); }
.ranges a.on { color: var(--text); font-weight: 600; border-color: var(--accent); }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; } .chart .axis { fill: var(--muted); font-size: 11px; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 0; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; } .legend b { color: var(--text); margin-left: 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 10px 14px; display: flex; flex-direction: column; }
.tile span { font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); } .tile b { font: 600 22px var(--mono); font-variant-numeric: tabular-nums; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.bar { width: 90px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; } .bar i { display: block; height: 100%; background: var(--accent); }
.search { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; } .search input { min-width: 240px; }
.login { max-width: 340px; margin: 60px auto; display: flex; flex-direction: column; gap: 12px; } .login label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.grid tr.group td { font: 700 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); padding-top: 10px; border-bottom: 1px solid var(--line); }
.grid tbody tr.group:hover td { background: none; }
.grid { table-layout: fixed; } .grid th:first-child { width: 30%; }
h2 small.tech { margin-left: 0; font: 11px var(--mono); padding: 1px 6px; border: 1px solid var(--line); border-radius: 3px; background: var(--head); }
.grid small { font-family: var(--mono); font-size: 11px; }
.grid td.sn, .grid code, code { font-family: var(--mono); }
.uchart { width: 100%; } .uchart .u-select { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.ulegend { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13px; }
.ulegend th { font-size: 11px; font-weight: 600; color: var(--muted); text-align: left; padding: 2px 8px; border-bottom: 1px solid var(--line); }
.ulegend td { padding: 3px 8px; white-space: nowrap; cursor: pointer; } .ulegend .n { text-align: right; font-variant-numeric: tabular-nums; width: 13%; }
.ulegend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; }
.ulegend tr.off td { opacity: .35; text-decoration: line-through; } .ulegend tbody tr:hover td { background: var(--bg); }
.zoomed { padding: 4px 10px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 13px; }
.flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 12px; background: color-mix(in srgb, var(--ok) 16%, var(--card)); border: 1px solid var(--ok); }
.grid.edit { table-layout: auto; } .grid.edit td { vertical-align: middle; } .grid.edit td.wrap { white-space: normal; max-width: 260px; }
.grid.edit input, .grid.edit select { font: inherit; width: 100%; min-width: 120px; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.grid.edit input.short { min-width: 90px; } .grid.edit input::placeholder { color: var(--muted); opacity: .8; }
.actions { display: flex; gap: 14px; align-items: center; margin: 12px 0 0; } .actions.sticky { position: sticky; bottom: 0; padding: 10px 0; background: var(--bg); }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.tag.on { color: var(--ok); border-color: var(--ok); }
main { max-width: 1280px; }
#topology { width: 100%; height: auto; touch-action: none; user-select: none; }
.tlink { stroke: var(--idle); stroke-width: 1.5; } .tvia { font-size: 10px; fill: var(--muted); }
.tnode { cursor: grab; } .tnode rect { fill: var(--card); stroke: var(--idle); stroke-width: 2; } .tnode text { font-size: 13px; fill: var(--text); font-weight: 600; }
.tnode.ok rect, .tnode.standby rect, .tnode.private rect { stroke: var(--ok); } .tnode.degraded rect { stroke: var(--degraded); } .tnode.down rect { stroke: var(--down); }
.tnode.unmonitored rect { stroke-dasharray: 4 3; } .tnode.unmonitored text { font-weight: 400; fill: var(--muted); }

details.node > summary { list-style: none; cursor: pointer; } details.node > summary::-webkit-details-marker { display: none; }
details.node > summary h2::before { content: "▾"; color: var(--muted); width: 14px; flex: none; }
details.node:not([open]) > summary h2::before { content: "▸"; } details.node:not([open]) > summary h2 { margin-bottom: 0; }
details.node > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.grid.edit input[type=checkbox] { width: auto; min-width: 0; padding: 0; } label.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
details.pon { border-top: 1px solid var(--line); } details.pon > summary { display: flex; gap: 14px; align-items: center; padding: 8px 4px; cursor: pointer; flex-wrap: wrap; }
details.pon > summary b { min-width: 96px; } details.pon > summary span.count { color: var(--muted); font-size: 13px; }
details.pon > summary a { margin-left: auto; font-size: 13px; } details.pon[open] > summary { font-weight: 600; }
.grid.onts { table-layout: auto; margin-bottom: 8px; } .grid.onts th:first-child { width: auto; } .grid.onts td.sn { font-family: ui-monospace, monospace; font-size: 12px; }
.rx.down { color: var(--down); font-weight: 600; } .rx.degraded { color: var(--degraded); font-weight: 600; } .rx.ok { color: var(--ok); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 18px; margin: 0; } .facts dt { font-size: 12px; color: var(--muted); } .facts dd { margin: 0; font-weight: 600; }
/* Red page: sections, minimising and the customisation mode */
.net-section { margin: 18px 0 0; } .net-section:first-child { margin-top: 4px; }
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.section-toggle { flex: 1; display: flex; align-items: center; gap: 0; border: 0; background: none; padding: 2px 0; text-align: left;
  font: 700 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.section-toggle .section-count { text-transform: none; letter-spacing: 0; }
.section-toggle::before { content: "▾"; width: 18px; flex: none; } .net-section.collapsed .section-toggle::before { content: "▸"; }
.section-toggle .section-count { margin-left: 12px; font-size: 13px; font-weight: 400; }
.net-section.collapsed .section-body { display: none; }
.grip, .section-title-edit, .section-delete, .seg-toggle, .drop-hint, .empty-section, .grid tr.seg-hidden, .grid tr.group-hidden { display: none; }
.customize-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; position: sticky; top: 0; z-index: 5;
  padding: 10px 14px; margin-bottom: 12px; border-radius: 10px; background: var(--card); border: 2px solid var(--accent); }
.customize-bar .note { margin: 0; flex: 1 1 320px; } .customize-actions { display: flex; gap: 8px; flex-wrap: wrap; }
[hidden] { display: none !important; }      /* the attribute wins over any display rule */
.customizing .empty-section { display: block; }
.customizing .net-section.collapsed .section-body { display: block; }
.customizing .grip { display: inline-block; cursor: grab; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 4px; user-select: none; }
.customizing .section-toggle { flex: 0 0 auto; cursor: default; } .customizing .section-toggle::before, .customizing .section-name { display: none; }
.customizing .section-title-edit { display: block; flex: 0 1 280px; font: inherit; font-weight: 700; padding: 4px 8px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); order: -1; }
.customizing .section-head .grip { order: -2; } .customizing .section-delete { display: inline-block; margin-left: auto; font-size: 13px; padding: 3px 10px; }
.customizing .section-body { min-height: 44px; border-radius: 8px; }
.customizing .empty-section .drop-hint { display: block; margin: 0; padding: 12px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: 8px; }
.customizing details.node > summary a { pointer-events: none; color: var(--text); }
.customizing .grid tr.group-hidden { display: table-row; }
.customizing .grid tr.seg-hidden { display: table-row; } .customizing .grid tr.seg-hidden td { opacity: .45; }
.customizing .seg-toggle { display: inline-block; font-size: 11px; padding: 0 6px; margin-right: 6px; border-radius: 4px; vertical-align: 1px; }
.seg-toggle::before { content: "ocultar"; } tr.seg-hidden .seg-toggle::before { content: "mostrar"; }
.customizing tr.seg-hidden td:first-child { opacity: 1; } .customizing tr.seg-hidden .seg-toggle { border-color: var(--accent); color: var(--accent); }
.dragging { opacity: .4; }
.moving-sections .section-body { display: none !important; }
.templates { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.templates label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.templates textarea, .facts.form input, .facts input { font: inherit; width: 100%; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.facts input.short { width: 90px; } .facts dd .warn { display: block; font-size: 13px; font-weight: 400; }
pre.msg { margin: 0; white-space: pre-wrap; font: 13px/1.4 system-ui, sans-serif; padding: 8px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
form.inline { display: flex; gap: 10px; align-items: center; margin: 0; }
button.danger { color: var(--down); border-color: var(--down); }
.flash.error { background: color-mix(in srgb, var(--down) 14%, var(--card)); border-color: var(--down); }
.facts input[type=checkbox] { width: auto; }
.grid.events th:first-child { width: 150px; } .grid.events td.wrap { max-width: none; min-width: 300px; }
a.button { display: inline-block; font: inherit; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
a.button.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; } a.button:hover { text-decoration: none; }
.top-actions { margin: 0 0 12px; justify-content: flex-end; }
form.inline-action { display: inline-flex; gap: 6px; margin: 0 0 0 10px; } form.inline-action button { font-size: 13px; padding: 3px 10px; }
h3.sub { margin: 18px 0 6px; color: var(--muted); }
.grid tr.no-segments td { color: var(--muted); font-size: 13px; white-space: normal; }
.card pre.msg { font-family: ui-monospace, monospace; font-size: 12.5px; margin: 6px 0; }
.grid.edit.form td:first-child { width: 220px; } .grid.edit.form td small { display: block; white-space: normal; margin-top: 3px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.filters input[type=search] { flex: 1 1 200px; }
.grid td.wrap { white-space: normal; overflow-wrap: anywhere; } .grid td.wrap code { white-space: normal; }
.grid.system-events { table-layout: fixed; } .grid.system-events th { width: 11%; } .grid.system-events th:nth-child(5) { width: 50%; }
.grid.system-events th:last-child { width: 6%; } .grid.system-events code { font-size: 12px; }
/* Mapas */
.new-map { display: flex; gap: 6px; } .new-map input { width: 200px; }
.map-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.map-tools .legend { display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.map-tools .legend .dot { margin-right: 4px; }
.map-layout { display: flex; gap: 12px; align-items: flex-start; }
.map-palette { flex: 0 0 240px; max-height: 75vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.map-palette input { width: 100%; } .map-palette h4 { margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
.map-palette ul { list-style: none; margin: 0; padding: 0; }
.map-palette li { padding: 5px 6px; border-radius: 6px; cursor: grab; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.map-palette li:hover { background: var(--bg); } .map-palette li.placed { color: var(--muted); }
.map-palette li.placed .dot { background: var(--ok); } .map-palette li.none { cursor: default; color: var(--muted); }
.map-stage { flex: 1 1 auto; padding: 6px; position: relative; min-width: 0; }
.map-stage:fullscreen { background: var(--bg); display: flex; align-items: center; padding: 20px; }
#map { width: 100%; height: auto; display: block; touch-action: none; user-select: none; }
.map-editing #map { background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 25px 25px; }
.map-empty { position: absolute; inset: 40% 0 auto; text-align: center; }
#map .link .line { stroke: var(--idle); stroke-width: 4; stroke-linecap: round; }
#map .link .hit { stroke: transparent; stroke-width: 18; }
#map .link.state-ok .line { stroke: var(--ok); } #map .link.state-degraded .line { stroke: var(--degraded); }
#map .link.state-down .line { stroke: var(--down); stroke-dasharray: 10 8; }
#map .link.selected .line { stroke: var(--accent); stroke-width: 6; }
#map text { font: 17px system-ui, sans-serif; fill: var(--text); text-anchor: middle; paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; }
#map .link-label { font-size: 14px; fill: var(--muted); }
#map .dot-shape { fill: var(--idle); stroke: var(--card); stroke-width: 3; }
#map .state-ok .dot-shape { fill: var(--ok); } #map .state-degraded .dot-shape { fill: var(--degraded); }
#map .state-down .dot-shape { fill: var(--down); animation: map-pulse 1.4s ease-in-out infinite; }
#map .glyph { fill: #fff; stroke: none; font-size: 17px; font-weight: 700; pointer-events: none; }
#map .free-text { font-size: 30px; font-weight: 700; fill: var(--muted); }
#map .node { cursor: default; } .map-editing #map .node { cursor: move; }
#map .node.selected .dot-shape, #map .node.link-from .dot-shape { stroke: var(--accent); stroke-width: 5; }
#map .node.selected .free-text { fill: var(--accent); }
@keyframes map-pulse { 50% { opacity: .45; } }
#map-link.on { background: var(--accent); color: #fff; }
.map-admin { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
@media (max-width: 800px) { .map-layout { flex-direction: column; } .map-palette { flex: none; width: 100%; max-height: 240px; } }
/* Router configuration (Inventario › Equipos › Configurar) */
.table-scroll { overflow-x: auto; }
.grid.segments td { vertical-align: top; } .grid.segments input { min-width: 90px; } .grid.segments textarea { min-width: 170px; font-size: 12px; }
.grid.segments tr.new-row td { background: var(--bg); } .grid.segments tr.to-delete { opacity: .5; }
.device-config textarea { width: 100%; } .small-link { font-size: 12px; }
.device-config .grid.form input.short { width: 110px; display: inline-block; }
.device-config .grid.form td:last-child { white-space: normal; }
.grid.segments td:nth-child(2) input, .grid.segments td:nth-child(3) input { min-width: 150px; }
/* Switches and antennas (SNMP) at the end of the Red page; not part of the arrangement. */
.snmp-section { margin: 18px 0 0; }
.snmp-section .section-name-static { font-size: 17px; font-weight: 600; }
.snmp-section .section-count { margin-left: 4px; font-size: 13px; color: var(--muted); }
.customizing .snmp-section { opacity: .5; pointer-events: none; }
tr.port-off td { color: var(--muted); }
/* Status as an indicator: coloured state words, the degraded detail clipped instead of overflowing. */
.grid td.st { font: 600 11.5px var(--mono); letter-spacing: .03em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; }
.grid td.st small { display: block; overflow: hidden; text-overflow: ellipsis; text-transform: none; font-weight: 400; letter-spacing: 0; }
.grid tr.ok td.st { color: var(--ok); } .grid tr.degraded td.st { color: var(--degraded); } .grid tr.down td.st { color: var(--down); }
h2 small.state { font: 600 11px var(--mono); letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; border: 1px solid currentColor; }
h2 small.state.ok { color: var(--ok); } h2 small.state.degraded { color: var(--degraded); } h2 small.state.down { color: var(--down); }
.section-toggle::before { font-size: 14px; }
/* Fixed-layout tables never let a long cell spill over its neighbour: cut it with "…" (cells marked .wrap wrap instead). */
.grid td { overflow: hidden; text-overflow: ellipsis; }
.grid td.wrap { text-overflow: clip; }
.grid.reports th:first-child { width: 16%; } .grid.reports th:nth-child(2) { width: 34%; } .grid.reports th:nth-child(3) { width: 7%; }
.facts select { font: inherit; padding: 6px 8px; border-radius: 3px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
