/* ══════════════════════════════════════
   CloudHero.css — hero de /cloud: panel de administración de servicios
   (animación del despliegue en cloudHero.js). Prefijo ch-.
══════════════════════════════════════ */
.ch-hero {
  position: relative;
  padding: 140px 32px 90px;
  overflow: hidden;
  background:
    radial-gradient(60% 60% at 80% 40%, rgba(26,95,208,0.10), transparent 70%),
    linear-gradient(rgba(8,27,59,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8,27,59,0.045) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
}

.ch-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
}

/* ── Texto ── */
.ch-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.66rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #1a5fd0;
}
.ch-kicker::before { content: ''; width: 28px; height: 1px; background: currentColor; }

.ch-h1 {
  margin: 0 0 22px;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  line-height: 1.12;
  letter-spacing: 0.5px;
  color: #081b3b;
}
.ch-h1 span { color: #1a5fd0; }

.ch-p {
  margin: 0 0 32px;
  max-width: 540px;
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(8,27,59,0.7);
}

.ch-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
.ch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 10px;
  border: 1px solid #c9d4e6;
  color: #0f2347;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.ch-btn i { font-size: 1.2rem; }
.ch-btn:hover { border-color: #1a5fd0; color: #1a5fd0; }
.ch-btn--primary { background: #0e3478; border-color: #0e3478; color: #fff; }
.ch-btn--primary:hover { background: #1a4fa8; border-color: #1a4fa8; color: #fff; }

.ch-pillars {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 22px 0 0;
  list-style: none;
  border-top: 1px solid rgba(8,27,59,0.12);
}
.ch-pillars li { display: flex; gap: 12px; align-items: flex-start; }
.ch-pillars i {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #0e3478;
  color: #8fd8ff;
  font-size: 1.05rem;
}
.ch-pillars b { display: block; font-size: 0.9rem; color: #0f2347; }
.ch-pillars span { font-size: 0.82rem; color: rgba(8,27,59,0.6); }

/* ── Consola ── */
.ch-console {
  --c-line: rgba(255,255,255,0.08);
  --c-text: #e6eefc;
  --c-muted: rgba(230,238,252,0.55);
  border-radius: 16px;
  overflow: hidden;
  background: #0a1730;
  border: 1px solid rgba(127,178,255,0.16);
  box-shadow: 0 40px 80px -36px rgba(5,14,34,0.65), 0 1px 0 rgba(255,255,255,0.05) inset;
  color: var(--c-text);
  font-size: 0.78rem;
}

.ch-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: #0d1d3b;
  border-bottom: 1px solid var(--c-line);
}
.ch-dots { display: flex; gap: 6px; }
.ch-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.16); }
.ch-bar-title em { font-style: normal; margin-left: 6px; padding: 1px 6px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.18); font-size: 0.6rem; letter-spacing: 1px; text-transform: uppercase; }
.ch-bar-title { flex: 1; font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 0.72rem; color: var(--c-muted); }
.ch-bar-ok {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Orbitron', sans-serif; font-size: 0.56rem; letter-spacing: 1.5px; color: #4ade80;
}
.ch-bar-ok::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: #4ade80;
  animation: chLive 1.8s ease-out infinite;
}
@keyframes chLive { 0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.6); } 100% { box-shadow: 0 0 0 8px rgba(74,222,128,0); } }

.ch-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); }

