:root {
  --bg: #0f141a; --panel: #182029; --line: #26313d; --txt: #e6edf3; --muted: #8b98a5;
  --primary: #2f81f7; --danger: #d1332e; --ok: #2ea043; --off: #6e7681;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--txt); }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); }
h1 { font-size: 18px; margin: 0; } h1 small { color: var(--muted); font-weight: 400; }
h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 10px; }
main { max-width: 900px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
@media (min-width: 760px) { main { grid-template-columns: 1fr 1fr; align-items: start; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row.wrap { flex-wrap: wrap; justify-content: flex-start; margin-top: 10px; }
.eps { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow: auto; }
.ep { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.ep.sel { border-color: var(--primary); background: #14202f; }
.ep .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--off); flex: 0 0 auto; }
.ep.online .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.ep .name { font-weight: 600; } .ep .sub { color: var(--muted); font-size: 12px; }
.ep .meta { margin-left: auto; text-align: right; }
textarea { width: 100%; background: #0d1117; color: var(--txt); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; resize: vertical; }
button { border: 0; border-radius: 8px; padding: 9px 14px; font-weight: 600; cursor: pointer; color: #fff; }
button.primary { background: var(--primary); } button.danger { background: var(--danger); }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--txt); padding: 6px 10px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.muted { color: var(--muted); }
.pill { font-size: 12px; padding: 3px 9px; border-radius: 999px; }
.pill.on { background: #0d2a17; color: #4ac26b; } .pill.off { background: #2a1414; color: #e5837f; }
.results { margin-top: 12px; display: grid; gap: 8px; }
.res { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.res .head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.res pre { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; font-size: 12px; color: #cdd9e5; max-height: 260px; overflow: auto; }
.res.ok { border-left: 3px solid var(--ok); } .res.error, .res.timeout { border-left: 3px solid var(--danger); }
.res.skipped { border-left: 3px solid var(--off); }

/* Checkbox "instalar como usuario conectado" */
.chk { display: inline-flex; align-items: center; gap: .5rem; margin-top: .5rem; font-size: .9rem; color: var(--muted, #64748b); cursor: pointer; min-height: 32px; }
.chk input { width: 18px; height: 18px; }

/* Caja de URL para instalar desde enlace */
#dlUrl { width: 100%; box-sizing: border-box; margin-bottom: .5rem; }

/* Plantillas de instalación */
#tplSelect { max-width: 260px; }
#tplForm { margin-top: .5rem; padding: .6rem; border: 1px dashed var(--border, #cbd5e1); border-radius: 8px; }
#tplForm input, #tplForm textarea, #tplForm select { width: 100%; box-sizing: border-box; margin-bottom: .4rem; }
#tplForm .chk { width: auto; }

/* Badge de estatus de instalación por equipo */
.ep .inst { margin-top: .35rem; font-size: .82rem; font-weight: 600; padding: .15rem .45rem; border-radius: 6px; display: inline-block; }
.ep .inst.running { color: #92600a; background: #fef3c7; }
.ep .inst.ok { color: #065f46; background: #d1fae5; }
.ep .inst.error { color: #991b1b; background: #fee2e2; }
.res details { margin-top: .4rem; } .res details summary { cursor: pointer; color: #64748b; font-size: .85rem; }

/* Botones editar/borrar por equipo */
.epact { display: inline-flex; gap: .25rem; margin-left: .4rem; }
.epact .mini { min-height: 32px; min-width: 32px; padding: .2rem .4rem; border-radius: 6px; border: 1px solid var(--border, #cbd5e1); background: transparent; cursor: pointer; font-size: .85rem; line-height: 1; }
.epact .mini:hover { background: rgba(148,163,184,.18); }
