/* PRTG-N — estilos */

:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #f0f2f5;
  --hover: #f4f6f9;
  --line: #e4e7ec;
  --line-2: #d3d8df;
  --text: #121620;
  --text-2: #4b5462;
  --text-3: #808998;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --ok: #18a058;
  --bad: #dc3a3a;
  --warn: #c27803;
  --off: #a2a9b4;
  --pend: #c27803;
  --rx: #0f9a8a;
  --tx: #6a55d4;
  --chart-grid: #eceef2;
  --logo-bg: #121620;
  --logo-fg: #34d3b6;
  --shadow-pop: 0 10px 40px rgba(16, 22, 32, .16), 0 2px 6px rgba(16, 22, 32, .06);
  --r: 10px;
  --r-sm: 7px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216; --panel: #15191f; --panel-2: #1b2028; --hover: #1a1f26; --line: #232931; --line-2: #2f3640;
    --text: #e7eaef; --text-2: #a9b1bd; --text-3: #6d7685;
    --accent: #5b8def; --ok: #34c77b; --bad: #f2555a; --warn: #f0a33a; --off: #5d6674; --pend: #f0a33a;
    --rx: #2fc6b2; --tx: #a596ff; --chart-grid: #1f252d; --logo-bg: #e7eaef; --logo-fg: #0f9a8a;
    --shadow-pop: 0 12px 40px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1216; --panel: #15191f; --panel-2: #1b2028; --hover: #1a1f26; --line: #232931; --line-2: #2f3640;
  --text: #e7eaef; --text-2: #a9b1bd; --text-3: #6d7685;
  --accent: #5b8def; --ok: #34c77b; --bad: #f2555a; --warn: #f0a33a; --off: #5d6674; --pend: #f0a33a;
  --rx: #2fc6b2; --tx: #a596ff; --chart-grid: #1f252d; --logo-bg: #e7eaef; --logo-fg: #0f9a8a;
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 var(--font); letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: 21px; }
h3 { font-size: 15px; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--text-3); }
.i { width: 18px; height: 18px; flex: none; }
.spacer { flex: 1; }

/* ---------- layout ---------- */
#app { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--line); padding: 16px 10px; background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: -.02em; padding: 2px 8px 18px; }
.brand b { color: var(--rx); font-weight: 700; }
.brand .logo svg { width: 26px; height: 26px; display: block; }
.brand.big { justify-content: center; font-size: 21px; padding: 0; }
.brand.big .logo svg { width: 34px; height: 34px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500; position: relative;
}
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.active { background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.nav a.active .i { color: var(--accent); }
.badge {
  margin-left: auto; min-width: 19px; height: 19px; padding: 0 6px; border-radius: 99px; background: var(--bad); color: #fff;
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
}
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 12px; }
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--off); flex: none; transition: background .3s; }
.conn.ok { background: var(--ok); }
.conn.bad { background: var(--bad); }
.view { min-width: 0; }
.page { padding: 22px 28px 60px; max-width: 1320px; margin: 0 auto; }
.tabbar { display: none; }

.head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; min-height: 36px; }
.head .sub { color: var(--text-3); font-size: 13px; }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 13px; margin: -4px 0 8px -4px; padding: 4px; border-radius: 6px; }
.crumb:hover { color: var(--text); }
.crumb .i { width: 16px; height: 16px; }
.title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.title-row h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-3); font-size: 13px; margin-top: 4px; }
.meta-row span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.meta-row .i { width: 14px; height: 14px; }

.section-label {
  display: flex; align-items: center; gap: 8px; margin: 26px 0 10px;
  font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3);
}
.section-label .count { font-weight: 600; color: var(--text-3); letter-spacing: 0; text-transform: none; }

