/* =====================================================================
 * Modal de Diagnóstico de Descuadre
 * ===================================================================== */

.dd-modal .modal-content { border-radius: 12px; }
.dd-modal .modal-header  { background: linear-gradient(135deg, #f8fafc, #ffffff); }

.dd-wrap {
    padding: 1.1rem 1.25rem;
    background: #f8fafc;
}

/* ----- Loading ----- */
.dd-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #64748b;
    padding: 3rem;
    font-style: italic;
}

/* ----- Header del grupo ----- */
.dd-grupo-info {
    background: #fff;
    border-radius: 8px;
    padding: 0.7rem 0.95rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.dd-grupo-titulo {
    font-weight: 700;
    color: #0f172a;
    font-size: 1rem;
}

.dd-grupo-meta { margin-top: 0.25rem; }

/* ----- Sección ----- */
.dd-section {
    background: #fff;
    border-radius: 10px;
    padding: 0.9rem 1.05rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.dd-section-title {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.95rem;
}

/* ----- Cuadre ----- */
.dd-cuadre {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.8rem 1.1rem;
    border-radius: 8px;
}

.dd-cuadre-ok   { background: #f0fdf4; border-left: 4px solid #16a34a; }
.dd-cuadre-warn { background: #fefce8; border-left: 4px solid #f59e0b; }
.dd-cuadre-err  { background: #fef2f2; border-left: 4px solid #dc2626; }

.dd-cuadre-val {
    font-family: 'Roboto Mono', monospace;
    font-weight: 800;
    font-size: 1.6rem;
}

.dd-cuadre-ok   .dd-cuadre-val { color: #16a34a; }
.dd-cuadre-warn .dd-cuadre-val { color: #ca8a04; }
.dd-cuadre-err  .dd-cuadre-val { color: #dc2626; }

.dd-cuadre-tag {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
}

/* ----- Veredicto ----- */
.dd-verdict {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
}

.dd-verdict-found   { background: #dcfce7; border-left: 4px solid #16a34a; }
.dd-verdict-partial { background: #fefce8; border-left: 4px solid #f59e0b; }
.dd-verdict-info    { background: #e0f2fe; border-left: 4px solid #0ea5e9; }

/* shorthand classes generated from JS `is-${verdict.cls}` */
.dd-verdict-is-found   { background: #dcfce7; border-left: 4px solid #16a34a; }
.dd-verdict-is-partial { background: #fefce8; border-left: 4px solid #f59e0b; }
.dd-verdict-is-info    { background: #e0f2fe; border-left: 4px solid #0ea5e9; }

.dd-verdict-icon {
    font-size: 1.8rem;
    color: #475569;
}

.dd-verdict-is-found  .dd-verdict-icon { color: #16a34a; }
.dd-verdict-is-partial .dd-verdict-icon { color: #f59e0b; }
.dd-verdict-is-info    .dd-verdict-icon { color: #0ea5e9; }

.dd-verdict-titulo {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.2rem;
}

.dd-verdict-mensaje {
    color: #475569;
    font-size: 0.9rem;
}

/* ----- Causas detectadas (grid) ----- */
.dd-causas-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.7rem;
}

.dd-causa {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    background: #f8fafc;
    border-left: 4px solid #94a3b8;
}

.dd-causa.is-reactivadas { border-left-color: #f59e0b; background: #fffbeb; }
.dd-causa.is-montadas    { border-left-color: #0ea5e9; background: #f0f9ff; }
.dd-causa.is-trasladadas { border-left-color: #6366f1; background: #eef2ff; }

.dd-causa-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.dd-causa-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
}

.dd-causa.is-reactivadas .dd-causa-icon { color: #f59e0b; }
.dd-causa.is-montadas    .dd-causa-icon { color: #0ea5e9; }
.dd-causa.is-trasladadas .dd-causa-icon { color: #6366f1; }

.dd-causa-titulo {
    font-weight: 700;
    color: #0f172a;
    flex: 1;
}

.dd-causa-impacto {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    font-size: 1.05rem;
    color: #0f172a;
}

.dd-causa.is-reactivadas .dd-causa-impacto { color: #b45309; }
.dd-causa.is-montadas    .dd-causa-impacto { color: #0369a1; }
.dd-causa.is-trasladadas .dd-causa-impacto { color: #4338ca; }

.dd-causa-meta {
    margin-bottom: 0.45rem;
    font-size: 0.78rem;
}

.dd-causa-desc {
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.45;
}

/* ----- Tabla genérica ----- */
.dd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.dd-table thead th {
    background: #f1f5f9;
    color: #1e293b;
    padding: 0.5rem 0.7rem;
    font-weight: 700;
    text-align: left;
    border-bottom: 2px solid #cbd5e1;
}

.dd-table thead th.text-end { text-align: right; }

.dd-table tbody td {
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
}

.dd-table tbody td.text-end {
    text-align: right;
    font-family: 'Roboto Mono', monospace;
}

.dd-table tbody tr:hover {
    background: #f8fafc;
}

.dd-table .dd-row-cambio {
    background: #fffbeb;
}

.dd-table .dd-row-cambio:hover { background: #fef3c7; }

.dd-table.is-reactivadas tbody tr { background: #fffbeb20; }
.dd-table.is-montadas    tbody tr { background: #f0f9ff20; }
.dd-table.is-trasladadas tbody tr { background: #eef2ff20; }

.dd-lista-desc {
    color: #64748b;
    font-size: 0.83rem;
    margin-bottom: 0.55rem;
    line-height: 1.4;
}

/* ----- Botón Investigar (en otros modales) ----- */
.btn-dd-investigar {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-dd-investigar:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.35);
}

.btn-dd-investigar:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .dd-cuadre { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
    .dd-cuadre-val { font-size: 1.3rem; }
    .dd-causa-head { flex-wrap: wrap; }
}
