/* Tabla de aparatos */
.aparatos-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 0.6fr 1fr 0.4fr;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--color-bg-subtle, #f3f4f6);
    border-radius: 8px 8px 0 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.aparato-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 0.6fr 1fr 0.4fr;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    transition: background .15s;
}

.aparato-row:hover {
    background: var(--color-bg-subtle, #f9fafb);
}

.aparato-row input[type="text"],
.aparato-row input[type="number"] {
    width: 100%;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    border: 1.5px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    background: var(--color-bg, #fff);
    color: var(--color-text, #1f2937);
    font-family: inherit;
}

.aparato-row input:focus {
    outline: none;
    border-color: #2563eb;
}

.kwh-cell {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2563eb;
    text-align: center;
}

.btn-del {
    background: none;
    border: none;
    cursor: pointer;
    color: #ef4444;
    font-size: 1rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: background .15s;
}

.btn-del:hover {
    background: #fee2e2;
}

.btn-secondary {
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    border: 1.5px solid #2563eb;
    background: transparent;
    color: #2563eb;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: #2563eb;
    color: #fff;
}

/* Detalle tabla */
.detalle-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    font-size: 0.85rem;
    align-items: center;
}

.detalle-row.header {
    background: var(--color-bg-subtle, #f3f4f6);
    border-radius: 6px 6px 0 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-muted, #6b7280);
    text-transform: uppercase;
}

.detalle-row .pct-bar {
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    margin-top: 3px;
}

.detalle-row .pct-fill {
    height: 100%;
    border-radius: 3px;
    background: #2563eb;
}

@media (max-width: 600px) {
    .aparatos-header {
        grid-template-columns: 2fr 1fr 1fr 0.5fr 0.5fr;
    }

    .aparatos-header span:nth-child(4) {
        display: none;
    }

    .aparato-row {
        grid-template-columns: 2fr 1fr 1fr 0.5fr 0.5fr;
    }

    .aparato-row>*:nth-child(4) {
        display: none;
    }

    .detalle-row {
        grid-template-columns: 2fr 1fr 1fr;
    }

    .detalle-row>*:nth-child(3) {
        display: none;
    }
}