:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --side: #0b1324;
  --side-text: #cbd5e1;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --up: #16a34a;
  --warning: #f59e0b;
  --down: #dc2626;
  --unknown: #94a3b8;
  --paused: #64748b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .04);
}
* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
  display: grid; grid-template-columns: 232px 1fr;
}
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 22px; margin: 0; font-weight: 700; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 600; }
svg.ic { width: 18px; height: 18px; flex: none; }

/* ---------- barra lateral ---------- */
.sidebar { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; align-self: start; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 18px; padding: 4px 10px 16px; flex: none; }
.brand-logo { width: 28px; height: 28px; border-radius: 8px; background: conic-gradient(from 200deg, #22c55e, #2563eb, #22c55e); box-shadow: inset 0 0 0 7px var(--side); }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 8px; color: var(--side-text); font-weight: 500; }
nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
nav a.active { background: var(--accent); color: #fff; }
/* menú lateral: ocupa el espacio libre y se desplaza; marca y usuario quedan fijos */
.side-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -6px; padding: 0 6px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }
.side-nav a { padding: 8px 12px; }
.side-nav.more-below { -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent); mask-image: linear-gradient(#000 calc(100% - 28px), transparent); }
.side-nav.more-above { -webkit-mask-image: linear-gradient(transparent, #000 28px); mask-image: linear-gradient(transparent, #000 28px); }
.side-nav.more-above.more-below { -webkit-mask-image: linear-gradient(transparent, #000 28px, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.nav-h { display: flex; align-items: center; justify-content: space-between; background: none; border: 0; cursor: pointer; font: inherit;
  color: rgba(203,213,225,.55); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 6px 12px 4px; border-radius: 6px; }
.nav-h:hover { color: #fff; }
.nav-h .ic { width: 14px; height: 14px; transition: transform .15s; }
.nav-group.closed .nav-h .ic { transform: rotate(-90deg); }
.nav-items { display: flex; flex-direction: column; gap: 2px; }
.nav-group.closed .nav-items { display: none; }
.nav-group.closed:has(a.active) .nav-items { display: flex; }
@media (max-height: 720px) and (min-width: 761px) {
  .sidebar { padding-top: 12px; padding-bottom: 10px; }
  .brand { padding-bottom: 10px; }
  .side-nav a { padding: 6px 12px; }
  .nav-group { margin-top: 4px; }
  .live { padding: 6px 12px; }
}
.badge { margin-left: auto; background: var(--down); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; }
.live { flex: none; display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 10px 12px; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--unknown); }
.live.on .dot { background: var(--up); box-shadow: 0 0 0 4px rgba(22,163,74,.2); }

/* ---------- estructura ---------- */
main { padding: 26px 30px; min-width: 0; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.two { grid-template-columns: 1.4fr 1fr; }
.kpi { display: flex; align-items: center; gap: 14px; cursor: pointer; transition: transform .1s; }
.kpi:hover { transform: translateY(-1px); }
.kpi .n { font-size: 28px; font-weight: 700; line-height: 1; }
.kpi .l { color: var(--muted); font-size: 13px; margin-top: 4px; }
.kpi .ring { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 28px; text-align: center; }

/* ---------- botones / formularios ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 8px 13px; border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f8fafc; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--down); }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.sm { padding: 5px 9px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 12px; }
label > span { display: block; margin-bottom: 5px; }
label small { color: var(--muted); font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }

/* ---------- tablas ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f8fafc; }
.name-cell { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.type-ic { width: 32px; height: 32px; border-radius: 8px; background: #f1f5f9; display: grid; place-items: center; color: #334155; flex: none; }

/* ---------- estado ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.up { background: #dcfce7; color: var(--up); }
.pill.warning { background: #fef3c7; color: #b45309; }
.pill.down { background: #fee2e2; color: var(--down); }
.pill.unknown { background: #f1f5f9; color: var(--muted); }
.pill.unreachable { background: #ede9fe; color: #7c3aed; }
.pill.paused { background: #e2e8f0; color: var(--paused); }
.pill.maintenance { background: #cffafe; color: #0e7490; }
.sev { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.sev.critical { background: var(--down); } .sev.warning { background: var(--warning); } .sev.info { background: var(--accent); }
.event { display: flex; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); }
.event:last-child { border-bottom: 0; }
.event .t { color: var(--muted); font-size: 12px; white-space: nowrap; }
.event.acked { opacity: .55; }
.bar { height: 8px; border-radius: 99px; background: #f1f5f9; overflow: hidden; display: flex; }
.bar > span { height: 100%; }

/* ---------- mapa ---------- */
.map-wrap { position: relative; height: calc(100vh - 150px); min-height: 460px; padding: 0; overflow: hidden; }
#network { position: absolute; inset: 0; }
.map-legend { position: absolute; left: 14px; bottom: 14px; background: rgba(255,255,255,.92); border-radius: 8px; padding: 8px 12px; display: flex; gap: 14px; font-size: 12px; box-shadow: var(--shadow); }
.map-legend span { display: flex; align-items: center; gap: 6px; }
.map-hint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow); }
.side-panel { position: absolute; right: 14px; top: 14px; width: 290px; max-height: calc(100% - 28px); overflow: auto; background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(15,23,42,.15); padding: 16px; }
.side-panel .close { position: absolute; right: 10px; top: 8px; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 7px 10px; font-size: 13px; margin: 12px 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.mon { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.mon:last-child { border-bottom: 0; }
.mon .info { margin-left: auto; color: var(--muted); font-size: 12px; text-align: right; }

/* ---------- gráfico ---------- */
.chart { width: 100%; height: 200px; }
.chart .grid-line { stroke: var(--line); }
.chart text { fill: var(--muted); font-size: 11px; }

/* ---------- modal / avisos ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 70; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: 560px; max-width: min(100%, calc(100vw - 32px)); min-width: 0; max-height: calc(100vh - 32px); overflow: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h2 { font-size: 18px; margin-bottom: 16px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: var(--text); color: #fff; padding: 11px 15px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; font-size: 13px; display: flex; gap: 9px; align-items: baseline; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } }
.progress { height: 10px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .3s; }
.help { background: var(--accent-soft); color: #1e3a8a; border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 16px; line-height: 1.5; }

/* ---------- usuarios / acceso ---------- */
.role-viewer .admin-only, .role-operator .admin-only, .role-viewer .op-only { display: none !important; }
.me { border-top: 1px solid rgba(255,255,255,.08); padding: 12px 10px 2px; display: flex; align-items: center; gap: 10px; flex: none; }
.me .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; flex: none; }
.me .who { min-width: 0; flex: 1; }
.me .who b { display: block; color: #fff; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who small { font-size: 12px; }
.me button { background: none; border: 0; color: var(--side-text); cursor: pointer; padding: 6px; border-radius: 6px; }
.me button:hover { background: rgba(255,255,255,.08); color: #fff; }
.auth-screen { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 20% 0%, #1e3a8a 0%, transparent 60%), var(--side); }
.auth-card { background: #fff; border-radius: 16px; width: 400px; max-width: 100%; padding: 30px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.auth-card .brand { color: var(--text); padding: 0 0 18px; }
.auth-card .brand-logo { box-shadow: inset 0 0 0 7px #fff; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card p { color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
.auth-card .btn { width: 100%; justify-content: center; padding: 10px; }
.form-error { background: #fee2e2; color: #991b1b; border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 12px; }
.role-tag { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.role-tag.viewer { background: #f1f5f9; color: var(--muted); }

/* ---------- notificaciones ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { background: none; border: 0; font: inherit; font-weight: 500; color: var(--muted); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.ch-grid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.ch-card.off { opacity: .55; }
.ch-actions { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.ch-ic { width: 38px; height: 38px; border-radius: 10px; color: #fff; display: inline-grid; place-items: center; flex: none; }
.ch-ic.sm { width: 24px; height: 24px; border-radius: 6px; vertical-align: middle; }
.type-grid { grid-template-columns: 1fr 1fr; margin-bottom: 8px; }
.type-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; cursor: pointer; }
.type-tile:hover { border-color: var(--accent); background: #f8fbff; }
.type-tile .muted { font-size: 12px; line-height: 1.4; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip input { display: none; }
.chip span { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; font-weight: 500; background: #fff; }
.chip input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.help code { background: rgba(255,255,255,.6); padding: 1px 5px; border-radius: 4px; }

/* ---------- dependencias ---------- */
.dep-picker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dep-picker select { width: auto; min-width: 200px; }
.dep-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 4px 4px 4px 11px; font-weight: 500; }
.dep-chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 5px; }
.dep-list { max-height: 220px; overflow: auto; font-size: 13px; padding: 6px 0; line-height: 1.7; }
details summary { cursor: pointer; }

/* ---------- SNMP ---------- */
.subbox { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px 10px; margin: -4px 0 14px; }
.subbox .form-row .form-row { gap: 8px; }
.meter { margin-top: 12px; }
.meter-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.util { display: flex; align-items: center; gap: 8px; }
.util .bar { flex: 1; }
.util > span { font-size: 12px; width: 44px; text-align: right; color: var(--muted); }
.star { background: none; border: 0; font-size: 18px; line-height: 1; cursor: pointer; color: #cbd5e1; padding: 2px 4px; }
.star.on { color: #f59e0b; }
.star:disabled { cursor: default; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
table.ifaces td { padding-top: 8px; padding-bottom: 8px; }

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } .two { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; }
  .brand { padding: 4px 8px; }
  nav { flex-direction: row; flex-wrap: wrap; }
  nav a { padding: 7px 9px; font-size: 13px; }
  .live { display: none; }
  .me { border: 0; padding: 4px 8px; margin-left: auto; }
  main { padding: 16px; }
  .form-row, .type-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .side-panel { left: 14px; right: 14px; width: auto; top: auto; bottom: 14px; max-height: 55%; }
}

/* ---------- topología automática ---------- */
.modal.wide { width: 720px; }
.btn .count { background: var(--accent); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; margin-left: 6px; line-height: 18px; }
.topo-h { font-size: 14px; margin: 16px 0 6px; }
.topo-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin: 0 0 6px; cursor: pointer; font-weight: 400; }
.topo-row:hover { background: #f8fafc; }
.topo-row input { width: auto; margin-top: 3px; }
.topo-row.off { opacity: .55; cursor: default; }
.topo-row .ic { vertical-align: -2px; }
.topo-how { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.src { display: inline-block; font-size: 10.5px; font-weight: 600; border-radius: 5px; padding: 0 5px; margin-right: 5px; letter-spacing: .02em; }
.src.lldp { background: #dcfce7; color: #166534; }
.src.cdp { background: #e0f2fe; color: #075985; }
.src.mac { background: #fef3c7; color: #92400e; }

/* ---------- reportes ---------- */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
.day-chart { width: 100%; height: auto; display: block; }
[data-show][hidden], [data-kind][hidden] { display: none; }

/* ---------- sitios ---------- */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.site-card { padding: 0; overflow: hidden; color: inherit; text-decoration: none; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.site-card:hover { box-shadow: 0 8px 24px rgba(15,23,42,.10); transform: translateY(-1px); }
.site-thumb { position: relative; height: 130px; background: #f1f5f9; display: grid; place-items: center; color: #94a3b8; border-bottom: 1px solid var(--line); }
.site-thumb img { width: 100%; height: 100%; object-fit: cover; }
.site-thumb .pill { position: absolute; top: 10px; right: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.site-body { padding: 14px 16px 16px; }
.site-body > b { font-size: 15px; display: block; margin-bottom: 2px; }
.site-body .bar { margin-top: 10px; }
.site-kids { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.site-kid { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; background: #f1f5f9; border-radius: 99px; padding: 3px 10px; cursor: pointer; }
.site-kid:hover { background: var(--accent-soft); color: var(--accent); }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.site-map { background: #eef2f7; }
.site-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #fff; padding: 18px 22px; border-radius: 12px; box-shadow: var(--shadow); text-align: center; font-size: 13.5px; line-height: 1.6; max-width: 420px; }
.pick-list { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); margin: 0; font-weight: 400; cursor: pointer; }
.pick:last-child { border-bottom: 0; }
.pick:hover { background: #f8fafc; }
.pick input { width: auto; }
.pick[hidden] { display: none; }
.plan-preview { width: 100%; max-height: 220px; object-fit: contain; background: #f1f5f9; border-radius: 10px; border: 1px solid var(--line); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 2px dashed var(--line); border-radius: 12px; padding: 26px; text-align: center; color: var(--muted); cursor: pointer; font-weight: 400; }
.drop:hover, .drop.over { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.drop.busy { opacity: .5; pointer-events: none; }

/* ---------- escalamiento ---------- */
.ack-ok { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #166534; background: #dcfce7; border-radius: 99px; padding: 2px 9px; }
.ack-no { display: inline-block; font-size: 12px; color: #9a3412; background: #ffedd5; border-radius: 99px; padding: 2px 9px; }
.prob-banner { display: flex; align-items: center; gap: 10px; background: #ffedd5; color: #9a3412; }
.prob-banner.acked { background: #dcfce7; color: #166534; }
.esc-steps { display: flex; flex-direction: column; gap: 4px; }
.esc-step { font-size: 12.5px; }
.esc-step b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 11px; margin-right: 4px; }
.esc-row { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.esc-n { width: 26px; height: 26px; border-radius: 99px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; flex: none; }
.esc-line { font-size: 13px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---------- auditoría ---------- */
.audit-det { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); }
.audit-cat { font-size: 11.5px; background: #f1f5f9; color: var(--muted); border-radius: 99px; padding: 2px 9px; white-space: nowrap; }
.role-tag.operator { background: #e0f2fe; color: #075985; }

/* ---------- guardias ---------- */
.oc-card { margin-bottom: 16px; }
.oc-lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.oc-now { display: flex; gap: 40px; flex-wrap: wrap; margin: 6px 0 14px; }
.oc-dash { display: flex; gap: 36px; flex-wrap: wrap; }
.person-dot { display: inline-block; width: 10px; height: 10px; border-radius: 99px; margin-right: 6px; vertical-align: 0; }
.tag-ov { font-size: 11px; background: #fef3c7; color: #92400e; border-radius: 99px; padding: 1px 7px; margin-left: 4px; }
.tel { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; margin-left: 6px; }
.cal { position: relative; padding-bottom: 20px; }
.cal-bar { position: relative; height: 34px; border-radius: 8px; background: #f1f5f9; overflow: hidden; }
.cal-seg { position: absolute; top: 0; bottom: 0; color: #fff; font-size: 12px; font-weight: 500; display: flex; align-items: center;
  padding: 0 8px; overflow: hidden; white-space: nowrap; border-right: 2px solid #fff; box-sizing: border-box; }
.cal-seg.ov { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.22) 0 6px, transparent 6px 12px); }
.cal-seg span { overflow: hidden; text-overflow: ellipsis; }
.cal-now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); }
.cal-ticks { position: relative; height: 16px; margin-top: 4px; }
.cal-ticks span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.cal-ticks span:first-child { transform: none; }
.oc-ovs { margin-top: 6px; }
.oc-ov { display: flex; align-items: center; gap: 4px; font-size: 13px; padding: 4px 0; }
.oc-ov .btn { margin-left: auto; }
.mem-list { display: flex; flex-direction: column; gap: 6px; }
.mem { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; font-weight: 400; }
.mem-n { width: 20px; height: 20px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 11px; font-weight: 600; }

/* ---------- traps, discos y temperatura ---------- */
.trap-status { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.trap-status.ok { border-left: 4px solid var(--up); }
.trap-status.bad { border-left: 4px solid var(--down); }
.trap-row { cursor: pointer; }
.trap-vbs { margin-top: 6px; font-size: 12px; background: #f8fafc; border-radius: 8px; padding: 8px 10px; line-height: 1.6; word-break: break-all; }
.trap-vbs code { color: var(--muted); }
.trap-count { font-size: 11px; background: #fef3c7; color: #92400e; border-radius: 99px; padding: 1px 7px; }
pre.code { background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 10px 12px; font-size: 12px; white-space: pre-wrap; margin: 0 0 8px; }
.temps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.temp { display: flex; flex-direction: column; background: #f1f5f9; border-radius: 9px; padding: 6px 12px; font-size: 12px; color: var(--muted); }
.temp b { font-size: 16px; color: var(--text); }
.temp.warm b { color: #d97706; }
.temp.hot { background: #fee2e2; }
.temp.hot b { color: var(--down); }

/* ---------- syslog ---------- */
.sl-sev { font-size: 11.5px; font-weight: 600; border-radius: 99px; padding: 1px 8px; white-space: nowrap; }
.sl-sev.critical { background: #fee2e2; color: var(--down); }
.sl-sev.error { background: #ffedd5; color: #c2410c; }
.sl-sev.warning { background: #fef3c7; color: #b45309; }
.sl-sev.info { background: #f1f5f9; color: var(--muted); }
.sl-msg { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; word-break: break-word; }
table.sl td { padding-top: 6px; padding-bottom: 6px; }
tr.sl-alert { background: #fffbeb; }

/* ---------- app móvil ---------- */
.tabbar { display: none; }
.pwa-state { display: flex; gap: 10px; align-items: flex-start; background: #f1f5f9; border-radius: 10px; padding: 12px 14px; font-size: 13.5px; line-height: 1.5; }
.pwa-state.ok { background: #dcfce7; color: #166534; }
.pwa-state.bad { background: #fee2e2; color: #991b1b; }
.pwa-install { display: flex; gap: 12px; align-items: center; border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
@media (max-width: 760px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 270px; max-width: 82vw; z-index: 60; flex-direction: column; flex-wrap: nowrap;
    align-items: stretch; padding: 16px 12px calc(76px + env(safe-area-inset-bottom)); transform: translateX(-105%); transition: transform .22s ease;
    overflow-y: auto; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .drawer-open .sidebar { transform: none; }
  nav { flex-direction: column; flex-wrap: nowrap; }
  nav a { padding: 10px 12px; font-size: 14px; }
  .me { margin: auto 0 0; border-top: 1px solid rgba(255,255,255,.08); padding: 12px 6px 0; }
  /* la barra inferior también es un <nav>: se anulan los estilos del menú lateral */
  nav.tabbar { display: flex; flex-direction: row; gap: 0; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: var(--side);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.06); }
  nav.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--side-text); font-size: 11px;
    padding: 4px 0; border-radius: 0; background: none; position: relative; text-decoration: none; }
  nav.tabbar a.active { color: #fff; background: none; }
  .tabbar a.active .ic { color: #60a5fa; }
  .tabbar .badge { position: absolute; top: 0; left: 52%; margin: 0; font-size: 10px; padding: 0 5px; }
  /* nada puede ensanchar la página: lo que no cabe se desplaza dentro de su tarjeta */
  main { padding: 14px 12px 20px; min-width: 0; }
  .card { overflow-x: auto; }
  .map-wrap { overflow: hidden; }
  .card table .type-ic { display: none; }
  .card table th, .card table td { padding-left: 6px; padding-right: 6px; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tabs .tab { white-space: nowrap; }
  .head { flex-wrap: wrap; gap: 10px; }
  .head h1 { font-size: 21px; }
  .head .actions { width: 100%; flex-wrap: wrap; }
  .head .actions .btn { flex: 1 1 auto; justify-content: center; }
  .modal-bg { align-items: end; padding: 0; }
  .modal { width: 100%; max-width: 100vw; border-radius: 16px 16px 0 0; max-height: 88vh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .card { padding: 14px; }
  table { font-size: 13px; }
  .btn.sm { padding: 7px 10px; }
  #toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* ---------- inicio de sesión y doble factor ---------- */
.sso-btn { display: flex; gap: 8px; justify-content: center; align-items: center; background: #fff; border: 1px solid var(--line); color: var(--text); font-weight: 600; text-decoration: none; }
.sso-btn:hover { background: #f8fafc; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
input.otp { font-size: 22px; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.qr { display: grid; place-items: center; margin: 4px 0 10px; }
.qr svg { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 10px; }
.totp-steps { padding-left: 20px; font-size: 13.5px; line-height: 1.55; margin: 0 0 8px; color: var(--text); }
code.secret { display: block; margin-top: 6px; font-size: 14px; letter-spacing: .08em; background: #f1f5f9; padding: 8px 10px; border-radius: 8px; word-break: break-all; color: var(--text); }
.recovery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
.recovery code { background: #f1f5f9; border-radius: 8px; padding: 8px; text-align: center; font-size: 15px; letter-spacing: .06em; }
.acct-sec { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.auth-card { max-height: calc(100vh - 32px); overflow-y: auto; }

.mfa-tag { display: inline-flex; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: #166534; background: #dcfce7; border-radius: 99px; padding: 1px 6px; vertical-align: 1px; }
.test-out { font-size: 13px; margin-top: 8px; line-height: 1.6; }
.test-out .ok { color: #166534; }
.test-out .bad { color: var(--down); }

/* agente de Windows */
.agent-empty { display: flex; align-items: center; gap: 14px; }
.agent-empty .type-ic { width: 42px; height: 42px; flex: none; }
ol.steps { margin: 0 0 10px; padding-left: 20px; line-height: 1.7; }
.help.ok { background: #dcfce7; color: #166534; }
b.bad { color: var(--down); }
.ctr { gap: 8px; }
@media (max-width: 700px) { .agent-empty { flex-wrap: wrap; } .ctr { flex-wrap: wrap; } }
#agent .pill { white-space: nowrap; }

/* ---------- tableros personalizables ---------- */
.sec-title { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 6px 0 10px; }
.board-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-bottom: 22px; }
.board-card { color: var(--text); display: block; transition: transform .1s; }
.board-card:hover { transform: translateY(-2px); }
.board-mini { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 14px; gap: 4px; height: 70px; overflow: hidden; margin-bottom: 10px; }
.board-mini span { background: #e0e7ff; border-radius: 3px; }
.board-mini em { grid-column: 1/-1; color: var(--muted); font-size: 12px; }
.board-name { font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 180px; grid-auto-flow: dense; gap: 16px; }
.wg { display: flex; flex-direction: column; min-height: 0; padding: 14px 16px; overflow: hidden; position: relative; }
.wg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-height: 22px; }
.wg-title { font-weight: 600; font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-tools { display: flex; gap: 4px; align-items: center; }
.wg-drag { cursor: grab; color: var(--muted); display: inline-flex; padding: 4px; }
.wg-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.wg-sub { font-size: 12px; }
.wg-err { color: #b45309; background: #fffbeb; border-radius: 8px; padding: 10px; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.wg-ok { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--up); font-weight: 500; }
.wg-t { width: 100%; }
.wg-t td { padding: 6px 4px; font-size: 13px; }
.wg-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.wg-kpi { border-left: 4px solid var(--c); padding: 2px 0 2px 10px; }
.wg-kpi b { display: block; font-size: 28px; line-height: 1.1; }
.wg-kpi span { color: var(--muted); font-size: 12px; }
.wg-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; align-content: start; }
.wg-tile { background: var(--c); color: #fff; border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; min-width: 0; }
.wg-tile b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-tile span { font-size: 11.5px; opacity: .9; }
.wg-now { font-size: 13px; margin-bottom: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wg-chart { flex: 1; min-height: 90px; display: flex; flex-direction: column; }
.wg-chart { overflow: hidden; }
.wg-chart .empty { padding: 10px; }
.wg-gauge { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.wg-gauge svg { width: 100%; max-width: 170px; flex: 1 1 0; min-height: 0; }
.wg-gauge .wg-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wg-gv { font-size: 30px; font-weight: 700; margin-top: -4px; line-height: 1.1; flex: none; }
.wg-avail { display: flex; gap: 16px; align-items: flex-end; margin-bottom: 8px; }
.wg-big { font-size: 34px; font-weight: 700; line-height: 1.1; }
.wg-days { flex: 1; display: flex; align-items: flex-end; gap: 2px; height: 48px; }
.wg-days span { flex: 1; border-radius: 2px 2px 0 0; min-width: 2px; }
.wg-oc { margin-bottom: 10px; }
.wg-note { white-space: normal; line-height: 1.5; font-size: 14px; }
.wg-size { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 4px; align-items: center; padding: 6px 10px; background: rgba(248,250,252,.96);
  border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.wg-size span { margin: 0 2px 0 6px; }
.wg-size button { border: 1px solid var(--line); background: #fff; border-radius: 5px; min-width: 24px; padding: 2px 0; cursor: pointer; font: inherit; }
.wg-size button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.wgrid.editing .wg { outline: 2px dashed #c7d2fe; outline-offset: -2px; }
.wgrid.editing .wg-body { pointer-events: none; opacity: .85; padding-bottom: 30px; }
.wg.dragging { opacity: .4; }
.wg.drop { outline: 2px solid var(--accent) !important; }
.wg-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 60vh; overflow: auto; }
.wg-opt { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 3px; }
.wg-opt:hover { border-color: var(--accent); background: #eff6ff; }
.wg-opt span { color: var(--muted); font-size: 12.5px; }
.dev-checks { max-height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.dev-checks label.check { margin: 2px 0; }
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-list .btn { justify-content: flex-start; }
/* pantalla completa y enlace de TV */
body.tv { grid-template-columns: 1fr; }
body.tv .sidebar, body.tv nav.tabbar { display: none !important; }
body.tv main { padding: 18px 22px; }
body.tv .head .actions { display: none; }
body.tv .wgrid { grid-auto-rows: minmax(180px, calc((100vh - 120px) / 4)); }
body.tv-link a { pointer-events: none; color: inherit; }
.tv-head { margin-bottom: 14px; }
.tv-clock { margin-left: auto; font-size: 18px; color: var(--muted); }
.tv-clock::first-letter { text-transform: uppercase; }
.dot-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--up); margin-right: 4px; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (max-width: 1100px) { .wgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wgrid .wg.w3, .wgrid .wg.w4 { grid-column: span 2 !important; } }
@media (max-width: 760px) {
  .wgrid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  .wgrid .wg, .wgrid .wg.w3, .wgrid .wg.w4 { grid-column: auto !important; grid-row: auto !important; min-height: 190px; }
  .wgt-gauge, .wgt-note, .wgt-oncall { height: 190px; }
  .wg-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- respaldos ---------- */
.bk-auto { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.bk-auto label.check { margin: 0; }
.bk-auto select, .bk-auto input[type=number] { width: auto; margin: 0; }
.bk-counts { width: 100%; margin: 6px 0 14px; }
.bk-counts td { padding: 4px 6px; font-size: 13px; }
.bk-targets { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.bk-target { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.bk-tmain { flex: 1; min-width: 0; font-size: 13px; line-height: 1.6; }
.bk-tmain code { word-break: break-all; }
.bk-tname { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.bk-tname .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-tmeta { margin-top: 2px; }
.bk-tbtns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.bk-enc { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px 12px; margin: 4px 0 12px; }
.bk-enc legend { font-size: 13px; font-weight: 600; padding: 0 6px; display: inline-flex; align-items: center; gap: 6px; }
.bk-files { max-height: 50vh; overflow: auto; }
@media (max-width: 700px) { .bk-target { flex-direction: column; } .bk-tbtns { justify-content: flex-start; } }
/* selector de dos o más opciones (p. ej. Windows / Linux) */
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 3px; margin-bottom: 12px; background: #f8fafc; }
.seg button { border: 0; background: none; padding: 6px 16px; border-radius: 6px; font: inherit; font-weight: 500; cursor: pointer; color: var(--muted); }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(15,23,42,.12); }

/* reportes a medida */
.rep-tabs { margin-bottom: 14px; }
.seg a { padding: 6px 16px; border-radius: 6px; font-weight: 500; color: var(--muted); text-decoration: none; }
.seg a.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.cr-list { display: flex; flex-direction: column; gap: 10px; }
.cr-item { display: flex; align-items: center; gap: 14px; cursor: pointer; padding: 14px 16px; }
.cr-item:hover { border-color: var(--accent); }
.cr-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.cr-btns { display: flex; gap: 6px; }
.tag { font-size: 11px; background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 1px 8px; margin-left: 4px; font-weight: 600; }
.cr-templates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 12px; }
.cr-tpl { text-align: left; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 12px 14px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 4px; }
.cr-tpl:hover { border-color: var(--accent); background: #f8fbff; }
.cr-tpl span { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
#crbody > *, .cr-preview #prev > * { margin-bottom: 16px; }
.cr-kpis { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.cr-kpis .kpi { cursor: default; }
.cr-kpis .kpi .n { font-size: 24px; }
.cr-h { margin: 0 0 10px; }
.table-wrap { overflow-x: auto; }
td.num, th.num { text-align: right; white-space: nowrap; }
.cr-rank { display: flex; flex-direction: column; gap: 6px; }
.cr-rank-row { display: grid; grid-template-columns: minmax(90px, 220px) 1fr 90px; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-size: 13px; }
.cr-rank-row b { text-align: right; }
.cr-rank-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-bar { height: 10px; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.cr-bar span { display: block; height: 100%; border-radius: 99px; }
.cr-text { line-height: 1.6; }
.cr-edit { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 16px; align-items: start; }
.cr-side { display: flex; flex-direction: column; gap: 16px; }
.cr-preview { min-width: 0; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; padding: 12px; border: 1px dashed var(--line); border-radius: 14px; background: #f8fafc; }
.cr-prev-h { font-size: 12.5px; margin-bottom: 10px; }
.cr-devs { max-height: 220px; overflow: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.cr-devs label.check { margin: 0; font-size: 13px; }
.cr-sec { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 10px; background: #fff; }
.cr-sec-h { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.cr-sec input[data-title] { margin-bottom: 8px; }
.cr-sec .chips { margin-bottom: 8px; }
.cr-sec .chip span { padding: 4px 10px; font-size: 12.5px; }
.cr-sec textarea { width: 100%; }
@media (max-width: 980px) { .cr-edit { grid-template-columns: 1fr; } .cr-preview { position: static; max-height: none; } }
@media (max-width: 600px) { .cr-templates { grid-template-columns: 1fr; } .cr-rank-row { grid-template-columns: minmax(80px, 1fr) 1fr 70px; } .cr-item { flex-wrap: wrap; } }
.tv-dots { display: inline-flex; gap: 5px; margin-left: 10px; vertical-align: middle; }
.tv-dots i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .3; }
.tv-dots i.on { opacity: 1; }
.cr-sec .chips label, .cr-sec .chip { margin: 0; }
.cr-preview .cr-kpis { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.cr-preview .cr-kpis .card { padding: 12px; }
.cr-preview .cr-kpis .kpi .n { font-size: 20px; }
@media (max-width: 600px) { .cr-kpis { grid-template-columns: 1fr 1fr !important; gap: 10px; } .cr-kpis .card { padding: 12px; } .cr-kpis .kpi .n { font-size: 19px; } }
.ssh-key { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; background: #f8fafc; font-size: 13px; }
.ssh-key pre.code { white-space: pre-wrap; word-break: break-all; font-size: 11.5px; margin: 0 0 6px; }
.help.warn-box { background: #fef3c7; color: #78350f; }
.help.warn-box pre.code { white-space: pre-wrap; word-break: break-all; font-size: 12px; margin: 8px 0; }
.ag-rollout { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-size: 13.5px; }
.ag-rollout.held { border-left-color: var(--down); background: #fef2f2; }
.ag-rollout.paused { border-left-color: var(--paused); }
.ag-rollout.general { border-left-color: var(--up); }
.ag-ro-btns { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.cr-util { display: inline-block; width: 36px; height: 7px; background: #f1f5f9; border-radius: 99px; overflow: hidden; vertical-align: middle; margin-right: 4px; }
.cr-util span { display: block; height: 100%; border-radius: 99px; }
.tv-report { display: grid; grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); gap: 16px; align-items: start; }
.tv-report > * { margin: 0 !important; }
.tv-report .tv-rep-sub, .tv-report .cr-kpis, .tv-report .cr-h { grid-column: 1 / -1; }
.tv-report .table-wrap { max-height: 46vh; overflow: hidden; }
@media (max-width: 1100px) { .tv-report { grid-template-columns: 1fr; } }
.cr-tight th, .cr-tight td { padding-left: 6px; padding-right: 6px; font-size: 13px; }
.cr-tight th { white-space: normal; }
.disk-fc { font-size: 12px; font-weight: 500; }

/* ---------------------------------------------------------------- NOC (siempre oscuro, pensado para una pared) */
.noc {
  --noc-bg: #0b1220; --noc-panel: #111a2c; --noc-line: #1f2b44; --noc-text: #e6ecf7; --noc-muted: #8b98b3;
  --noc-ok: #22c55e; --noc-warn: #f5b301; --noc-crit: #ef4444;
  background: var(--noc-bg); color: var(--noc-text); border-radius: 14px; padding: 18px 20px; min-height: calc(100vh - 60px);
  display: flex; flex-direction: column; gap: 14px; overflow: auto;
}
.noc:fullscreen, .noc-kiosk { border-radius: 0; min-height: 100vh; padding: 22px 28px; }
body.tv main:has(.noc-kiosk) { padding: 0; }
.noc a { color: inherit; text-decoration: none; } .noc a:hover { text-decoration: underline; }
.noc .ok { color: var(--noc-ok); } .noc .warn { color: var(--noc-warn); } .noc .crit { color: var(--noc-crit); }
.noc-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.noc-title { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 260px; }
.noc-title h1 { margin: 0; font-size: 22px; font-weight: 700; }
.noc-sub { color: var(--noc-muted); font-size: 13px; margin-top: 2px; }
.noc-dot { width: 16px; height: 16px; border-radius: 50%; flex: none; background: var(--noc-ok); box-shadow: 0 0 0 5px rgba(34,197,94,.18); }
.noc-dot.warn { background: var(--noc-warn); box-shadow: 0 0 0 5px rgba(245,179,1,.18); }
.noc-dot.crit { background: var(--noc-crit); box-shadow: 0 0 0 5px rgba(239,68,68,.22); animation: noc-pulse 1.4s infinite; }
@keyframes noc-pulse { 50% { box-shadow: 0 0 0 10px rgba(239,68,68,0); } }
.noc-clock { color: var(--noc-muted); font-variant-numeric: tabular-nums; font-size: 14px; text-transform: capitalize; }
.noc-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.noc-btn { background: var(--noc-panel); color: var(--noc-text); border: 1px solid var(--noc-line); border-radius: 8px; padding: 7px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.noc-btn:hover { border-color: var(--noc-muted); }
.noc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 1280px) { .noc-kpis { grid-template-columns: repeat(8, minmax(0, 1fr)); } .noc-kpi-v { font-size: 26px; } }
.noc-kpi { background: var(--noc-panel); border: 1px solid var(--noc-line); border-radius: 12px; padding: 12px 14px; border-top: 3px solid var(--noc-line); }
.noc-kpi.ok { border-top-color: var(--noc-ok); } .noc-kpi.warn { border-top-color: var(--noc-warn); } .noc-kpi.crit { border-top-color: var(--noc-crit); }
.noc-kpi.ok .noc-kpi-v, .noc-kpi.warn .noc-kpi-v, .noc-kpi.crit .noc-kpi-v { color: inherit; }
.noc-kpi-l { color: var(--noc-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.noc-kpi-v { font-size: 30px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--noc-text) !important; }
.noc-kpi.crit .noc-kpi-v { color: var(--noc-crit) !important; } .noc-kpi.warn .noc-kpi-v { color: var(--noc-warn) !important; }
.noc-kpi-v small { font-size: 16px; color: var(--noc-muted); font-weight: 500; }
.noc-kpi-s { color: var(--noc-muted); font-size: 12px; margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.noc-spark { width: 60px; height: 16px; color: var(--noc-ok); }
.noc-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 14px; flex: 1; }
.noc-side { display: flex; flex-direction: column; gap: 14px; }
.noc-panel { background: var(--noc-panel); border: 1px solid var(--noc-line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.noc-panel h2 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--noc-muted); font-weight: 600; display: flex; gap: 8px; }
.noc-panel h2 span { background: var(--noc-line); color: var(--noc-text); border-radius: 10px; padding: 0 8px; }
.noc-panel table { width: 100%; border-collapse: collapse; font-size: 14px; }
.noc-panel th { text-align: left; color: var(--noc-muted); font-weight: 500; font-size: 12px; padding: 4px 8px; border-bottom: 1px solid var(--noc-line); }
.noc-panel td { padding: 8px; border-bottom: 1px solid var(--noc-line); vertical-align: top; }
.noc-panel tr.down td:first-child, .noc-panel tr.unreachable td:first-child { box-shadow: inset 3px 0 var(--noc-crit); }
.noc-panel tr.warning td:first-child { box-shadow: inset 3px 0 var(--noc-warn); }
.noc-ip { color: var(--noc-muted); font-size: 12px; }
.noc-st { font-weight: 600; } .noc-st.down, .noc-st.unreachable { color: var(--noc-crit); } .noc-st.warning { color: var(--noc-warn); }
.noc-since { font-variant-numeric: tabular-nums; white-space: nowrap; }
.noc-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 46px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.noc-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.noc-row i { color: var(--noc-muted); font-style: normal; }
.noc-row b { text-align: right; font-variant-numeric: tabular-nums; }
.noc-bar { height: 7px; background: var(--noc-line); border-radius: 4px; overflow: hidden; }
.noc-bar span { display: block; height: 100%; border-radius: 4px; }
.noc-note { font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--noc-line); } .noc-note:last-child { border: 0; }
.noc-note.crit b { color: var(--noc-crit); }
.noc-empty { color: var(--noc-muted); text-align: center; padding: 22px 10px; }
.noc-problems .noc-empty { color: var(--noc-ok); font-size: 18px; padding: 50px 10px; }
.noc-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.noc-site { background: var(--noc-panel); border: 1px solid var(--noc-line); border-left: 4px solid var(--noc-ok); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; font-size: 13px; }
.noc-site span { color: var(--noc-muted); font-size: 12px; }
.noc-site.warn { border-left-color: var(--noc-warn); } .noc-site.crit { border-left-color: var(--noc-crit); } .noc-site.crit span { color: var(--noc-crit); }
.noc-ticker { display: flex; gap: 22px; overflow: hidden; white-space: nowrap; font-size: 13px; color: var(--noc-muted); border-top: 1px solid var(--noc-line); padding-top: 10px; }
.noc-ticker i { font-style: normal; color: var(--noc-text); opacity: .7; margin-right: 4px; }
.noc-ticker .critical { color: #fca5a5; } .noc-ticker .warning { color: #fde68a; }
.noc.noc-alarm { animation: noc-flash 1s 3; }
@keyframes noc-flash { 50% { box-shadow: inset 0 0 0 4px var(--noc-crit); } }
@media (max-width: 900px) {
  .noc { padding: 12px; border-radius: 10px; }
  .noc-grid { grid-template-columns: 1fr; }
  .noc-hide { display: none; }
  .noc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .noc-kpi-v { font-size: 24px; }
  .noc-clock { display: none; }
}
@media (min-width: 1800px) { .noc-kpi-v { font-size: 40px; } .noc-panel table, .noc-row { font-size: 16px; } .noc-title h1 { font-size: 28px; } }

/* ---------- licencia ---------- */
#lic-bar { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 13.5px; }
#lic-bar[hidden] { display: none; }
#lic-bar.info { background: var(--accent-soft); color: #1e3a8a; }
#lic-bar.warn { background: #fef3c7; color: #92400e; }
#lic-bar.bad { background: #fee2e2; color: #991b1b; }
#lic-bar a { color: inherit; font-weight: 600; text-decoration: underline; }
body.tv #lic-bar { display: none; }
.lic-state { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.lic-state .ring { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.lic-state b { font-size: 18px; }
.lic-meter { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0 4px; }
.lic-meter span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.lic-meter span.over { background: var(--down); }
.lic-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .5px; text-transform: uppercase; }
dl.lic-kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; margin: 0; }
dl.lic-kv dt { color: var(--muted); }
dl.lic-kv dd { margin: 0; }
@media (max-width: 760px) { dl.lic-kv { grid-template-columns: 1fr; gap: 0; } dl.lic-kv dd { margin-bottom: 8px; } }
#lic-bar > span:first-child { flex: none; padding-top: 1px; }
.auth-owner { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }
