/*
 * 02-edccomuviv01-reporte-matriz-foundation.css
 * TKT-EDC-REPORTE-MATRIZ — Estilos del Informe Matricial por Vivienda
 * 2026-06-17
 */

/* ── Spinner inicial ─────────────────────────────────────────────────────── */
.edcm-rm-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: #6213e2;
}

/* ── Separador de concepto (legacy — ya no se usa en HTML) ──────────────── */
.edcm-rm-sep-concepto {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6213e2;
    background: #f5f0ff;
    border-left: 4px solid #6213e2;
    padding: 6px 12px;
    margin-top: 20px;
    margin-bottom: 4px;
    border-radius: 0 4px 4px 0;
}
.edcm-rm-sep-concepto:first-child {
    margin-top: 0;
}

/* ── Encabezado H1/H2/H3 del concepto (idéntico a Excel/PDF, sin centrado) ─ */
.edcm-rm-concepto-header {
    margin-top: 24px;
    margin-bottom: 6px;
    padding: 8px 0 4px 0;
    border-bottom: 2px solid #6213e2;
}
.edcm-rm-concepto-header:first-child { margin-top: 0; }
.edcm-rm-h1 {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}
.edcm-rm-h2 {
    font-size: 14px;
    font-weight: 400;
    color: #1a1a2e;
    line-height: 1.3;
}
.edcm-rm-h3 {
    font-size: 14px;
    font-weight: 400;
    color: #444;
    line-height: 1.3;
    margin-top: 2px;
}

/* ── Tabla principal ─────────────────────────────────────────────────────── */
.edcm-rm-tabla {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
    border: 1px solid #dee2e6;
}
.edcm-rm-tabla thead th {
    background: #6213e2;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    padding: 5px 8px;
    border: 1px solid #5010c4;
    white-space: nowrap;
    vertical-align: middle;
}
.edcm-rm-tabla tbody tr:nth-child(odd) {
    background: #fff;
}
.edcm-rm-tabla tbody tr:nth-child(even) {
    background: #fafafa;
}
.edcm-rm-tabla tbody tr:hover {
    background: #f0ebff;
}
.edcm-rm-tabla tbody td {
    padding: 4px 8px;
    border: 1px solid #dee2e6;
    vertical-align: middle;
}
.edcm-rm-tabla tfoot td {
    background: #f1f1f1;
    font-weight: 700;
    padding: 5px 8px;
    border: 1px solid #dee2e6;
    border-top: 2px solid #6213e2;
}

/* ── Montos ──────────────────────────────────────────────────────────────── */
.edcm-rm-monto {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.edcm-rm-monto-cargo {
    color: #212529;
}
.edcm-rm-monto-abono {
    color: #198754;
}
.edcm-rm-saldo-neg {
    color: #dc3545;
    font-weight: 600;
}

/* ── Fila de encabezado de agrupador — F6 cortePorAgrupador ─────────────── */
.edcm-rm-agrupador-header td {
    background: #e8e8f4;
    color: #28286e;
    font-weight: 700;
    font-style: italic;
    font-size: 12px;
    padding: 5px 8px;
    border-top: 2px solid #c8c8e8;
}

/* ── Secciones de notas footer (TKT-EDC-RM-NOTAS-FOOTER) ────────────────── */
.edcm-rm-notas-seccion {
    border: 1px solid #e2d6fa;
    border-radius: 5px;
    background: #fbf9ff;
    padding: 8px 12px 10px;
    margin: 4px 0 12px;
}
.edcm-rm-notas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.edcm-rm-notas-titulo {
    font-size: 12px;
    font-weight: 700;
    color: #6213e2;
    letter-spacing: 0.2px;
}
.edcm-rm-btn-add-nota {
    font-size: 11px;
    padding: 2px 8px;
    color: #6213e2;
    border-color: #c9b8f5;
}
.edcm-rm-btn-add-nota:hover {
    background: #f0e8ff;
}
.edcm-rm-notas-lista {
    margin: 0 0 0 4px;
    padding: 0 0 0 20px;
    list-style: decimal;
}
.edcm-rm-nota-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 0;
    font-size: 12px;
    color: #343a40;
    border-bottom: 1px dotted #e2d6fa;
}
.edcm-rm-nota-item:last-child { border-bottom: none; }
.edcm-rm-nota-texto {
    flex: 1;
    line-height: 1.45;
}
.edcm-rm-nota-acciones {
    white-space: nowrap;
    flex-shrink: 0;
}
.edcm-rm-btn-edit-nota,
.edcm-rm-btn-del-nota {
    padding: 0 4px;
    font-size: 11px;
    line-height: 1.3;
    color: #6c757d;
    text-decoration: none;
}
.edcm-rm-btn-edit-nota:hover { color: #6213e2; }
.edcm-rm-btn-del-nota:hover  { color: #dc3545; }
.edcm-rm-notas-empty {
    font-size: 11px;
    color: #adb5bd;
    margin: 0;
    font-style: italic;
}
/* Editor inline de nota */
.edcm-rm-nota-editor {
    margin: 6px 0 4px;
    padding: 8px;
    background: #f8f5ff;
    border: 1px solid #c9b8f5;
    border-radius: 4px;
}
.edcm-rm-nota-ta {
    width: 100%;
    resize: vertical;
    font-size: 12px;
    margin-bottom: 6px;
}
.edcm-rm-nota-editor-btns {
    display: flex;
    gap: 6px;
}

/* ════════════════════════════════════════════════════════════════════════════
 * MODAL CONFIGURADOR ⚙️ — F1/F2/F3/F4/F5/F6
 * ════════════════════════════════════════════════════════════════════════════ */

/* Fila de opciones generales (cortePorAgrupador) */
.edcm-rm-cfg-option-row {
    margin-bottom: 14px;
    padding: 8px 10px;
    background: #f8f5ff;
    border-radius: 4px;
    border: 1px solid #e2d9f3;
}
.edcm-rm-cfg-check-label {
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    color: #212529;
}
.edcm-rm-cfg-check-label input[type="checkbox"] {
    accent-color: #6213e2;
    cursor: pointer;
}

/* Sección de concepto */
.edcm-rm-cfg-concepto {
    margin-bottom: 18px;
}
.edcm-rm-cfg-concepto-titulo {
    font-size: 12px;
    font-weight: 600;
    color: #6213e2;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 2px solid #e2d9f3;
}

/* Tabla del configurador */
.edcm-rm-cfg-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 6px;
}
.edcm-rm-cfg-tabla thead th {
    background: #f1ecfc;
    color: #495057;
    font-weight: 600;
    padding: 5px 8px;
    border-bottom: 1px solid #d8cff0;
    white-space: nowrap;
}
.edcm-rm-cfg-tabla tbody tr {
    border-bottom: 1px solid #f0edf8;
    cursor: default;
}
.edcm-rm-cfg-tabla tbody tr:hover {
    background: #f8f5ff;
}
.edcm-rm-cfg-tabla tbody td {
    padding: 5px 8px;
    vertical-align: middle;
}
.edcm-rm-cfg-tabla tfoot td {
    padding: 6px 4px;
}

/* Handle de drag */
.rm-cfg-drag-handle {
    cursor: grab;
    color: #adb5bd;
    font-size: 14px;
    user-select: none;
    padding: 4px 6px !important;
}
.rm-cfg-drag-handle:active { cursor: grabbing; }

/* Fila seleccionada (para crear calc) */
.edcm-rm-cfg-fila-sel {
    background: #ede8fb !important;
    outline: 1px solid #6213e2;
}
.edcm-rm-cfg-fila-moneda { cursor: pointer; }
.edcm-rm-cfg-fila-calc   { font-style: italic; color: #495057; }
.edcm-rm-cfg-fila-base   { color: #6c757d; }

/* Badge de operación en columnas calculadas */
.edcm-rm-cfg-calc-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 10px;
    background: #e2d9f3;
    color: #6213e2;
    text-transform: uppercase;
}

/* Badges de naturaleza CA (Cargo) / AB (Abono) en el configurador */
.edcm-rm-cfg-nat-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: middle;
    letter-spacing: 0.02em;
}
.edcm-rm-cfg-nat-ca {
    background: #28286e;
    color: #fff;
}
.edcm-rm-cfg-nat-ab {
    background: #198754;
    color: #fff;
}

/* Label editable inline */
.edcm-rm-cfg-label-span {
    cursor: text;
    display: block;
    padding: 1px 2px;
    border-radius: 2px;
    border: 1px solid transparent;
    transition: border-color 0.15s;
}
.edcm-rm-cfg-label-span:hover {
    border-color: #c9b8f5;
    background: #faf8ff;
}
.edcm-rm-cfg-label-input {
    font-size: 12px;
    padding: 1px 4px;
    border: 1px solid #6213e2;
    border-radius: 2px;
    outline: none;
    width: 100%;
}

/* Select de operación (suma/promedio) */
.edcm-rm-cfg-sel-op {
    font-size: 12px;
    padding: 2px 6px;
    border: 1px solid #c9b8f5;
    border-radius: 3px;
    color: #212529;
}

/* Lista de campos desactivados */
.edcm-rm-cfg-inactivos {
    margin-top: 4px;
    margin-bottom: 4px;
}
.edcm-rm-cfg-inactivos-label {
    font-size: 11px;
    color: #6c757d;
    margin-bottom: 4px;
}
.edcm-rm-cfg-inactivos-lista {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 28px;
    padding: 4px 6px;
    border: 1px dashed #d8cff0;
    border-radius: 4px;
    background: #fdfcff;
}
.edcm-rm-cfg-inact-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    font-size: 11px;
    border-radius: 12px;
    background: #f1ecfc;
    color: #6c757d;
    cursor: pointer;
    border: 1px solid #d8cff0;
    transition: background 0.12s;
}
.edcm-rm-cfg-inact-item:hover {
    background: #e2d9f3;
    color: #212529;
}
/* Item obsoleto — sin cursor pointer, borde y fondo de advertencia */
.edcm-rm-cfg-inact-obsoleta {
    background: #fff8e1;
    border-color: #f0b429;
    color: #7a5500;
    cursor: default;
}
.edcm-rm-cfg-inact-obsoleta:hover {
    background: #fff3cd;
    color: #5c3d00;
}
/* Badge dentro del item obsoleto */
.edcm-rm-cfg-badge-obsoleta {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    background: #f0b429;
    color: #fff;
    white-space: nowrap;
    line-height: 1.4;
}
.edcm-rm-cfg-inact-empty {
    font-size: 11px;
    color: #adb5bd;
    font-style: italic;
    align-self: center;
}

