.badge-ncs {
    display: inline-flex;
    align-items: center;
    background: #fee2e2;
    color: #991b1b;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 3px 9px;
    border-radius: 999px;
    line-height: 1.5;
    border: 1px solid rgba(153, 27, 27, .18);
}

.vcc-counter {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    color: #0c2340;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border-radius: 999px;
    line-height: 1.5;
    border: 1px solid #e2e8f0;
    font-variant-numeric: tabular-nums;
}

.vcc-gps-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #3b82f6;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}
.vcc-gps-link:hover { text-decoration: underline; }
.vcc-gps-link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.autosave-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #d1fae5;
    color: #065f46;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    margin-right: 8px;
    animation: autosaveFade 1.5s ease-out;
}
@keyframes autosaveFade {
    0% { opacity: 0; transform: scale(0.9); }
    20% { opacity: 1; transform: scale(1); }
    100% { opacity: 0.85; }
}

.seccion-con-error {
    border: 1.5px solid #fecaca;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}
.seccion-con-error .seccion-titulo { background: #fef2f2; }
.seccion-error-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    margin-left: 10px;
    animation: errorPulse 2s ease infinite;
}
@keyframes errorPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}
.seccion-flash {
    animation: seccionFlash 1.6s ease;
}
@keyframes seccionFlash {
    0% { background: transparent; }
    25% { background: rgba(220, 38, 38, 0.10); }
    100% { background: transparent; }
}

