/* consumo.css — pagina Consumo (window.Page_consumo). Semaforo de tokens. */

.cs { display: flex; flex-direction: column; gap: 16px; }

.cs-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cs-title { font-family: var(--f-display); font-weight: var(--fw-display); font-size: 24px; margin: 0; }
.cs-actions { display: flex; gap: 8px; }

.cs-cargando, .cs-error { padding: 24px; text-align: center; color: var(--txt2); }
.cs-error { color: #eab308; }

/* ── Semaforo de ventana ── */
.cs-semaforo { padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); position: relative; overflow: hidden; }
.cs-semaforo::before { content: ''; position: absolute; inset: 0; opacity: .06; pointer-events: none; }
.cs-semaforo.verde::before    { background: #22c55e; }
.cs-semaforo.amarillo::before { background: #eab308; }
.cs-semaforo.rojo::before     { background: #ef4444; }
.cs-semaforo.gris::before     { background: #64748b; }

.cs-sem-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cs-sem-tit { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--txt2); }
.cs-sem-estado { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--r-full); background: rgba(255,255,255,.05); color: var(--txt2); }
.cs-semaforo.verde .cs-sem-estado    { color: #22c55e; }
.cs-semaforo.amarillo .cs-sem-estado { color: #eab308; }
.cs-semaforo.rojo .cs-sem-estado     { color: #ef4444; }

.cs-gauge { height: 12px; border-radius: var(--r-full); background: rgba(255,255,255,.06); overflow: hidden; margin-bottom: 10px; }
.cs-gauge-fill { height: 100%; border-radius: var(--r-full); transition: width .4s ease; }
.cs-semaforo.verde .cs-gauge-fill    { background: #22c55e; }
.cs-semaforo.amarillo .cs-gauge-fill { background: #eab308; }
.cs-semaforo.rojo .cs-gauge-fill     { background: #ef4444; }
.cs-semaforo.gris .cs-gauge-fill     { background: #64748b; }

.cs-sem-nums { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.cs-sem-pct { font-family: var(--f-display); font-weight: 800; font-size: 40px; line-height: 1; color: var(--txt); }
.cs-sem-sub { font-size: 11px; color: var(--txt2); }

.cs-sem-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--txt2); border-top: 1px solid var(--line); padding-top: 10px; }
.cs-sem-foot b { color: var(--txt); }

/* ── KPIs ── */
.cs-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.cs-kpi { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; background: rgba(255,255,255,.02); border: 1px solid var(--line); border-radius: var(--r); }
.cs-kpi .v { font-size: 20px; font-weight: 800; color: var(--txt); line-height: 1.1; }
.cs-kpi .l { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--txt2); }

/* ── Bloques / tablas ── */
.cs-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.cs-block { background: rgba(255,255,255,.02); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.cs-block-h { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--txt2); margin-bottom: 8px; }
.cs-tabla { width: 100%; border-collapse: collapse; }
.cs-tabla td { padding: 5px 0; font-size: 13px; color: var(--txt); border-bottom: 1px solid rgba(255,255,255,.04); }
.cs-tabla tr:last-child td { border-bottom: none; }
.cs-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--txt2); }

/* ── Colectores ── */
.cs-maqs { display: flex; flex-direction: column; gap: 6px; }
.cs-maq { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.cs-dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; flex-shrink: 0; }
.cs-maq.on .cs-dot  { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.6); }
.cs-maq.off .cs-dot { background: #ef4444; }
.cs-maq-nom { color: var(--txt); font-weight: 600; }
.cs-maq-est { margin-left: auto; font-size: 11px; color: var(--txt2); }
.cs-maq.off .cs-maq-est { color: #ef4444; }