.ch-side {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 10px;
  border-right: 1px solid var(--c-line);
  background: #0b1834;
}
.ch-side button {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--c-muted);
  font: inherit;
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.ch-side button:hover { background: rgba(255,255,255,0.05); color: #fff; }
.ch-side button:focus-visible { outline: 2px solid #5fd8ff; outline-offset: -2px; }
.ch-side i { font-size: 1rem; }
.ch-side .is-on { background: rgba(95,216,255,0.1); color: #fff; }
.ch-side .is-on i { color: #5fd8ff; }

.ch-main { padding: 16px; display: grid; gap: 14px; min-width: 0; }

.ch-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ch-stats > div {
  position: relative;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--c-line);
  overflow: hidden;
}
.ch-stats span { display: block; font-size: 0.64rem; color: var(--c-muted); margin-bottom: 4px; white-space: nowrap; }
.ch-stats b { font-family: 'Orbitron', sans-serif; font-size: 0.95rem; font-weight: 600; color: #fff; }
.ch-cpu svg { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 26px; opacity: 0.8; }
.ch-cpu polyline { fill: none; stroke: #5fd8ff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }

.ch-table { border: 1px solid var(--c-line); border-radius: 10px; overflow: hidden; }
.ch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 108px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-top: 1px solid var(--c-line);
}
.ch-row:first-child { border-top: 0; }
.ch-row--head { background: rgba(255,255,255,0.03); font-size: 0.64rem; letter-spacing: 1px; text-transform: uppercase; color: var(--c-muted); }
.ch-row > span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-row > span:first-child i { font-size: 1rem; color: #7fb2ff; }
.ch-row em { font-style: normal; color: var(--c-muted); font-size: 0.7rem; }
.ch-row > span:nth-child(2) { font-family: ui-monospace, Menlo, monospace; font-size: 0.7rem; color: var(--c-muted); }
.ch-row.is-deploying { background: rgba(250,204,21,0.06); }

.ch-pill {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}
.ch-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ch-pill--ok { color: #4ade80; background: rgba(74,222,128,0.1); }
.ch-pill--warn { color: #facc15; background: rgba(250,204,21,0.12); }
.ch-pill--muted { color: #7fb2ff; background: rgba(127,178,255,0.1); }

.ch-deploy {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--c-line);
}
.ch-deploy-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ch-deploy-head b { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; }
.ch-deploy-head b i { color: #5fd8ff; }
.ch-deploy-head > span { font-size: 0.68rem; color: var(--c-muted); }

.ch-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; }
.ch-steps li {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.68rem;
  color: var(--c-muted);
  transition: color 0.3s ease;
}
.ch-steps li::before {
  content: '';
  flex-shrink: 0;
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid currentColor;
  transition: background 0.3s ease;
}
.ch-steps li.is-run { color: #facc15; }
.ch-steps li.is-run::before { animation: chBlink 0.8s ease-in-out infinite; }
.ch-steps li.is-done { color: #4ade80; }
.ch-steps li.is-done::before { background: currentColor; }
@keyframes chBlink { 50% { opacity: 0.3; } }

.ch-progress { height: 4px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; margin-bottom: 10px; }
.ch-progress span { display: block; height: 100%; background: linear-gradient(90deg, #1a5fd0, #5fd8ff); transition: width 0.4s linear; }

.ch-log {
  margin: 0;
  height: 3.9em;
  overflow: hidden;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--c-muted);
  white-space: pre;
}

/* ── Responsive ── */
/* ── Vistas del panel ── */
/* Todas las vistas ocupan la misma celda: el panel toma la altura de la más
   alta y no salta al cambiar de pestaña. Las ocultas no se ven ni reciben
   el cursor (visibility se hereda; ningún hijo la fuerza a visible). */
.ch-views { display: grid; min-width: 0; }
.ch-view { grid-area: 1 / 1; min-width: 0; align-content: start; animation: chIn 0.35s ease; }
.ch-view[hidden] { display: grid; visibility: hidden; pointer-events: none; animation: none; }
@keyframes chIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.ch-view-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ch-view-head b { font-size: 0.92rem; color: #fff; }
.ch-view-head > span { font-size: 0.68rem; color: var(--c-muted); }

.ch-mini {
  display: inline-flex; align-items: center; gap: 5px;
  justify-self: end;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.16);
  background: transparent;
  color: var(--c-text);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.ch-mini:hover { border-color: #5fd8ff; }
.ch-mini:disabled { opacity: 0.5; cursor: default; }
.ch-mini--primary { background: #1a5fd0; border-color: #1a5fd0; color: #fff; }
.ch-mini--primary:hover { background: #2a6fe0; }

.ch-hint { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.72rem; color: var(--c-muted); }
.ch-hint i { font-size: 1rem; color: #5fd8ff; }

.ch-table--4 .ch-row { grid-template-columns: minmax(0, 1fr) 82px 70px 92px; }
.ch-table--4 .ch-row > span:nth-child(3) { font-family: ui-monospace, Menlo, monospace; font-size: 0.7rem; color: var(--c-muted); }
.ch-table--4 .ch-row > span:nth-child(2) { font-family: inherit; }
.ch-row.is-new { animation: chFlash 1.6s ease; }
@keyframes chFlash { 0% { background: rgba(95,216,255,0.18); } 100% { background: transparent; } }

/* Servicios */
.ch-svc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ch-svc { padding: 11px 12px; border-radius: 10px; background: rgba(255,255,255,0.035); border: 1px solid var(--c-line); display: grid; gap: 7px; }
.ch-svc-head { display: flex; align-items: center; gap: 9px; margin-bottom: 2px; }
.ch-svc-head > i { font-size: 1.15rem; color: #7fb2ff; }
.ch-svc-head > div { flex: 1; min-width: 0; }
.ch-svc-head b { display: block; font-size: 0.76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-svc-head span { font-size: 0.64rem; color: var(--c-muted); }
.ch-svc-m { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; gap: 8px; font-size: 0.62rem; color: var(--c-muted); }
.ch-svc-m em { font-style: normal; text-align: right; color: var(--c-text); }
.ch-meter { display: block; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; }
.ch-meter i { display: block; height: 100%; border-radius: inherit; background: #5fd8ff; transition: width 0.6s ease; }
.ch-meter--b i { background: #a78bfa; }

/* Monitoreo */
.ch-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ch-chart { position: relative; padding: 12px 12px 0; height: 112px; box-sizing: border-box; border-radius: 10px; background: rgba(255,255,255,0.035); border: 1px solid var(--c-line); overflow: hidden; }
.ch-chart span { display: block; font-size: 0.64rem; color: var(--c-muted); }
.ch-chart b { font-family: 'Orbitron', sans-serif; font-size: 1rem; color: #fff; }
.ch-chart svg { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 56px; }
.ch-chart polyline { fill: none; stroke: #5fd8ff; stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.ch-chart[data-ch-chart="ram"] polyline { stroke: #a78bfa; }
.ch-chart[data-ch-chart="req"] polyline { stroke: #4ade80; }
.ch-chart[data-ch-chart="lat"] polyline { stroke: #facc15; }
.ch-alerts { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.25); font-size: 0.72rem; color: var(--c-text); }
.ch-alerts i { font-size: 1.1rem; color: #4ade80; }

/* Costos */
.ch-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 14px; border-radius: 10px; background: rgba(255,255,255,0.035); border: 1px solid var(--c-line); }
.ch-total b { font-family: 'Orbitron', sans-serif; font-size: 1.5rem; color: #fff; }
.ch-total span { font-size: 0.72rem; color: var(--c-muted); }
.ch-total em { flex-basis: 100%; display: inline-flex; align-items: center; gap: 5px; font-style: normal; font-size: 0.72rem; color: #4ade80; }
.ch-costs { display: grid; gap: 12px; }
.ch-cost { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 64px; align-items: center; gap: 12px; font-size: 0.74rem; }
.ch-cost .ch-meter { height: 6px; }
.ch-cost b { text-align: right; font-weight: 600; }

@media (max-width: 1080px) {
  .ch-inner { grid-template-columns: 1fr; }
  .ch-copy { max-width: 640px; }
}
@media (max-width: 640px) {
  .ch-hero { padding: 110px 16px 64px; }
  .ch-body { grid-template-columns: 1fr; }
  .ch-side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--c-line); padding: 8px; }
  .ch-side button { width: auto; white-space: nowrap; }
  .ch-svc-grid, .ch-charts { grid-template-columns: 1fr; }
  .ch-svc-grid .ch-svc:nth-child(n+5), .ch-charts .ch-chart:nth-child(n+3) { display: none; }
  .ch-table--4 .ch-row { grid-template-columns: minmax(0, 1fr) 86px; }
  .ch-table--4 .ch-row > span:nth-child(2), .ch-table--4 .ch-row > span:nth-child(3) { display: none; }
  .ch-cost { grid-template-columns: minmax(0, 1fr) 60px; }
  .ch-cost .ch-meter { display: none; }
  .ch-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-row { grid-template-columns: minmax(0, 1fr) 86px; }
  .ch-row > span:nth-child(2) { display: none; }
  .ch-steps li { font-size: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ch-bar-ok::before, .ch-steps li.is-run::before { animation: none; }
}