.vcc-card-acciones-expand {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.btn-detalle-vcc {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1e3a5f;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}
.btn-detalle-vcc:hover { background: #0f172a; }
.btn-detalle-vcc:focus-visible { outline: 2px solid #b8860b; outline-offset: 2px; }

.vcc-detalle-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem;
}

.vcc-detalle-page .detalle-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.25rem;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.vcc-detalle-page .detalle-header .header-titulo { flex: 1; min-width: 0; }
.vcc-detalle-page .detalle-header h1 { margin: 0; font-size: 18px; font-weight: 700; color: #0f172a; }
.vcc-detalle-page .detalle-header p { margin: 2px 0 0; font-size: 12.5px; color: #6b7280; }

.detalle-body { display: flex; flex-direction: column; gap: 14px; }

.detalle-seccion {
    background: #fff;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.detalle-seccion-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}
.detalle-seccion h2 { margin: 0; font-size: 15px; font-weight: 700; color: #0f172a; }
.detalle-seccion .contador-badge {
    background: #f1f5f9; color: #0c2340; font-size: 11px; font-weight: 700;
    padding: 3px 10px; border-radius: 999px; border: 1px solid #e2e8f0;
}

.detalle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}
.detalle-campo { display: flex; flex-direction: column; gap: 2px; }
.detalle-campo .lbl {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}
.detalle-campo .val { font-size: 13.5px; color: #0f172a; font-weight: 500; }

.vcc-detalle-cards { display: flex; flex-direction: column; gap: 10px; }
.vcc-detalle-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}
.vcc-detalle-card.tiene-nc { border-left: 3px solid #dc2626; }
.vcc-detalle-card-head {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    background: #f9fafb;
}
.vcc-detalle-card-head .vcc-num {
    width: 28px; height: 28px; border-radius: 50%;
    background: #b8860b; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.vcc-detalle-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vcc-detalle-titulo { font-size: 13.5px; font-weight: 600; color: #0f172a; }
.vcc-detalle-meta { font-size: 11.5px; color: #6b7280; }

.vcc-detalle-ncs { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; }
.vcc-detalle-nc {
    background: #fff;
    border: 1px solid #fee2e2;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.vcc-detalle-nc .nc-head {
    display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.vcc-detalle-nc .nc-titulo { font-size: 13px; font-weight: 600; color: #1f2937; }
.vcc-detalle-nc .nc-comentario {
    margin: 0; font-size: 12.5px; color: #475569; font-style: italic;
    border-left: 2px solid #e5e7eb; padding-left: 10px;
}
.vcc-detalle-nc .nc-foto {
    max-width: 200px; max-height: 140px;
    border-radius: 6px; cursor: zoom-in;
    border: 1px solid #e5e7eb;
    object-fit: cover;
}
.vcc-detalle-nc .nc-accion {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    margin-top: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid rgba(15, 23, 42, 0.05);
}
.vcc-detalle-nc .nc-accion-campo {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.vcc-detalle-nc .nc-accion-campo.full-row {
    grid-column: 1 / -1;
}
.vcc-detalle-nc .nc-accion-campo .lbl {
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5b6878;
    font-weight: 700;
}
.vcc-detalle-nc .nc-accion-campo .val {
    font-size: 12.5px;
    color: #0f172a;
    font-weight: 500;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.detalle-timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
    display: flex; gap: 14px;
    padding: 8px 0;
    position: relative;
}
.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 9px; top: 28px; bottom: -8px;
    width: 2px; background: #e5e7eb;
}
.timeline-dot {
    width: 20px; height: 20px;
    box-shadow: 0 0 0 1.5px #94a3b8;
    flex-shrink: 0;
    margin-top: 2px;
}
.timeline-dot-info { background: #3b82f6; box-shadow: 0 0 0 1.5px #3b82f6; }
.timeline-dot-danger { background: #dc2626; box-shadow: 0 0 0 1.5px #dc2626; }
.timeline-dot-success { background: #16a34a; box-shadow: 0 0 0 1.5px #16a34a; }
.timeline-content { display: flex; flex-direction: column; gap: 2px; }
.timeline-content strong { font-size: 13px; color: #0f172a; }
.timeline-content .timeline-meta { font-size: 11.5px; color: #6b7280; }
.timeline-content .timeline-comentario {
    color: #475569;
    font-style: italic;
    border-left: 2px solid #cbd5e1;
    padding-left: 6px;
    margin-left: 4px;
}

.detalle-aviso-rechazo {
    margin: 12px 0 18px;
    padding: 12px 16px;
    background: linear-gradient(180deg, #fef2f2, #fff);
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    color: #7f1d1d;
}
.detalle-aviso-rechazo svg { flex-shrink: 0; color: #dc2626; margin-top: 2px; }
.detalle-aviso-rechazo strong { color: #991b1b; display: block; margin-bottom: 3px; font-weight: 700; }
.detalle-aviso-rechazo .aviso-meta { color: #94182d; font-size: 11.5px; margin-top: 4px; }

.ncs-lista { display: flex; flex-direction: column; gap: 10px; }
.nc-card {
    border: 1px solid #e5e7eb;
    border-left: 4px solid #94a3b8;
    border-radius: 8px;
    background: #fff;
    padding: 12px 14px;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.nc-card.nc-estado-abierta { border-left-color: #ea580c; }
.nc-card.nc-estado-levantada { border-left-color: #16a34a; background: #f0fdf4; }
.nc-card.nc-atrasada { border-left-color: #dc2626; background: #fef2f2; }
.nc-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.nc-estado-badge {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
}
.nc-estado-badge.nc-estado-abierta { background: #fed7aa; color: #9a3412; }
.nc-estado-badge.nc-estado-levantada { background: #bbf7d0; color: #14532d; }
.nc-peligro { font-size: 11px; color: #5b6878; font-weight: 600; }
.nc-descripcion { font-size: 13.5px; color: #0f172a; margin: 0 0 8px; line-height: 1.45; }
.nc-meta { display: flex; gap: 16px; font-size: 11.5px; color: #6b7280; flex-wrap: wrap; margin-bottom: 8px; }
.nc-meta strong { color: #0f172a; font-weight: 600; }
.nc-levantamiento {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(22,163,74,.06);
    border-radius: 6px;
    font-size: 12px;
    color: #14532d;
}
.nc-levantamiento strong { color: #166534; }
.nc-coment {
    margin: 6px 0;
    font-style: italic;
    color: #166534;
    font-size: 12px;
}
.nc-foto-evidencia {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 6px;
    cursor: zoom-in;
    border: 1px solid #bbf7d0;
}
.nc-card-acciones {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.nc-esperando-responsable {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fef3c7;
    border-left: 3px solid #d97706;
    border-radius: 4px;
    font-size: 12.5px;
    color: #78350F;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nc-esperando-responsable strong {
    color: #92400e;
}

.nc-rechazo-aviso {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(179, 5, 15, .06);
    border-left: 3px solid #B3050F;
    border-radius: 6px;
    color: #7f1d1d;
}
.nc-rechazo-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
}
.nc-rechazo-head strong { color: #7f1d1d; font-weight: 700; }
.nc-rechazo-meta { color: #991b1b; font-size: 11px; }
.nc-rechazo-motivo {
    margin: 6px 0 0;
    color: #7f1d1d;
    font-size: 12.5px;
    line-height: 1.45;
}

.nc-cierre {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(20, 83, 45, .07);
    border-left: 3px solid #14532d;
    border-radius: 6px;
    font-size: 12px;
    color: #14532d;
}
.nc-cierre strong { color: #14532d; font-weight: 700; }
.nc-cierre .nc-coment { color: #14532d; font-style: italic; }

.badge-peligro {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.badge-rechazos {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 6px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}
.pendientes-tabla td > .nc-descripcion-cell + .badge-rechazos,
.pendientes-tabla td > .nc-descripcion-cell + .chip-motivo-rechazo {
    margin-top: 4px;
    margin-left: 0;
}
.plazo-vencido {
    color: #B3050F;
    font-weight: 700;
}
.plazo-por-vencer {
    color: #d97706;
    font-weight: 700;
}
.pendientes-tabla .dias-badge.dias-warning {
    background: #fef3c7;
    color: #92400e;
}
.lugar-cell {
    font-size: 12px;
    color: var(--admin-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 130px;
}
.pendientes-tabla thead th {
    position: sticky;
    top: 0;
    background: var(--admin-bg-soft, #f8fafc);
    z-index: 5;
    box-shadow: inset 0 -1px 0 #e2e8f0;
}
.historial-tabla-wrapper .pendientes-tabla {
    min-width: 1450px;
}
@media (max-width: 1024px) {
    .historial-tabla-wrapper .pendientes-tabla {
        min-width: 1100px;
    }
}
@media (max-width: 768px) {
    .historial-tabla-wrapper .pendientes-tabla {
        min-width: 800px;
    }
}
.badge-modo-aprobacion {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    padding: 3px 9px;
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    border-radius: 4px;
    vertical-align: middle;
}
.tab-count.tab-count-danger {
    background: #fee2e2;
    color: #991b1b;
    margin-left: 4px;
    font-weight: 700;
}
.vcc-codigo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--admin-navy, #1e3a8a);
    font-size: 12.5px;
    transition: color 160ms ease;
}
.vcc-codigo-link:hover {
    color: #c8102e;
    text-decoration: underline;
}
.responsable-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.responsable-avatar {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