/* ---------- elementos ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.panel-pad { padding: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 12px;
  border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--panel); cursor: pointer;
  font-weight: 550; font-size: 13.5px; white-space: nowrap; color: var(--text); transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(.5px); }
.btn .i { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.icon { width: 34px; padding: 0; }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.sm.icon { width: 28px; }
.btn.block { width: 100%; height: 40px; }
.btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--off); flex: none; display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }
.dot.warn, .dot.pend { background: var(--warn); }
.dot.lg { width: 10px; height: 10px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 5px;
  font-size: 11.5px; font-weight: 600; background: var(--panel-2); color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.tag .i { width: 12px; height: 12px; }
.tag.ok { background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok); }
.tag.bad { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }
.tag.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.tag.off { color: var(--text-3); }
.tag.line { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }

input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  height: 36px; padding: 0 11px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--panel); width: 100%; outline: none;
}
textarea { height: auto; padding: 9px 11px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 550; color: var(--text-2); }
.field small, .hint { font-weight: 400; color: var(--text-3); font-size: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13px; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }

.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--panel-2); gap: 1px; }
.seg button {
  border: 0; background: transparent; padding: 0 10px; height: 28px; border-radius: 6px; cursor: pointer;
  color: var(--text-2); font-weight: 550; font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08), inset 0 0 0 1px var(--line); }

.search { position: relative; flex: 1; min-width: 180px; max-width: 340px; }
.search .i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.search input { padding-left: 33px; }

.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty p { margin: 0 auto 16px; max-width: 420px; }
.loading { display: flex; justify-content: center; padding: 80px 0; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }


/* problemas */

