/* ==========================================================================================================
   barra-estado.css — 12 oct 2026 («opción C», elegida por Lucas)
   1) La fila «Servidor» pasa a ser una BARRA DE ESTADO: una celda por servidor con nombre, estado en palabras y el motivo
      principal; franja de color arriba (verde / ámbar / rojo / gris); el servidor elegido con fondo de acento.
   2) Pestañas LIMPIAS: sin borde de píldora ni círculo de ícono; un solo color de «elegida» para todas; las alertas
      son un ícono en línea con el texto (triángulo = Crítico, círculo con «!» = Atención), nunca montado sobre el borde.
   100 % adaptativa: escritorio, notebook, tablet, celular vertical y acostado, y la pestaña Mapa en celular.
   Se carga DESPUÉS de responsive.css / kpi-barra.css y pisa solo lo de estas dos filas. Usa los tokens de tokens.css
   (claro y oscuro). Rollback: sacar el <link> de index.html (index.html.pre-barra-estado-20261012).
   ========================================================================================================== */

/* ---------- 1. Barra de estado de servidores ---------- */
.gs-bar {
    display: block; padding: 0; margin-bottom: 12px;
    background: transparent; border: 0; border-radius: 0;
}
.gs-bar .gs-label, .gs-bar .gs-hint {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.gs-bar .gs-chips {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0;
    background: var(--bg-panel); border: 1px solid var(--border-weak); border-radius: 6px; overflow: hidden;
}
.gs-chips .gs-chip.gs-cell {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px;
    min-width: 0; min-height: 0; padding: 10px 14px 9px; margin: 0;
    background: var(--bg-panel); color: var(--text-primary);
    border: 0; border-right: 1px solid var(--border-weak); border-radius: 0;
    font: inherit; text-align: left; letter-spacing: 0; cursor: pointer;
    transition: background-color .15s ease;
}
.gs-chips .gs-chip.gs-cell:last-child { border-right: 0; }
.gs-chips .gs-chip.gs-cell::before {
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--text-disabled);
}
.gs-chips .gs-cell.est-ok::before { background: var(--color-success-solid); }
.gs-chips .gs-cell.est-warn::before { background: var(--color-warning-solid); }
.gs-chips .gs-cell.est-crit::before { background: var(--color-critical-solid); }
.gs-chips .gs-chip.gs-cell:not(.on):hover { background: var(--bg-surface); }
.gs-chips .gs-chip.gs-cell.on {
    background: color-mix(in srgb, var(--color-info-solid) 10%, var(--bg-panel));
    box-shadow: inset 0 -2px 0 var(--color-info-solid);
    color: var(--text-primary);
}
.gs-chips .gs-chip.gs-cell:focus-visible { outline: 2px solid var(--color-info-solid); outline-offset: -2px; z-index: 1; }
.gs-cell-n { font-size: 14px; font-weight: 650; line-height: 1.3; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-cell.on .gs-cell-n { color: var(--color-info); }
.gs-cell-s {
    display: block; max-width: 100%; font-size: 12px; line-height: 1.35; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gs-cell-e { font-weight: 650; }
.gs-cell.est-ok .gs-cell-e { color: var(--color-success); }
.gs-cell.est-warn .gs-cell-e { color: var(--color-warning); }
.gs-cell.est-crit .gs-cell-e { color: var(--color-critical); }
.gs-cell.est-na .gs-cell-e { color: var(--text-disabled); font-weight: 500; }
.gs-cell-mas { font-weight: 600; color: var(--text-secondary); }
/* los elementos viejos (ícono redondo y punto) ya no se dibujan */
.gs-cell .gs-chip-icon, .gs-cell .gs-chip-dot { display: none !important; }

/* ---------- 2. Pestañas limpias ---------- */
.tabs-container .tab-button {
    gap: 7px; padding: 6px 11px; min-height: 34px;
    background: transparent; border: 1px solid transparent; border-radius: 6px;
    color: var(--text-secondary); font-weight: 550; letter-spacing: 0;
}
.tabs-container .tab-button .tab-button-icon {
    width: 16px; height: 16px; border-radius: 0; background: transparent; color: inherit; opacity: .8;
}
.tabs-container .tab-button[data-tab]:not(.active) .tab-button-icon,
.tabs-container .tab-button.tab-admin:not(:hover) .tab-button-icon { color: inherit; }
.tabs-container .tab-button:not(.active):hover { background: var(--bg-surface); border-color: transparent; color: var(--text-primary); }
.tabs-container .tab-group-tabs .tab-button.active,
.tabs-container .tab-group-tabs .tab-button[data-tab].active {
    background: color-mix(in srgb, var(--color-info-solid) 12%, var(--bg-panel));
    border-color: transparent; color: var(--color-info);
}
.tabs-container .tab-group-tabs .tab-button.active .tab-button-icon { background: transparent; color: inherit; opacity: 1; }
.tabs-container .tab-button:focus-visible { outline: 2px solid var(--color-info-solid); outline-offset: 2px; }
.tabs-container .tab-group-tabs { gap: 4px; }

/* alertas de pestaña: ícono en línea (no un punto sobre el borde) */
.tabs-container .tab-dot { display: none; }
.tabs-container .tab-dot.crit, .tabs-container .tab-dot.warn {
    position: static; display: inline-flex; align-items: center; flex: 0 0 auto;
    width: 15px; height: 15px; margin-left: 1px;
    background: none; border-radius: 0; box-shadow: none; clip-path: none; transform: none;
}
.tabs-container .tab-dot.crit { color: var(--color-critical-solid); }
.tabs-container .tab-dot.warn { color: var(--color-warning-solid); }
.tabs-container .tab-dot .tab-ico { width: 15px; height: 15px; display: block; }

/* ---------- 3. Tablet (< 1024 px): pestañas en una tira (como hoy), celdas más chicas ---------- */
@media (max-width: 1023.98px) {
    [data-rp="index"] .tabs-container .tab-button { padding: 6px 10px; gap: 6px; font-size: 13px; }
    [data-rp="index"] .tabs-container .tab-button .tab-button-icon { width: 16px; height: 16px; }
    .gs-bar .gs-chips { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .gs-chips .gs-chip.gs-cell { padding: 9px 12px 8px; }
}

/* ---------- 4. Celular (< 768 px, y celular acostado): celdas en una fila; solo nombre + estado ---------- */
@media (max-width: 767.98px), (orientation: landscape) and (max-height: 500px) and (max-width: 1023.98px) {
    [data-rp="index"] .gs-bar, .gs-bar { padding: 0; margin-bottom: 8px; overflow: visible; background: transparent; border: 0; }
    .gs-bar .gs-chips, [data-rp="index"] .gs-chips {
        display: grid; grid-auto-flow: column; grid-template-columns: none;
        grid-auto-columns: minmax(92px, 1fr); overflow-x: auto; padding: 0; gap: 0;
        scrollbar-width: none; scroll-snap-type: x proximity;
    }
    .gs-bar .gs-chips::-webkit-scrollbar { display: none; }
    [data-rp="index"] .gs-chips .gs-chip.gs-cell { padding: 8px 10px 7px; min-height: 48px; scroll-snap-align: start; }
    .gs-cell-n { font-size: 13.5px; }
    .gs-cell-m { display: none; }
    [data-rp="index"] .tabs-container .tab-button { padding: 6px 10px; min-height: 40px; }
}

/* 4b. Pestaña Mapa en celular vertical y celular acostado: servidor y pestañas comparten la fila → celdas mínimas
       (nombre arriba, franja de color; el estado en palabras queda para el lector de pantalla y el tooltip) */
@media (max-width: 767.98px) {
    [data-rp="index"] #content[style*="block"]:has(> #mapa.active) { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
    [data-rp="index"] #content[style*="block"]:has(> #mapa.active) > .gs-bar { padding: 0; margin: 0 0 8px; }
    [data-rp="index"] #content[style*="block"]:has(> #mapa.active) > .gs-bar .gs-chips { grid-auto-columns: minmax(58px, 1fr); }
    [data-rp="index"] #content[style*="block"]:has(> #mapa.active) > .gs-bar .gs-cell { padding: 9px 6px 7px; min-height: 40px; align-items: center; }
    [data-rp="index"] #content[style*="block"]:has(> #mapa.active) > .gs-bar .gs-cell-n { font-size: 12.5px; }
    [data-rp="index"] #content[style*="block"]:has(> #mapa.active) > .gs-bar .gs-cell-s { display: none; }
}
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1023.98px) {
    [data-rp="index"] #content[style*="block"] > .gs-bar { padding: 0; }
    [data-rp="index"] #content[style*="block"] > .gs-bar .gs-chips { grid-auto-columns: minmax(84px, 1fr); }
    [data-rp="index"] #content[style*="block"] > .gs-bar .gs-cell { min-height: 40px; padding: 6px 8px 5px; }
}

/* ---------- 5. Pantallas táctiles: áreas cómodas sin agrandar la píldora ---------- */
@media (pointer: coarse) {
    [data-rp="index"] .gs-chips .gs-chip.gs-cell { min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
    .gs-chips .gs-chip.gs-cell, .tabs-container .tab-button { transition: none; }
}
