/* Panel del servidor — negro con naranja Vulpra, tipografía Red Hat. */

@font-face {
  font-family: "Red Hat Text";
  src: url("fonts/red-hat-text.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Red Hat Mono";
  src: url("fonts/red-hat-mono.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* superficies: negro y grises neutros */
  --bg: #000000;
  --panel: #111111;
  --panel-2: #1a1a1a;
  --panel-3: #232323;
  --term: #000000;
  --line: #262626;
  --line-2: #383838;
  /* tinta (la más tenue da 4,8:1 hasta sobre --panel-3) */
  --ink: #f2f2f2;
  --ink-2: #b4b4b4;
  --ink-3: #8f8f8f;
  /* marca: naranja Vulpra. Botones naranjas con texto negro (5,6:1); para texto
     naranja sobre negro, --brand-ink (5,7:1 o más en todas las superficies). */
  --brand: #df5a0f;
  --brand-hover: #f06a1c;
  --brand-ink: #f27a32;
  --on-brand: #000000;
  /* datos: naranja + azul, validados para daltonismo sobre --panel */
  --d1: #ef6a1f;
  --d2: #338ced;
  /* estados (siempre con ícono y texto) */
  --ok: #0aac23;
  --warn: #fbb315;
  --bad: #dc3c3d;

  --font: "Red Hat Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Red Hat Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-s: 6px;
  --r-m: 8px;
  --r-l: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.45 var(--font);
  font-feature-settings: "kern";
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--brand-ink); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; border-radius: 4px; }
::selection { background: #7a330b; color: #fff; }
.mono, code, kbd { font-family: var(--mono); font-size: 0.92em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.spacer { flex: 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 40px; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-m);
  background: var(--panel-2); color: var(--ink);
  font-size: 13.5px; font-weight: 600; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .12s, border-color .12s;
}
.btn:hover { background: var(--panel-3); border-color: #4a4a4a; color: var(--ink); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand); }
.btn-primary .st-ico circle[fill="none"] { stroke: rgba(0, 0, 0, .3); }
.btn-primary .st-ico path.spin { stroke: var(--on-brand); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--panel-2); border-color: transparent; color: var(--ink); }
.btn-danger { background: transparent; border-color: #7a3537; color: #f3b6b6; }
.btn-danger:hover { background: #3a1d20; border-color: var(--bad); color: #fff; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-wide { width: 100%; height: 38px; }
.btn-icon { width: 32px; padding: 0; }
.btn .spin { width: 14px; height: 14px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(380px, 100%);
  display: grid; gap: 14px;
  padding: 32px 28px 28px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l);
}
.login-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--panel-3) url("favicon.svg") center/28px no-repeat; }
.login-title { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.login-sub { color: var(--ink-2); margin-top: -6px; }
.login-hint { color: var(--ink-2); font-size: 13px; text-align: center; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field input {
  height: 38px; padding: 0 12px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-m);
  color: var(--ink); font-size: 15px;
}
.field input:focus { outline: 2px solid var(--brand-ink); outline-offset: 0; border-color: transparent; }
.form-error { color: #f6c3c3; font-size: 13.5px; display: flex; gap: 8px; align-items: flex-start; }

/* ---------- estructura ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 22px;
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line);
}
.side-head { padding: 0 8px; }
.host { display: flex; align-items: center; gap: 10px; }
.host-glyph { width: 26px; height: 26px; flex: none; border-radius: 7px; background: var(--panel-2) url("favicon.svg") center/22px no-repeat; }
.host-name { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host-meta { margin-top: 8px; color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 36px; padding: 0 10px;
  border-radius: var(--r-m);
  color: var(--ink-2); text-decoration: none; font-weight: 550;
  position: relative;
}
.nav a:hover { background: var(--panel); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--panel-2); color: var(--ink); }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.nav-badge:empty { display: none; }
.nav-soft { color: var(--ink-3); font-weight: 500; }
.side-foot { margin-top: auto; padding: 0 8px; display: grid; gap: 10px; }
.demo-flag { font-size: 12.5px; color: var(--ink-2); padding: 8px 10px; border: 1px dashed var(--line-2); border-radius: var(--r-m); }
.who { display: flex; align-items: center; justify-content: space-between; color: var(--ink-2); font-size: 13px; }

.main { padding: 30px 40px 72px; min-width: 0; outline: none; }
#view { max-width: 1240px; }
.offline {
  max-width: 1240px; margin-bottom: 18px; padding: 10px 14px;
  border: 1px solid #6b4a12; border-radius: var(--r-m); background: #2a2310; color: #ffe0a3;
}

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.view-title { font-size: 26px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; }
.view-sub { color: var(--ink-2); margin-top: 6px; max-width: 72ch; }
.view-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.block { background: var(--panel); border-radius: var(--r-l); padding: 20px 22px; }
#view > * + * { margin-top: 18px; }
#view > .hero + * { margin-top: 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.block-title { font-size: 15px; font-weight: 650; }
.block-note { color: var(--ink-3); font-size: 12.5px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cols-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.stack { display: grid; gap: 18px; }
.empty { color: var(--ink-2); padding: 6px 0; }
.empty b { color: var(--ink); font-weight: 600; }

/* ---------- estado (ícono + texto) ---------- */
.st { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.st-ico { width: 15px; height: 15px; flex: none; }
.st-label { font-weight: 550; }
.spin { animation: spin 1s linear infinite; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- héroe ---------- */
.hero { margin: 4px 0 26px; }
#view > .hero { margin-bottom: 26px; }
.hero-title {
  display: flex; align-items: center; gap: 16px;
  font-size: clamp(30px, 4.2vw, 46px); font-weight: 520; line-height: 1.08; letter-spacing: -0.02em;
}
.hero-glyph { position: relative; width: .52em; height: .52em; flex: none; border-radius: 50%; background: var(--ok); }
.hero-glyph[data-level="warn"] { background: var(--warn); border-radius: 3px; transform: rotate(45deg) scale(.86); }
.hero-glyph[data-level="bad"] { background: var(--bad); }
.hero-glyph[data-level="bad"]::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%;
  border: 2px solid var(--bad); opacity: 0; animation: beacon 2.4s ease-out infinite;
}
@keyframes beacon { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
.hero-text { margin-top: 14px; font-size: 16.5px; line-height: 1.55; color: var(--ink-2); max-width: 74ch; }
.hero-text b { color: var(--ink); font-weight: 600; }
.hero-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- recursos (KPI) ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; }
.kpi { padding: 18px 22px 20px; min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi-label { color: var(--ink-2); font-size: 13px; font-weight: 550; display: flex; justify-content: space-between; gap: 8px; }
.kpi-label .mono { color: var(--ink-3); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-value { margin-top: 6px; font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; display: flex; align-items: center; gap: 8px; }
.kpi-value small { font-size: 15px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.kpi-sub { margin-top: 10px; color: var(--ink-3); font-size: 12.5px; }
.kpi-net { display: grid; gap: 2px; }
.kpi-net .kpi-value { margin-top: 2px; font-size: 22px; }
.netkey { display: inline-block; width: 12px; height: 2px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

.meter { margin-top: 10px; height: 6px; border-radius: 999px; background: rgba(239, 106, 31, .18); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--d1); transition: width .4s ease; }
.meter[data-level="warn"] { background: rgba(251, 179, 21, .16); }
.meter[data-level="warn"] > i { background: var(--warn); }
.meter[data-level="bad"] { background: rgba(220, 60, 61, .18); }
.meter[data-level="bad"] > i { background: var(--bad); }

.meters { display: grid; gap: 14px; }
.meter-row { display: grid; grid-template-columns: minmax(110px, 180px) minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.meter-row .meter { margin-top: 0; }
.meter-row .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter-fig { text-align: right; min-width: 15ch; color: var(--ink-2); font-size: 13px; }
.meter-fig b { color: var(--ink); font-weight: 600; }

/* ---------- gráficos ---------- */
.charts-block { padding: 18px 22px 16px; }
.charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0 -22px; }
.chart { margin: 0; padding: 4px 22px 0; min-width: 0; }
.chart + .chart { border-left: 1px solid var(--line); }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.chart-title { font-size: 13.5px; font-weight: 600; }
.chart-legend { display: flex; gap: 12px; color: var(--ink-2); font-size: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 12px; height: 2px; border-radius: 2px; display: inline-block; }
.chart-plot { position: relative; outline: none; }
.chart-plot:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 4px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart .base { stroke: var(--line-2); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--ink-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .endlabel { fill: var(--ink); font-size: 12px; font-weight: 600; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { stroke: none; opacity: .10; }
.chart .dot { stroke: var(--panel); stroke-width: 2; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; shape-rendering: crispEdges; }
.chart-empty { fill: var(--ink-3); font-size: 12.5px; }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--bg); border-radius: var(--r-m); border: 1px solid var(--line); }
.seg button {
  height: 26px; padding: 0 10px; border: 0; border-radius: var(--r-s);
  background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--panel-3); color: var(--ink); }
.seg button:hover { color: var(--ink); }
.datatable { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.datatable summary { cursor: pointer; color: var(--ink-2); font-size: 13px; width: max-content; }
.datatable summary:hover { color: var(--ink); }
.datatable .scroll { max-height: 320px; overflow: auto; margin-top: 10px; }

.tip {
  position: fixed; z-index: 50; pointer-events: none;
  min-width: 140px; max-width: 280px; padding: 9px 11px;
  background: var(--panel-3); border: 1px solid var(--line-2); border-radius: var(--r-m);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  font-size: 12.5px;
}
.tip-time { color: var(--ink-2); margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-row i { width: 12px; height: 2px; border-radius: 2px; flex: none; }
.tip-row b { font-weight: 650; font-variant-numeric: tabular-nums; }
.tip-row span { color: var(--ink-2); }

/* ---------- tablas ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-weight: 550; font-size: 12.5px; color: var(--ink-3);
  padding: 0 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .nw { white-space: nowrap; }
.table.fixed { table-layout: fixed; }
.table .c-task { width: 24%; }
.table .c-when { width: 21%; }
.table .c-next { width: 14%; }
.table .c-last { width: 16%; }
.table .c-act { width: 25%; }
.table .act { overflow-wrap: normal; }
.table .act { text-align: right; white-space: nowrap; }
.table .act .btn + .btn { margin-left: 6px; }
.cell-main { font-weight: 600; }
.cell-sub { margin-top: 3px; color: var(--ink-3); font-size: 12.5px; overflow-wrap: anywhere; }
.cell-sub .mono { color: var(--ink-2); }
.cell-sub.target { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.cell-sub.target .mono { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag {
  display: inline-block; padding: 1px 7px; margin-left: 6px;
  border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--ink-2); font-size: 11.5px; font-weight: 550; vertical-align: 1px;
}
.compact td { padding-top: 9px; padding-bottom: 9px; }
.proc-cmd { max-width: 52ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font-size: 12px; margin-top: 2px; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent;
  color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip:hover { color: var(--ink); border-color: #4a4a4a; }
.chip[aria-pressed="true"] { background: var(--panel-3); color: var(--ink); border-color: var(--panel-3); }
.chip .count { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .count { color: var(--ink-2); }

/* ---------- listas compactas (resumen) ---------- */
.rows { display: grid; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 2px; }
.row-main { min-width: 0; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.row-sub { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.row-side { text-align: right; color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.row-side b { color: var(--ink); font-weight: 600; }

/* ---------- grupos ---------- */
.groups { display: grid; gap: 18px; }
.table.svc .s-st { width: 11%; }
.table.svc .s-name { width: 25%; }
.table.svc .s-detail { width: 21%; }
.table.svc .s-since { width: 10%; }
.table.svc .s-cpu { width: 8%; }
.table.svc .s-mem { width: 8%; }
.table.svc .s-rst { width: 6%; }
.table.svc .s-act { width: 11%; }
.table.svc td, .table.svc .cell-main { overflow-wrap: anywhere; }
.act-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.deploy-group + .deploy-group { margin-top: 30px; }
.group-title { font-size: 15px; font-weight: 650; color: var(--ink-2); margin: 0 0 12px; }

/* ---------- deploys ---------- */
.deploys { display: grid; gap: 16px; }
.deploy { background: var(--panel); border-radius: var(--r-l); padding: 20px 22px; }
.deploy[data-running="true"] { box-shadow: inset 3px 0 0 var(--brand); }
.deploy-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.deploy-name { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.deploy-path { margin-top: 4px; color: var(--ink-3); font-size: 12.5px; display: flex; gap: 12px; flex-wrap: wrap; }
.deploy-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.facts { margin: 16px 0 0; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 16px; }
.facts dt { color: var(--ink-3); font-size: 13px; padding-top: 1px; }
.facts dd { margin: 0; min-width: 0; }
.commit { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.hash { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); background: var(--panel-2); padding: 1px 6px; border-radius: var(--r-s); }
.commit-msg { font-weight: 550; }
.commit-meta { color: var(--ink-3); font-size: 12.5px; }
.incoming { margin-top: 2px; }
.incoming summary { cursor: pointer; width: max-content; max-width: 100%; }
.incoming ol { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; border-left: 2px solid var(--line-2); padding-left: 12px; }
.note { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); font-size: 13px; }
.note .st-ico { margin-top: 2px; }
.progress { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-top: 2px; }
.progress li { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; }
.progress li[data-status="running"] { color: var(--ink); font-weight: 600; }
.progress ol { list-style: none; margin: 0; padding: 0; display: contents; }
.steps-inline { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.steps-inline li { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; }
.steps-inline li[data-status="running"] { color: var(--ink); font-weight: 600; }

/* ---------- tareas ---------- */
.sched { font-weight: 550; }
.cron { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.badge-paused { color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }

/* ---------- actividad ---------- */
.day { margin-top: 22px; }
.day:first-child { margin-top: 0; }
.day-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.events { list-style: none; margin: 0; padding: 0; }
.event { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.event:first-child { border-top: 0; }
.event .st-ico { margin-top: 2px; }
.event-text { min-width: 0; }
.event-meta { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.event-time { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; display: flex; gap: 10px; align-items: center; }

/* ---------- diálogos ---------- */
.dlg {
  padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-l);
  background: var(--panel); color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
.dlg::backdrop { background: rgba(0, 0, 0, .75); }
.dlg-confirm { width: min(560px, calc(100vw - 32px)); }
.dlg-body { padding: 22px 24px 20px; display: grid; gap: 14px; }
.dlg-title { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.dlg-content { color: var(--ink-2); display: grid; gap: 12px; max-height: 60vh; overflow: auto; }
.dlg-content b { color: var(--ink); }
.dlg-content ol, .dlg-content ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.dlg-actions { display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 8px; margin-top: 4px; }
.confirm-pw { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--bg); }
.confirm-pw .field input { background: var(--panel); }
.field-hint { color: var(--ink-3); font-size: 12.5px; }
.cmdlist { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 4px; counter-reset: c; }
.cmdlist li { counter-increment: c; display: grid; grid-template-columns: 22px minmax(0, 1fr); font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.cmdlist li::before { content: counter(c); color: var(--ink-3); font-family: var(--font); font-size: 12px; }
.cmdlist .step-name { display: block; font-family: var(--font); font-size: 13.5px; }
.cmdlist .step-cmd { display: block; color: var(--ink-3); overflow-wrap: anywhere; }
.cmdlist .step-cmd.only { color: var(--ink); }

.dlg-log { width: min(1080px, calc(100vw - 32px)); height: min(760px, calc(100vh - 48px)); display: none; }
.dlg-log[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.log-head { display: flex; align-items: flex-start; gap: 16px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.log-head-main { flex: 1; min-width: 0; }
.log-meta { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.log-status { padding-top: 3px; }
.log-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 0; }
.log-steps { list-style: none; margin: 0; padding: 14px 16px; border-right: 1px solid var(--line); overflow: auto; display: grid; align-content: start; gap: 4px; counter-reset: s; }
.log-steps li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding: 7px 8px; border-radius: var(--r-m); font-size: 13px; }
.log-steps li[data-status="running"] { background: var(--panel-2); }
.log-steps .st-ico { margin-top: 2px; }
.log-step-name { font-size: 13.5px; overflow-wrap: anywhere; color: var(--ink); }
.log-step-name.mono { font-family: var(--mono); font-size: 12.5px; }
.log-step-meta { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.log-term-wrap { position: relative; min-height: 0; display: grid; }
.term {
  margin: 0; overflow: auto; min-height: 0;
  background: var(--term); color: var(--ink);
  font: 400 12.5px/1.6 var(--mono);
  padding: 14px 18px 24px; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4;
}
.term .ln { display: block; min-height: 1.6em; }
.term .ln-e { color: #c8c8c8; }
.term .ln-c { color: var(--brand-ink); margin-top: 10px; }
.term .ln-c::before { content: "$ "; color: var(--ink-3); }
.term .ln-i { color: var(--ink-3); }
.term .ln-k, .term .ln-f { margin-top: 10px; font-family: var(--font); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.term .ln-k .st-ico, .term .ln-f .st-ico { width: 14px; height: 14px; }
.term-follow { position: absolute; right: 18px; bottom: 14px; }
.log-foot { display: flex; gap: 8px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ---------- avisos ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: start;
  padding: 12px 14px; background: var(--panel-3); border: 1px solid var(--line-2); border-radius: var(--r-m);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4); font-size: 13.5px;
  animation: toast-in .18s ease-out;
}
.toast .st-ico { margin-top: 1px; }
.toast-actions { display: flex; gap: 6px; }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .charts { grid-template-columns: minmax(0, 1fr); }
  .chart + .chart { border-left: 0; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 10px; }
  .cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: sticky; top: 0; z-index: 20; height: auto;
    flex-direction: column; gap: 10px; padding: 12px 14px 0;
    background: var(--bg); border-right: 0; border-bottom: 1px solid var(--line);
  }
  .side-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0; }
  .host-meta { display: none; }
  .nav { display: flex; gap: 4px; overflow-x: auto; margin: 0 -14px; padding: 0 14px 10px; scrollbar-width: none; }
  .nav a { flex: none; height: 34px; }
  .nav a[aria-current="page"]::before { left: 10px; right: 10px; top: auto; bottom: -10px; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .side-foot { display: none; }
  .main { padding: 20px 16px 56px; }
  .block, .deploy { padding: 16px; }
  .kpi { padding: 14px 16px 16px; }
  .charts { margin: 0 -16px; }
  .chart { padding: 4px 16px 0; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd { margin-bottom: 10px; }
  .log-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .log-steps { border-right: 0; border-bottom: 1px solid var(--line); max-height: 150px; }
  .dlg-log { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; border-radius: 0; }
  /* tablas como fichas */
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .table.responsive tr:last-child { border-bottom: 0; }
  .table.responsive td { border: 0; padding: 3px 0; text-align: left; }
  .table.responsive td[data-label]::before { content: attr(data-label) " "; color: var(--ink-3); font-size: 12.5px; }
  .table.responsive td:empty, .table.responsive td[data-empty] { display: none; }
  .table.responsive .act { text-align: left; padding-top: 8px; }
  .act-btns { justify-content: flex-start; }
  .meter-row { grid-template-columns: minmax(0, 1fr) auto; }
  .meter-row .meter { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpi + .kpi { border-left: 0; border-top: 1px solid var(--line); }
  .hero-title { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .meter > i { background: CanvasText; }
  .hero-glyph { forced-color-adjust: none; }
}
