.responsable-avatar.responsable-avatar-vacio {
    background: #f3f4f6;
    color: #9ca3af;
    border: 1px dashed #d1d5db;
}
.btn-copy-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    margin-left: 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--admin-text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    vertical-align: -3px;
}
.btn-copy-mini:hover {
    background: #eef2ff;
    color: #1e3a8a;
    border-color: #c7d2fe;
}
.btn-copy-mini:active { transform: scale(0.92); }
.sin-resultados-icono {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    color: #cbd5e1;
}
.sin-resultados-icono svg {
    width: 42px;
    height: 42px;
}
.motivo-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 6px;
}
.motivo-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.08s;
}
.motivo-chip:hover {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}
.motivo-chip:active { transform: scale(0.96); }
.motivo-chip-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    margin-right: 5px;
    font-size: 9.5px;
    font-weight: 700;
    color: #5b6878;
    background: #e2e8f0;
    border-radius: 3px;
    font-family: ui-monospace, monospace;
}
.motivo-chip:hover .motivo-chip-kbd {
    color: #991b1b;
    background: #fee2e2;
}
.btn-limpiar-motivo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 10.5px;
    font-weight: 600;
    color: #475569;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.btn-limpiar-motivo:hover {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}
.modal-atajos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 8px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 10.5px;
    color: #5b6878;
}
.badge-vencidas-count {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    min-width: 18px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    background: #dc2626;
    border-radius: 999px;
    vertical-align: middle;
}
.multi-check-label.multi-check-active {
    color: #1e3a8a;
    font-weight: 600;
}
.historial-input.filtro-lugar-activo {
    background: linear-gradient(0deg, rgba(30, 58, 138, 0.05), rgba(30, 58, 138, 0.05)), #fff;
    border-color: #1e3a8a;
    color: #1e3a8a;
    font-weight: 600;
}
@keyframes badge-nueva-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
    50% { box-shadow: 0 0 0 3px rgba(22, 163, 74, 0); }
}
.badge-nueva {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 800;
    color: #fff;
    background: #16a34a;
    border-radius: 999px;
    letter-spacing: 0.05em;
    vertical-align: middle;
    animation: badge-nueva-pulse 2.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
    .badge-nueva { animation: none; }
}
.historial-busqueda-wrap {
    position: relative;
    flex: 1 1 320px;
    min-width: 220px;
    display: flex;
    align-items: center;
}
.historial-busqueda-wrap .historial-busqueda { flex: 1; padding-right: 44px; }
.busqueda-hint {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #5b6878;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.busqueda-hint:hover {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}
.busqueda-hint kbd {
    display: inline-block;
    padding: 1px 6px;
    font-size: 9.5px;
    font-weight: 700;
    color: #5b6878;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-bottom-width: 2px;
    border-radius: 3px;
    font-family: ui-monospace, monospace;
    line-height: 1.3;
}
.badge-match-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 10.5px;
    font-weight: 600;
    color: #713f12;
    background: #fef9c3;
    border: 1px solid #fde68a;
    border-radius: 999px;
}
.nc-highlight {
    background: #fef08a;
    color: #713f12;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}
.modal-atajos kbd {
    display: inline-block;
    padding: 1px 5px;
    margin: 0 1px;
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-bottom-width: 2px;
    border-radius: 3px;
    font-family: ui-monospace, monospace;
    line-height: 1.2;
}
.motivo-progress-bar {
    margin-top: 6px;
    height: 4px;
    width: 100%;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}
.motivo-progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 180ms ease, background 180ms ease;
}
.responsable-nombre {
    font-size: 12px;
    color: var(--admin-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.historial-fila-clickable.fila-expandida {
    background: rgba(30, 58, 138, 0.04);
    border-left: 3px solid var(--admin-navy, #1e3a8a);
}
.historial-fila-clickable.fila-vencida:not(.fila-expandida) {
    border-left: 3px solid #B3050F;
    background: linear-gradient(to right, rgba(179,5,15,0.025) 0%, transparent 8%);
}
.historial-fila-clickable.fila-vencida.fila-expandida {
    border-left: 3px solid #B3050F;
}
.historial-fila-clickable.fila-re-rechazada:not(.fila-vencida):not(.fila-expandida) {
    background: linear-gradient(to right, rgba(217,119,6,0.04) 0%, transparent 8%);
    border-left: 3px solid #d97706;
}
.historial-detalle-fila {
    border-left: none;
}
.historial-fila-clickable.fila-expandida td:first-child {
    padding-left: 11px;
}
.nc-timeline {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: flex-start;
    background: linear-gradient(to right, transparent 0%, rgba(15,23,42,0.02) 50%, transparent 100%);
    padding: 12px 16px;
    border-radius: 6px;
}
.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding-left: 16px;
    position: relative;
    min-width: 110px;
}
.timeline-step.done .timeline-dot { background: #15803d; box-shadow: 0 0 0 2px #15803d33; }
.timeline-step.pending .timeline-dot { background: #cbd5e1; }
.timeline-step.rejected .timeline-dot { background: #B3050F; box-shadow: 0 0 0 2px #B3050F33; }
.timeline-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-text-muted);
}
.timeline-step.done .timeline-label { color: #14532d; }
.timeline-step.rejected .timeline-label { color: #991b1b; }
.timeline-date {
    font-size: 11px;
    color: var(--admin-text);
    font-variant-numeric: tabular-nums;
}
.historial-detalle-fila {
    animation: nc-detalle-fade 220ms ease;
    scroll-margin-top: 80px;
}
@keyframes nc-detalle-fade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}
.historial-fila-clickable {
    transition: background 160ms ease, border-left-color 160ms ease;
}
.pendientes-tabla tbody tr.historial-fila-clickable:nth-of-type(4n+3):not(.fila-expandida):not(.fila-vencida):not(.fila-re-rechazada) {
    background: rgba(15, 23, 42, 0.012);
}
.historial-fila-clickable:hover:not(.fila-expandida) {
    background: rgba(15, 23, 42, 0.04);
}
.historial-fila-clickable:focus-visible {
    outline: 2px solid #1e3a8a;
    outline-offset: -2px;
    background: rgba(30, 58, 138, 0.06);
}
.historial-fila-clickable:focus { outline: none; }
.historial-fila-clickable.fila-expandida {
    scroll-margin-top: 80px;
}

@media (max-width: 1024px) {
    .pendientes-tabla th:nth-child(8),
    .pendientes-tabla td:nth-child(8),
    .pendientes-tabla th:nth-child(7),
    .pendientes-tabla td:nth-child(7) {
        display: none;
    }
    .nc-timeline {
        gap: 14px;
        font-size: 10px;
    }
}

@media (max-width: 768px) {
    .pendientes-tabla th:nth-child(2),
    .pendientes-tabla td:nth-child(2),
    .pendientes-tabla th:nth-child(6),
    .pendientes-tabla td:nth-child(6) {
        display: none;
    }
    .responsable-cell { gap: 4px; }
    .responsable-avatar { width: 22px; height: 22px; font-size: 8px; }
    .responsable-nombre { font-size: 11px; }
    .badge-modo-aprobacion {
        margin-left: 0;
        margin-top: 6px;
        display: inline-flex;
    }
}

@media print {
    .levantamientos-subtabs,
    .historial-controles,
    .acciones-fila,
    .desvio-card-acciones,
    .modulo-tabs,
    .levantamientos-tab .admin-toolbar,
    .vcc-codigo-link svg,
    .badge-modo-aprobacion,
    .modal-rechazo,
    .ops-modal-overlay,
    .historial-fila-clickable[title]::after {
        display: none !important;
    }
    .pendientes-tabla, .historial-tabla {
        font-size: 10px;
    }
    .pendientes-tabla img {
        max-width: 80px;
        max-height: 80px;
    }
    .seccion-card {
        box-shadow: none !important;
        border: 1px solid #ccc;
    }
    .historial-detalle-fila {
        animation: none;
        page-break-inside: avoid;
    }
    .badge-peligro, .estado-badge, .chip-motivo-rechazo, .badge-rechazos {
        border: 1px solid #999;
    }
}
.nc-descripcion-cell {
    font-size: 12px;
    color: var(--admin-text, #0f172a);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.modal-overlay {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
}
.modal-card {
    background: #fff;
    border-radius: 12px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(15,23,42,.25);
}
.modal-card--md { max-width: 620px; }
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
}
.modal-head h2 {
    font-size: 15px; font-weight: 700; color: #0f172a; margin: 0;
}
.modal-cerrar {
    background: transparent; border: none; cursor: pointer; padding: 4px;
    color: #5b6878;
}
.modal-cerrar:hover { color: #0f172a; }
.modal-cerrar svg { width: 18px; height: 18px; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid #e5e7eb;
    background: #fafbfd;
}
.modal-nc-resumen {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 4px 12px;
    font-size: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 12px;
}
.modal-nc-resumen .lbl { color: #5b6878; font-weight: 600; }
.modal-nc-resumen .val { color: #0f172a; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.modal-campo { display: flex; flex-direction: column; gap: 4px; }
.modal-campo-lbl { font-size: 12px; font-weight: 600; color: #0f172a; }
.modal-campo-lbl em { color: #dc2626; font-style: normal; }
.modal-campo-hint { font-size: 11px; color: #64748b; align-self: flex-end; }
.modal-textarea {
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}
.modal-textarea:focus { outline: 2px solid #b8860b; outline-offset: -1px; border-color: #b8860b; }
.modal-file {
    font-size: 12px;
    padding: 6px 8px;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    background: #fafbfd;
}
.modal-foto-preview {
    margin-top: 8px;
    position: relative;
    display: inline-block;
}
.modal-foto-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}
.modal-foto-quitar {
    position: absolute;
    top: 4px; right: 4px;
    background: rgba(220, 38, 38, .92);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 7px;
    cursor: pointer;
}
.modal-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
}

.vcc-lightbox {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 2rem;
    cursor: zoom-out;
}
.vcc-lightbox img {
    max-width: 100%; max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    cursor: default;
}
.vcc-lightbox-cerrar {
    position: absolute; top: 16px; right: 16px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s ease;
}
.vcc-lightbox-cerrar:hover { background: rgba(255, 255, 255, 0.25); }
.vcc-lightbox-cerrar svg { width: 22px; height: 22px; }

@media (max-width: 600px) {
    .detalle-grid { grid-template-columns: 1fr; }
    .vcc-detalle-nc .nc-accion { grid-template-columns: 1fr; }
}

.pendientes-tabla .responsable-cell {
    display: flex;
    max-width: 150px;
}

.estado-badge.estado-badge--grande { font-size: 12px; padding: 6px 12px; font-weight: 700; }
