/* ==========================================================================
   IMPRESORAS EN CLIENTES (oct 2026)
   Una sola tabla con subtítulos por modelo o cliente, filtros compactos y
   niveles de tóner con letra, barra y número.
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.enlace-vista {
    color: var(--primary-light);
    font-weight: 600;
    text-decoration: none;
}

.enlace-vista:hover { text-decoration: underline; text-underline-offset: 3px; }

/* --- Barra: filtros, agrupación y búsqueda --- */
.imp-barra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: var(--radius-lg);
}

.imp-filtros { display: flex; flex-wrap: wrap; gap: 6px; }

.imp-filtro {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
}

.imp-filtro:hover { border-color: var(--primary-light); color: var(--text-primary); }
.imp-filtro:active { transform: scale(0.97); }
.imp-filtro svg { width: 14px; height: 14px; }

.imp-filtro span {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.imp-filtro.activo {
    background: var(--primary);
    border-color: transparent;
    color: #fff;
}

.imp-filtro.activo span { background: rgba(255, 255, 255, 0.2); color: #fff; }
[data-theme="dark"] .imp-filtro.activo { background: #5558e8; }

.imp-agrupar {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.imp-agrupar button {
    padding: 6px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease;
}

.imp-agrupar button.activo {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
}

.imp-buscar {
    margin-left: auto;
    flex: 1 1 240px;
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.imp-buscar:focus-within { border-color: var(--primary-light); box-shadow: 0 0 0 3px var(--primary-glow); }
.imp-buscar svg { width: 16px; height: 16px; color: var(--text-muted); flex: none; }

.imp-buscar input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.9rem;
}

/* --- Tabla --- */
.imp-tabla {
    padding: 0;
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

.imp-tabla[hidden] { display: none; }

.imp-table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: none;
    animation: aparecer 160ms ease-out;
}

.imp-table thead th {
    background: transparent;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.imp-table tr.imp-grupo th {
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
    padding: 16px 16px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.imp-grupo-nombre { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.imp-grupo-cuenta { margin-left: 10px; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); }

.imp-table tr.imp-fila { cursor: pointer; transition: background-color 120ms ease; }
.imp-table tr.imp-fila:hover { background: var(--primary-glow); }

.imp-table tr.imp-fila td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.imp-principal { display: block; font-weight: 600; color: var(--text-primary); }
.imp-sub { display: block; font-size: 0.78rem; color: var(--text-secondary); }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; letter-spacing: 0.01em; }
.imp-principal.mono { font-size: 0.88rem; }

.imp-cliente {
    color: var(--primary-light);
    font-weight: 600;
    text-decoration: none;
}

.imp-cliente:hover { text-decoration: underline; text-underline-offset: 3px; }
.imp-ubicacion { color: var(--text-secondary); }
.imp-table tr.imp-fila td.text-right,
.imp-table tr.imp-fila td.text-right .btn,
.imp-sin-dato { white-space: nowrap; }

.imp-aviso {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(245, 158, 11, 0.1);
    color: var(--text-primary);
    font-size: 0.88rem;
}

.imp-aviso svg { width: 18px; height: 18px; color: var(--tono-bajo); flex: none; }
.imp-sin-dato { font-size: 0.82rem; color: var(--text-secondary); }

/* Estado de MPS: punto + texto */
.estado-mps {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.estado-mps .punto { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.estado-ok { color: var(--tono-normal); }
.estado-off { color: var(--tono-critico); }
.estado-sin { color: var(--text-secondary); }
.estado-sin .punto { background: transparent; border: 1.5px solid currentColor; }

/* Niveles de tóner: letra, barra y número */
.tintas { display: grid; grid-template-columns: repeat(2, max-content); gap: 4px 14px; }

.tinta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    white-space: nowrap;
}

.tinta b { font-weight: 800; width: 10px; text-align: center; }

.tinta-barra {
    width: 34px;
    height: 6px;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 18%, transparent);
    overflow: hidden;
}

.tinta-barra i { display: block; height: 100%; border-radius: 999px; background: currentColor; }

.tinta em {
    min-width: 20px;
    font-style: normal;
    font-weight: 600;
    text-align: right;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.tinta-black { color: var(--text-primary); }
.tinta-cyan { color: #0e7490; }
.tinta-magenta { color: #be185d; }
.tinta-yellow { color: #a16207; }

[data-theme="dark"] .tinta-cyan { color: #22d3ee; }
[data-theme="dark"] .tinta-magenta { color: #f472b6; }
[data-theme="dark"] .tinta-yellow { color: #facc15; }

.tinta.bajo em { color: var(--tono-bajo); }

.otro-bajo {
    display: inline-block;
    margin-top: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--tono-bajo);
    background: rgba(245, 158, 11, 0.12);
    white-space: nowrap;
}
.tinta.critico em { color: var(--tono-critico); font-weight: 800; }

.imp-vacio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 48px 16px;
    color: var(--text-secondary);
}

.imp-vacio svg { width: 40px; height: 40px; color: var(--text-muted); }

/* Celular: cada equipo como una tarjeta compacta */
@media (max-width: 900px) {
    .imp-buscar { margin-left: 0; max-width: none; flex-basis: 100%; }
    .imp-table thead { display: none; }
    .imp-table,
    .imp-table tbody,
    .imp-table tr.imp-grupo,
    .imp-table tr.imp-grupo th { display: block; }

    .imp-table tr.imp-fila {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px 12px;
        padding: 12px 16px;
        border-bottom: 1px solid var(--border-color);
    }

    .imp-table tr.imp-fila td { display: block; padding: 0; border: 0; }
    .imp-table tr.imp-fila td.imp-equipo { grid-column: 1; grid-row: 1; }
    .imp-table tr.imp-fila td.text-right { grid-column: 2; grid-row: 1; align-self: start; }
    .imp-table tr.imp-fila td:not(.imp-equipo):not(.text-right) { grid-column: 1 / -1; }
    .tintas { display: flex; flex-wrap: wrap; gap: 6px 10px; }
    .tinta-barra { width: 24px; }
    .imp-grupo-cuenta { display: block; margin: 2px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    .imp-table { animation: none; }
}

