/* ═══════════════════════════════════════════════
   style_custom.css — Clases auxiliares para home.js
   ═══════════════════════════════════════════════ */

/* ── Alertas (renderHomeAlerts) ── */

.ha-header {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ha-alert {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.4rem;
}

.ha-alert--error {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid var(--red);
}

.ha-alert--warning {
    background: rgba(234, 179, 8, 0.08);
    border-left: 3px solid var(--yellow);
}

.ha-alert-icon {
    font-size: 0.85rem;
}

.ha-alert-device {
    font-weight: 500;
    font-size: 0.78rem;
    color: var(--text-primary);
}

.ha-alert-msg {
    font-size: 0.78rem;
    color: var(--text-secondary);
    flex: 1;
}

.ha-alert-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ── Device Health (renderHomeDeviceHealth) ── */

.hdh-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.hdh-icon {
    font-size: 0.9rem;
}

.hdh-info {
    flex: 1;
    min-width: 0;
}

.hdh-name {
    font-size: 0.8rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hdh-id {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.hdh-stats {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-shrink: 0;
    font-size: 0.7rem;
}

.hdh-poll     { color: var(--text-muted); }
.hdh-active   { color: var(--green); }
.hdh-pending  { color: var(--yellow); }
.hdh-failures { color: var(--red); }
.hdh-cmds     { color: var(--text-muted); }

/* ── Live Feed (renderHomeLiveFeed) ── */

.hlf-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
}

.hlf-row--failed {
    background: rgba(239, 68, 68, 0.04);
}

.hlf-time {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 55px;
    padding-top: 2px;
}

.hlf-icon {
    font-size: 0.75rem;
    min-width: 18px;
}

.hlf-body {
    flex: 1;
    min-width: 0;
}

.hlf-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.hlf-cmd {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
}

.hlf-pkg {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.hlf-params {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hlf-error {
    font-size: 0.8rem;
    color: var(--red);
    margin-top: 1px;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hlf-device {
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Paquetes por Estado (renderHomeStates) ── */

.hs-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.hs-label {
    font-size: 0.78rem;
    width: 80px;
    color: var(--text-secondary);
}

.hs-bar-wrap {
    flex: 1;
    height: 20px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.hs-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.hs-count {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    width: 50px;
    text-align: right;
}

.hs-nosession {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px solid var(--border);
}

.hs-nosession-label {
    font-size: 0.78rem;
    width: 80px;
    color: var(--red);
}

.hs-nosession-text {
    flex: 1;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.hs-nosession-count {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    width: 50px;
    text-align: right;
    color: var(--red);
}

/* ── Personalidades (renderHomePersonalities) ── */

.hp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border);
}

.hp-name {
    font-size: 0.82rem;
}

/* ── Comandos por Tipo (renderHomeCmdsByType) ── */

.hcbt-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.hcbt-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

.hcbt-bar-wrap {
    flex: 1;
    height: 16px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.hcbt-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s;
}

.hcbt-count {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    width: 30px;
    text-align: right;
}

/* ── Track Stats — Chart 7 días (renderHomeTrackStats) ── */

.hts-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 60px;
    margin-bottom: 0.4rem;
}

.hts-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.hts-bar-val {
    font-size: 0.52rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.hts-bar-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 50px;
    justify-content: flex-end;
    border-radius: 3px 3px 0 0;
    overflow: hidden;
}

.hts-bar-own {
    width: 100%;
    background: var(--accent);
}

.hts-bar-kw {
    width: 100%;
    background: var(--green);
}

.hts-bar-date {
    font-size: 0.5rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.hts-legend {
    display: flex;
    gap: 0.8rem;
    font-size: 0.6rem;
    color: var(--text-muted);
}

.hts-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 3px;
}

.hts-legend-dot--kw  { background: var(--green); }
.hts-legend-dot--own { background: var(--accent); }

/* ── Track Stats — Barras de Género y Artistas ── */

.hts-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.hts-genre-label {
    font-size: 0.72rem;
    width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

.hts-artist-label {
    font-size: 0.72rem;
    width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

.hts-bar-wrap {
    flex: 1;
    height: 14px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.hts-genre-fill {
    height: 100%;
    background: var(--blue);
    border-radius: 3px;
}

.hts-artist-fill {
    height: 100%;
    background: var(--purple);
    border-radius: 3px;
}

.hts-row-count {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    width: 28px;
    text-align: right;
}

/* ── Active Table (renderHomeActiveTable) ── */

.hat-device {
    font-size: 0.78rem;
}

.hat-label {
    font-size: 0.9rem;
}

.hat-nowplaying {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.15rem;
}

.hat-personality {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.hat-tracks {
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.hat-next {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--yellow);
}

.hat-next-time {
    color: var(--text-muted);
}

/* ── Utilidades generales (usadas en home.js) ── */

.text-empty {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.text-empty-center {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* Badge tamaño extra pequeño */
.badge-xs {
    font-size: 0.52rem;
}

/* Badge con margen para grids de géneros */
.badge-spaced {
    margin: 0.2rem;
}

/* Opacidad para contadores dentro de badges */
.badge-dim {
    opacity: 0.6;
}

/* Override para stat-label en el header de alertas */
.ha-title {
    margin: 0;
    font-size: 0.78rem;
}


/* ── Choices.js — evitar que el dropdown se corte ── */

/* El contenedor del formulario no debe recortar el dropdown */
#acc-form-panel .stat-card {
    overflow: visible;
}

.choices__list--dropdown {
    z-index: 9999 !important;
}