/*
 * css/recursos.css — página Recursos (#/recursos), estándar Resources §7.2, §7.8 (docs/Resources_ES.md §2).
 * Todo color sale de variables: las del kit (--chrome-*, --mc-*, --ok/--warn/--err y sus -text) y las de identidad
 * de cada tarjeta (--res-*), con valor por tema. La identidad no indica estado: el estado va en la pastilla .state.
 */
:root {
  /* identidad por métrica (RES-5), validada contra --chrome-bg-raised oscuro (#020617) el 18-nov-2026 */
  --res-mem: #8b5cf6;
  --res-swap: #ea580c;
  --res-cpu: #3b82f6;
  --res-disk: #ec4899;
  --res-heavy: #0891b2;
  --res-db: #65a30d;
}
:root[data-theme="light"] {
  /* validada contra --chrome-bg-raised claro (#ffffff) */
  --res-mem: #7c3aed;
  --res-cpu: #2563eb;
  --res-disk: #db2777;
}

.res-mem { --lc: var(--res-mem); }
.res-swap { --lc: var(--res-swap); }
.res-cpu { --lc: var(--res-cpu); }
.res-disk { --lc: var(--res-disk); }
.res-heavy { --lc: var(--res-heavy); }
.res-db { --lc: var(--res-db); }

/* ---- barra ---- */
.res-bar .seg { flex-wrap: wrap; max-width: 100%; }   /* seis períodos: en teléfono pasan a dos filas */
.res-bar .tb-row > * { min-width: 0; }
.res-field[hidden], .res-bar [hidden] { display: none; }
.res-bar input[type="datetime-local"].inp { color-scheme: inherit; min-width: 0; max-width: 100%; }
.res-bar .res-num { width: 80px; }
.res-host { min-width: 0; overflow-wrap: anywhere; font-size: var(--chrome-text-md); color: var(--chrome-fg-muted); }
.res-bar a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.res-notice { margin: 0 0 14px; padding: 8px 12px; border-radius: var(--chrome-radius-md); font-size: var(--chrome-text-md);
  color: var(--warn-text); background: color-mix(in srgb, var(--warn) 12%, transparent); overflow-wrap: anywhere; }
.res-notice[hidden] { display: none; }

/* ---- tarjetas ---- */
.res-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin-bottom: 14px; }
.res-grid > .skel { min-height: 196px; }
.res-grid > .err-box, .res-grid > .empty { grid-column: 1 / -1; }
.res-card {
  min-width: 0; padding: 14px 18px; display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--mc-border); border-top: 5px solid var(--lc); border-radius: var(--mc-radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--lc) var(--mc-tint), var(--mc-surface)) 0, var(--mc-surface) 110px);
}
.res-k { margin: 0; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--mc-dim);
  overflow-wrap: anywhere; }
.res-v { font: 700 2.6rem/1.1 var(--mc-mono); font-variant-numeric: tabular-nums; color: var(--mc-text); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.res-v .na { color: var(--mc-dim); font-weight: 400; }
.res-unit { font-size: 1.2rem; font-weight: 600; margin-left: 5px; }
.res-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-height: 22px; font-size: 0.78rem; color: var(--mc-dim);
  min-width: 0; overflow-wrap: anywhere; }
.res-sub .err { color: var(--err-text); }
.res-sub .warn { color: var(--warn-text); }

.res-spark { position: relative; height: 44px; cursor: crosshair; touch-action: pan-y; }
.res-svg { width: 100%; height: 44px; display: block; overflow: visible; }
.res-line { fill: none; stroke: var(--lc); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.res-area { fill: var(--lc); opacity: 0.14; stroke: none; }
.res-guide { stroke: var(--mc-dim); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.res-guide[hidden] { display: none; }   /* hidden no se aplica solo dentro de un SVG */
.res-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--lc);
  border: 1.5px solid var(--mc-surface); transform: translate(-50%, -50%); pointer-events: none; }
.res-dot[hidden] { display: none; }
.res-spark-empty { height: 44px; display: grid; place-items: center; text-align: center; font-size: 0.78rem; color: var(--mc-dim); }
.res-cap { margin: 0; min-height: 1.2em; font-size: 0.75rem; color: var(--mc-dim); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---- detalle ---- */
.res-detail { width: 100%; border-collapse: collapse; font-size: var(--chrome-text-md); }
.res-detail td { padding: 6px 8px; border-bottom: 1px solid var(--chrome-border); vertical-align: top; }
.res-detail td:first-child { color: var(--chrome-fg-muted); width: 40%; }
.res-detail td:last-child { overflow-wrap: anywhere; }

@media (max-width: 600px) {
  .res-v { font-size: 2rem; }
  .res-detail td:first-child { width: 45%; }
}