/* barra de filtros */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.caret { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; color: var(--text-3); border-radius: 5px; }
.caret .i { width: 16px; height: 16px; transition: transform .15s; }
.ports { border-top: 1px solid var(--line); }
.port-name { display: flex; flex-direction: column; min-width: 0; }
.port-name b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.port-name small { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.port-name .flags { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: 1px; }
.rate { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; font-weight: 550; }
.rate.rx { color: var(--rx); }
.rate.tx { color: var(--tx); }
.rate .u { color: var(--text-3); font-weight: 500; font-size: 11.5px; margin-left: 2px; }
.rate .arr { font-size: 11px; margin-right: 3px; opacity: .8; }
.spark { width: 100%; height: 28px; display: block; }
.spark .sp-a { fill: var(--rx); fill-opacity: .12; }
.spark .sp-rx { fill: none; stroke: var(--rx); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.spark .sp-tx { fill: none; stroke: var(--tx); stroke-width: 1.2; vector-effect: non-scaling-stroke; opacity: .85; }

/* ---------- inicio ---------- */
.hm-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.hm-top h1 { margin-right: 4px; }
.hm-kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.hm-kpi {
  display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 8px; min-width: 124px; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; font: inherit; color: inherit;
}
.hm-kpi:hover { border-color: var(--line-2); }
.hm-kpi.on { border-color: var(--text-3); box-shadow: 0 0 0 1px var(--text-3); }
.hm-kpi.zero { opacity: .55; }
.hm-kpi .sq { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: none; }
.hm-kpi .sq svg { width: 20px; height: 20px; }
.hm-kpi .sq.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.hm-kpi .sq.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.hm-kpi .sq.warn { background: color-mix(in srgb, var(--warn) 17%, transparent); color: var(--warn); }
.hm-kpi .t { display: flex; flex-direction: column; line-height: 1.15; }
.hm-kpi b { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.hm-kpi small { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.hm-search { max-width: 240px; }
.hm-bell {
  position: relative; width: 36px; height: 34px; flex: none; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--panel); color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.hm-bell:hover { background: var(--hover); }
.hm-bell svg { width: 18px; height: 18px; }
.hm-bell .c {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg);
}
.hm-bell .c.warn { background: var(--warn); }
.hm-bell .c[hidden] { display: none; }

.hm-r { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; overflow: hidden; }
.hm-r.paused { opacity: .6; }
.hm-rh { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.hm-rh .nm { font-weight: 650; font-size: 13.5px; white-space: nowrap; }
.hm-rh .nm:hover { color: var(--accent); }
.hm-rh .meta { color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-rh .st { margin-left: auto; color: var(--text-3); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.hm-rh .st b { color: var(--text-2); font-weight: 600; }
.hm-rh .st .bad, .hm-rh .st b.bad { color: var(--bad); }
.hm-rh .st b.warn { color: var(--warn); }
.hm-r.down .hm-rh { border-bottom: 0; }
.hm-r.down .hm-rh .nm { color: var(--bad); }
.hm-empty { padding: 10px 14px; color: var(--text-3); font-size: 13px; }
.hm-empty a { color: var(--accent); }

.hm-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.hm-c {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 10px; align-items: center; padding: 8px 14px 8px 10px; min-width: 0;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0;
}
.hm-c:hover { background: var(--hover); }
.hm-c.bad { background: color-mix(in srgb, var(--bad) 7%, transparent); }
.hm-c.off { opacity: .65; }
.hm-c.hide { display: none; }
.hm-pi { grid-row: span 2; display: flex; flex-direction: column; align-items: center; gap: 1px; --s: var(--ok); color: var(--text-3); }
.hm-pi.warn { --s: var(--warn); }
.hm-pi.bad { --s: var(--bad); }
.hm-pi.off { --s: var(--off); }
.hm-pi svg { width: 24px; height: 20px; display: block; }
.hm-pi .led { fill: var(--s); }
.hm-pi.bad .led.b { fill: var(--off); }
.hm-pi small { font: 600 10px/1 var(--mono); white-space: nowrap; max-width: 44px; overflow: hidden; text-overflow: ellipsis; }
.hm-pi.bad small { color: var(--bad); }
.hm-l1 { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 600; min-width: 0; }
.hm-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-hw { font: 500 10.5px/1 var(--mono); color: var(--text-3); white-space: nowrap; }
.hm-lock { display: inline-flex; color: var(--text-3); }
.hm-lock .i { width: 12px; height: 12px; }
.hm-rate { margin-left: auto; font-size: 10.5px; font-weight: 650; color: var(--text-3); white-space: nowrap; letter-spacing: .01em; }
.hm-rate.warn { color: var(--warn); }
.hm-pair { display: flex; align-items: center; gap: 12px; white-space: nowrap; margin-top: 2px; font-size: 14.5px; }
.hm-pair > span { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; font-variant-numeric: tabular-nums; }
.hm-pair .u { color: var(--text-3); font-size: .8em; font-weight: 500; margin-left: 1px; }
.hm-pair .ic { width: 12px; height: 12px; flex: none; }
.hm-pair .ic.dn { color: var(--rx); }
.hm-pair .ic.up { color: var(--tx); }
.hm-off { color: var(--bad); font-weight: 650; margin-top: 2px; font-size: 13px; }
.hm-c.off .hm-off { color: var(--text-3); }
.hm-more {
  display: flex; align-items: center; justify-content: center; gap: 4px; padding: 8px 14px; min-height: 52px; font: inherit;
  border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0;
  background: var(--panel-2); color: var(--text-2); font-size: 12.5px; font-weight: 650; cursor: pointer;
}
.hm-more:hover { color: var(--text); }
.hm-more small { color: var(--text-3); font-weight: 500; font-size: 12px; }

.hm-inc header { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.hm-inc-list { max-height: min(60vh, 520px); overflow-y: auto; }
.hm-inc-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 18px; border-top: 1px solid var(--line); }
.hm-inc-row:first-child { border-top: 0; }
.hm-inc-row:hover { background: var(--hover); }
.hm-inc-row .dot { margin-top: 6px; }
.hm-inc-row .what { flex: 1; min-width: 0; }
.hm-inc-row .what b { display: block; font-weight: 600; font-size: 13.5px; }
.hm-inc-row .what > span { color: var(--text-2); font-size: 12.5px; }
.hm-inc-row .kind { color: var(--text-3); font-weight: 600; }
.hm-inc-row time { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.hm-inc-none { padding: 18px; margin: 0; color: var(--text-3); text-align: center; }

/* ---------- tablas ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3);
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel);
}
.tbl td { padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:first-child td { border-top: 0; }
.tbl tbody tr.link { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.tbl .nowrap { white-space: nowrap; }
.cell-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cell-name > div { display: flex; flex-direction: column; min-width: 0; }
.cell-name b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-name small { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.iconbtn {
  width: 28px; height: 28px; border-radius: 6px; border: 0; background: transparent; color: var(--text-3); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.iconbtn:hover { background: var(--panel-2); color: var(--text); }
.iconbtn .i { width: 16px; height: 16px; }
.iconbtn.on { color: var(--warn); }
.iconbtn.on.star .i { fill: currentColor; }
.iconbtn.locked { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.iconbtn[data-lock]:not(.locked) { opacity: .4; }
tr:hover .iconbtn[data-lock]:not(.locked) { opacity: 1; }
.iconbtn:disabled { opacity: .3; pointer-events: none; }

/* ---------- detalle ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  padding: 9px 12px; color: var(--text-3); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs a .badge { margin-left: 6px; }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.kv > div { padding: 11px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; min-width: 0; }
.kv label { display: block; color: var(--text-3); font-size: 11.5px; font-weight: 550; margin-bottom: 2px; }
.kv div > span { display: block; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv .bad { color: var(--bad); }
.kv .warn { color: var(--warn); }

.live { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.live > div { padding: 12px 16px; }
.live > div + div { border-left: 1px solid var(--line); }
.live label { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.live label::before { content: ""; width: 9px; height: 3px; border-radius: 2px; background: currentColor; }
.live .rx label { color: var(--rx); }
.live .tx label { color: var(--tx); }
.live .v { font-size: 30px; font-weight: 650; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.live .v .u { font-size: 15px; color: var(--text-3); font-weight: 550; margin-left: 4px; letter-spacing: 0; }
.live .sub { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* gráfico */
.chart-panel { padding: 12px 12px 8px; }
.chart-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-tools .grp { display: inline-flex; gap: 2px; }
.chart-tools .live-btn { display: inline-flex; align-items: center; gap: 6px; }
.chart-tools .live-btn i { width: 7px; height: 7px; border-radius: 50%; background: var(--off); }
.chart-tools .live-btn.on i { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.readout {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 26px; padding: 2px 4px 6px;
  font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.readout .when { color: var(--text-3); min-width: 120px; }
.readout .s { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; border-radius: 5px; padding: 1px 4px; margin: -1px -4px; }
.readout .s:hover { background: var(--hover); }
.readout .s i { width: 10px; height: 3px; border-radius: 2px; }
.readout .s.off { opacity: .4; }
.readout .s b { font-weight: 650; color: var(--text); }
.readout .s.band i { height: 8px; border-radius: 2px; opacity: .5; }
.readout .s.peak i { height: 1px; }
.readout .res { margin-left: auto; color: var(--text-3); font-size: 11.5px; }
.tc { position: relative; outline: none; touch-action: pan-y; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.tc canvas { display: block; width: 100%; }
.tc:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 6px; }
.chart-hint { font-size: 11.5px; color: var(--text-3); padding: 4px 4px 0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.stats > div { padding: 11px 14px; border-left: 1px solid var(--line); min-width: 0; }
.stats > div:first-child { border-left: 0; }
.stats label { display: block; color: var(--text-3); font-size: 11.5px; font-weight: 550; margin-bottom: 3px; }
.stats .rx, .stats .tx { display: block; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.stats .rx { color: var(--rx); }
.stats .tx { color: var(--tx); }
.stats .range { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding: 7px 14px; font-size: 12px; color: var(--text-3); }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.card-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.card-h h3 { font-size: 14px; }
.card-b { padding: 12px 14px; }
.setting-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); }
.setting-row:first-child { border-top: 0; }
.setting-row .txt { flex: 1; min-width: 0; }
.setting-row .txt b { display: block; font-weight: 600; font-size: 13.5px; }
.setting-row .txt span { display: block; color: var(--text-3); font-size: 12.5px; }

.switch { position: relative; width: 36px; height: 21px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 99px; transition: background .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(15px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

/* eventos */
.ev-day { font-size: 12px; font-weight: 650; color: var(--text-3); padding: 14px 2px 6px; text-transform: uppercase; letter-spacing: .06em; }
.ev-list { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; }
.ev { display: grid; grid-template-columns: 52px 22px minmax(0, 1fr); gap: 8px; align-items: start; padding: 9px 14px; border-top: 1px solid var(--line); }
.ev:first-child { border-top: 0; }
.ev time { color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.ev .ic { width: 20px; height: 20px; border-radius: 5px; display: flex; align-items: center; justify-content: center; margin-top: 0; }
.ev .ic .i { width: 13px; height: 13px; }
.ev .ic.down { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.ev .ic.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.ev .ic.up { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.ev .ic.info { background: var(--panel-2); color: var(--text-3); }
.ev .msg { min-width: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.ev .msg a:hover { color: var(--accent); }
.ev .kindtag { font-size: 11px; color: var(--text-3); margin-left: 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 28px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer;
  font-size: 12.5px; font-weight: 550; color: var(--text-2);
}
.chip:hover { color: var(--text); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }

.log { font-family: var(--mono); font-size: 12px; line-height: 1.6; }
.log .row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; padding: 3px 14px; border-top: 1px solid var(--line); }
.log .row:first-child { border-top: 0; }
.log .t { color: var(--text-3); white-space: nowrap; }
.log .m { overflow-wrap: anywhere; }
.log .m.down { color: var(--bad); }

/* backups */
.bk-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.bk-row:first-child { border-top: 0; }
.bk-row b { font-weight: 600; }
.bk-row .sub { color: var(--text-3); font-size: 12.5px; display: flex; gap: 10px; flex-wrap: wrap; }
.diff { font-family: var(--mono); font-size: 12px; line-height: 1.55; max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel-2); }
.diff .sec { padding: 6px 12px 2px; color: var(--text-3); font-weight: 600; }
.diff .l { padding: 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff .l.add { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--text); }
.diff .l.add::before { content: "+ "; color: var(--ok); }
.diff .l.del { background: color-mix(in srgb, var(--bad) 11%, transparent); color: var(--text); }
.diff .l.del::before { content: "− "; color: var(--bad); }
pre.code { font-family: var(--mono); font-size: 12px; line-height: 1.55; max-height: 60vh; overflow: auto; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel-2); white-space: pre; }

/* ---------- diálogos, menú, avisos ---------- */
dialog {
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); padding: 0;
  width: min(480px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow-pop);
}
dialog.wide { width: min(820px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(8, 11, 16, .5); }
.dlg header { padding: 16px 18px 0; display: flex; align-items: center; gap: 8px; }
.dlg header h3 { font-size: 16px; }
.dlg-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; color: var(--text-2); }
.dlg-body b { color: var(--text); }
.dlg footer { padding: 12px 18px 16px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); }
.dlg footer .left { margin-right: auto; }
.dlg .fieldset-title { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-top: 6px; }
.note { font-size: 12.5px; color: var(--text-2); background: var(--panel-2); padding: 9px 11px; border-radius: var(--r-sm); line-height: 1.5; }
.note code { font-family: var(--mono); font-size: 11.5px; }
.note.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.note.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.note.warn { color: var(--text); background: color-mix(in srgb, var(--warn) 14%, transparent); }

.menu-pop {
  position: absolute; z-index: 60; min-width: 190px; padding: 5px; border-radius: 10px; background: var(--panel);
  border: 1px solid var(--line); box-shadow: var(--shadow-pop);
}
.menu-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; background: transparent; border-radius: 6px;
  cursor: pointer; text-align: left; font-size: 13.5px; color: var(--text);
}
.menu-pop button:hover { background: var(--hover); }
.menu-pop button .i { width: 16px; height: 16px; color: var(--text-3); }
.menu-pop button.danger, .menu-pop button.danger .i { color: var(--bad); }
.menu-pop button:disabled { opacity: .4; }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 80; pointer-events: none; }
.toast {
  pointer-events: auto; background: var(--text); color: var(--bg); border-radius: 9px; padding: 9px 14px; max-width: 380px;
  font-size: 13px; box-shadow: var(--shadow-pop); animation: tin .18s ease; border-left: 3px solid var(--accent);
}
.toast.ok { border-left-color: var(--ok); }
.toast.bad { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }
.toast.out { opacity: 0; transform: translateY(4px); transition: all .25s; }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } }

/* login */
#auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth { width: min(340px, 100%); display: flex; flex-direction: column; gap: 12px; }
.auth p { margin: 0 0 6px; color: var(--text-3); text-align: center; font-size: 13px; }
.auth input { height: 42px; }
.form-err { color: var(--bad); font-size: 13px; min-height: 18px; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .cols { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 14.5px; }
  #app { display: block; }
  .side { display: none; }
  .page { padding: calc(14px + env(safe-area-inset-top)) 14px calc(84px + env(safe-area-inset-bottom)); }
  h1 { font-size: 19px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid var(--line); padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--text-3); padding: 5px 0; position: relative; }
  .tabbar a .i { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--text); }
  .tabbar a.active .i { color: var(--accent); }
  .tabbar .badge { position: absolute; top: 0; left: calc(50% + 5px); height: 16px; min-width: 16px; font-size: 10px; padding: 0 4px; }




  .hm-top h1 { flex: 1; }
  .hm-kpis { order: 4; width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .hm-kpi { min-width: 0; flex-direction: column; align-items: flex-start; gap: 6px; padding: 9px 10px; }
  .hm-kpi .sq { width: 28px; height: 28px; }
  .hm-kpi .sq svg { width: 17px; height: 17px; }
  .hm-kpi small { white-space: normal; }
  .hm-search { order: 5; max-width: none; flex-basis: 100%; }
  .hm-top > .spacer { display: none; }
  .hm-cells { grid-template-columns: 1fr 1fr; }
  .hm-c { grid-template-columns: 34px minmax(0, 1fr); gap: 0 7px; padding: 8px 8px 8px 6px; }
  .hm-pair { font-size: 13px; gap: 8px; }
  .hm-rh .meta, .hm-hw { display: none; }

  .search { max-width: none; flex-basis: 100%; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .live .v { font-size: 24px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .chart-tools .hide-sm { display: none; }
  .readout .res { display: none; }
  .log .row { grid-template-columns: 1fr; gap: 0; }
  .toasts { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .tbl th, .tbl td { padding: 8px 9px; }
  .ev { grid-template-columns: 44px 20px minmax(0, 1fr); padding: 9px 12px; }
  dialog { width: calc(100vw - 16px); }
}

@media (min-width: 761px) {
  .rates-sm { display: none; }
}

/* gráfico: leyenda y tooltip */
.legend { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 6px; }
.legend .lg {
  display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; cursor: pointer;
  padding: 3px 8px; border-radius: 6px; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.legend .lg:hover { background: var(--hover); }
.legend .lg i { width: 12px; height: 3px; border-radius: 2px; }
.legend .lg b { color: var(--text); font-weight: 650; }
.legend .lg.off { opacity: .4; }
.tc-tip {
  position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3; min-width: 150px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow-pop);
  padding: 7px 10px; font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.tc-tip .t { font-weight: 650; margin-bottom: 4px; color: var(--text); }
.tc-tip .r { display: flex; align-items: center; gap: 7px; color: var(--text-2); line-height: 1.6; }
.tc-tip .r i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.tc-tip .r b { margin-left: auto; padding-left: 14px; color: var(--text); font-weight: 650; }

@media (max-width: 420px) {
  .hm-pair { flex-direction: column; align-items: flex-start; gap: 0; }
}

/* visores: sin botones de administración (el servidor igual los rechaza) */
body.viewer .adm { display: none !important; }
.radio-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); margin-top: 6px; cursor: pointer; font-weight: 400; }
.radio-row input { margin-top: 3px; }
.radio-row span { display: flex; flex-direction: column; gap: 2px; }
.radio-row small { color: var(--text-3); font-size: 12px; line-height: 1.35; }
.radio-row:has(input:checked) { border-color: var(--accent); }
.setting-row .txt b .tag { display: inline-flex; width: auto; margin-left: 6px; vertical-align: 1px; }