/* ── Panel de análisis de diff de metadata ───────────────────────────────── */
.edcm-rm-diff-intro {
    font-size: 13px;
    color: #495057;
    margin-bottom: 12px;
}
.edcm-rm-diff-seccion {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 5px;
    border-left: 3px solid #dee2e6;
    background: #f8f9fa;
}
.edcm-rm-diff-nuevas        { border-left-color: #198754; background: #f0faf4; }
.edcm-rm-diff-obsoletas-calculo { border-left-color: #f0b429; background: #fff8e1; }
.edcm-rm-diff-obsoletas-libres  { border-left-color: #dc3545; background: #fdf2f2; }
.edcm-rm-diff-sin-cambio    { border-left-color: #0d6efd; background: #f0f5ff; }
.edcm-rm-diff-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 10px;
    margin-bottom: 4px;
}
.edcm-rm-diff-badge-nueva     { background: #d1e7dd; color: #0a3622; }
.edcm-rm-diff-badge-obsoleta  { background: #fff3cd; color: #664d03; }
.edcm-rm-diff-badge-eliminada { background: #f8d7da; color: #58151c; }
.edcm-rm-diff-badge-ok        { background: #cfe2ff; color: #084298; }
.edcm-rm-diff-nota {
    font-size: 11px;
    color: #6c757d;
    margin: 2px 0 5px;
}
.edcm-rm-diff-seccion ul {
    margin: 3px 0 0 16px;
    padding: 0;
    font-size: 12px;
}
.edcm-rm-diff-acciones {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}
/* Contenedor principal del aviso */
.edcm-rm-diff-aviso {
    border: 1px solid #f0b429;
    border-radius: 6px;
    background: #fffbf0;
    padding: 16px 20px;
    margin: 8px 0;
}
.edcm-rm-diff-aviso h6 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #7a5500;
}

/* Botón pequeño agregar calculada */
.btn-xs {
    padding: 2px 8px;
    font-size: 11px;
    line-height: 1.4;
}

/* Leyenda de advertencia en configurador — saldo oficial inamovible */
.edcm-rm-cfg-aviso-saldo {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fff8e1;
    border-left: 4px solid #f0b429;
    border-radius: 0 6px 6px 0;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 12px;
    color: #5a4200;
    line-height: 1.5;
}
.edcm-rm-cfg-aviso-saldo .fa {
    margin-top: 2px;
    color: #c87800;
    flex-shrink: 0;
}
