/* ── Reset & base ── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    font-size: var(--fs-base);
    line-height: 1.55;
}

:root {
    --font-display:  'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-body:     'Inter', system-ui, -apple-system, sans-serif;
    --font-mono:     'JetBrains Mono', 'SF Mono', Menlo, monospace;

    --primary:       #252c4f;
    --primary-light: #1E293B;
    --accent:        #2563EB;
    --accent-light:  #EFF6FF;
    --accent-soft:   #3B82F6; /* variante más clara del accent: íconos, barras, tarjetas de acceso rápido */
    --surface:       #ffffff;
    --bg:            #F8FAFC;
    --border:        #E2E8F0;
    --border-dark:   #CBD5E1;
    --text:          #0F172A;
    --text-muted:    #64748B;
    --text-faint:    #94A3B8; /* gris terciario: "sin dato", inactivo */
    --row-alt:       #F8FAFC;
    --row-hover:     #F1F5F9;
    --success:       #059669;
    --success-bg:    #ECFDF5;
    --success-vivid: #10B981; /* puntos/indicadores chicos, más saturado que --success para que se vean a tamaño mínimo */
    --danger:        #DC2626;
    --danger-bg:     #FEF2F2;
    --danger-vivid:  #EF4444;
    --warning:       #D97706;
    --warning-bg:    #FFFBEB;
    --violet:        #6D28D9; /* identidad del régimen anterior (Ley 18.037 / IPS Corrientes) */
    --violet-bg:     #F3E8FF;
    --violet-border: #C4B5FD;
    --violet-soft:   #8B5CF6; /* variante más saturada, para bordes de tarjeta (paralelo a --accent-soft) */
    --shadow-sm:     0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-md:     0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg:     0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
    --radius-sm:     4px;
    --radius-md:     6px;
    --radius-lg:     10px;
    /* Escala tipográfica */
    --fs-xs:   10px;   /* micro: badges, íconos */
    --fs-sm:   11px;   /* secundario: labels uppercase, cabeceras tabla */
    --fs-base: 13px;   /* base: texto general, inputs, filas */
    --fs-md:   14px;   /* énfasis: valores destacados, totales */
    --fs-lg:   15px;   /* título: veredictos, headings */
}

body {
    background: var(--bg);
    color: var(--text);
    font-size: var(--fs-base);
    line-height: 1.55;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
header {
    background: #252c4f;
    padding: 0 16px;
    height: 48px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 2px 0 rgba(0,0,0,.08);
    flex-shrink: 0;
    position: relative;
    z-index: 60;
    overflow: visible;
}

.text-logo {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #ffffff;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ── Action bar & Nav Bar (Unified design in grey tones) ── */
.section-action {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: #f3f3f3;
    gap: 8px;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 16px;
    height: 46px;
    min-height: 46px;
    position: sticky;
    top: 48px;
    z-index: 40;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
    flex-wrap: nowrap !important;
    overflow: visible;
}

.section-action > * {
    flex-shrink: 0;
}

.tab-btn-group {
    display: flex;
    align-items: center;
    background: #e5e5e5;
    padding: 3px;
    border-radius: 8px;
    gap: 2px;
    border: 1px solid #d4d4d4;
    flex-shrink: 0;
}

.tab-btn,
.section-action .tab-btn,
.section-action .menu-item > .tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    padding: 0 12px;
    border-radius: 6px;
    color: #1e293b !important;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
    text-decoration: none;
    box-sizing: border-box;
    height: 28px;
    line-height: 28px;
    opacity: 1 !important;
}
.tab-btn svg,
.section-action .tab-btn svg {
    color: #334155 !important;
    stroke: currentColor !important;
    opacity: 1 !important;
    flex-shrink: 0;
}
.tab-btn:hover,
.section-action .tab-btn:hover {
    color: #0f172a !important;
    background: rgba(255, 255, 255, 0.65);
}
.tab-btn.active,
.tab-btn.tab-active,
.section-action .menu-item.open > .tab-btn {
    color: #0f172a !important;
    background: #FFFFFF !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.tab-btn.active svg,
.tab-btn.tab-active svg,
.section-action .menu-item.open > .tab-btn svg {
    color: #0f172a !important;
}
.tab-btn .tab-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 0 5px;
    border-radius: 100px;
    background: #a1a1aa;
    color: #FFFFFF;
    height: 16px;
    line-height: 16px;
    display: inline-flex;
    align-items: center;
}
.tab-btn.active .tab-badge {
    background: #e4e4e7;
    color: #2563eb;
}

.action-sep { 
    width: 1px; 
    height: 22px; 
    background: #d4d4d4; 
    margin: 0 4px; 
    align-self: center; 
    flex-shrink: 0; 
}

/* ── Botones de acción unificados ── */
.btn-action-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #252c4f;
    color: #FFFFFF !important;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 12px;
    padding: 0 14px;
    border-radius: 6px;
    border: 1px solid #1c223d;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all .15s ease;
    text-decoration: none;
    white-space: nowrap;
    height: 30px;
    line-height: 30px;
    box-sizing: border-box;
    flex-shrink: 0;
}
.btn-action-primary:hover {
    background: #313a68;
    border-color: #3b467d;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(15, 23, 42, 0.18);
}
.btn-action-primary:active {
    background: #1c223d;
    transform: translateY(0);
}

.btn-action-secondary {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #FFFFFF;
    color: #334155 !important;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 12px;
    padding: 0 11px;
    border-radius: 6px;
    border: 1px solid #CBD5E1;
    cursor: pointer;
    transition: all .15s ease;
    text-decoration: none;
    white-space: nowrap;
    height: 30px;
    line-height: 30px;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    flex-shrink: 0;
}
.btn-action-secondary:hover {
    background: #F8FAFC;
    border-color: #94A3B8;
    color: #0F172A !important;
}
.btn-action-secondary:active {
    transform: translateY(0);
}

.btn-action-danger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #FFFFFF;
    color: #DC2626 !important;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 12px;
    padding: 0 11px;
    border-radius: 6px;
    border: 1px solid #FECACA;
    cursor: pointer;
    transition: all .15s ease;
    text-decoration: none;
    white-space: nowrap;
    height: 30px;
    line-height: 30px;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    flex-shrink: 0;
}
.btn-action-danger:hover {
    background: #FEF2F2;
    border-color: #F87171;
    color: #B91C1C !important;
}
.btn-action-danger:active {
    transform: translateY(0);
}

/* Page title badge (módulos individuales) */
.page-title-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #FFFFFF;
    color: #0F172A;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 12px;
    padding: 0 11px;
    border-radius: 6px;
    border: 1px solid #CBD5E1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    white-space: nowrap;
    height: 30px;
    line-height: 30px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.button-action {
    cursor: pointer;
    padding: 0 12px;
    font-size: 12px;
    font-family: var(--font-display);
    font-weight: 600;
    color: #1e293b;
    background: transparent;
    border: none;
    border-radius: 6px;
    white-space: nowrap;
    height: 28px;
    line-height: 28px;
    transition: color .15s, background .15s, border-color .15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    gap: 6px;
    box-sizing: border-box;
    vertical-align: middle;
}

.button-action:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
}

.button-action:active {
    background: rgba(0, 0, 0, 0.12);
}

/* Variante sobre fondo (section-action) */
.section-action .button-action {
    color: #1e293b;
}
.section-action .button-action:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
}
.section-action .button-action:active {
    background: rgba(0, 0, 0, 0.12);
}

/* ── Atajos de teclado ── */
.kbd-hint {
    font-size: 9px;
    font-weight: 700;
    font-family: inherit;
    color: #333333;
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 3px;
    padding: 1px 4px;
    margin-left: 4px;
    letter-spacing: .3px;
    pointer-events: none;
    line-height: 1;
}
.dropdown-item .kbd-hint,
.report-actions .kbd-hint {
    margin-left: auto;
    color: var(--text-muted);
    background: var(--bg);
    border-color: var(--border);
    font-size: 9px;
}

/* ── Data sections ── */
.section-data {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 5px 12px;
    flex-shrink: 0;
}

.box-input-data {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex: 1 1 80px;
    min-width: 80px;
}

label {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}

.input_data,
select.input_data {
    border: 1.5px solid #CBD5E1;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    padding: 3px 8px;
    color: var(--text);
    background: var(--surface);
    transition: border-color .15s ease, box-shadow .15s ease;
    outline: none;
    width: 100%;
    height: 28px;
    box-sizing: border-box;
}

.input_data:hover,
select.input_data:hover {
    border-color: #94A3B8;
}

.input_data:focus,
select.input_data:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.section-data-double {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0;
    flex-shrink: 0;
}

.section-data-double > .section-data {
    border-bottom: none;
    border-right: 1px solid var(--border);
    flex: 1 1 auto;
}

/* Inputs numéricos pequeños (hijos) no crecen demasiado */
#hijos, #hijosadop, #hijosdisc, #hijosauh {
    max-width: 80px;
}

/* Inputs de edad: ancho razonable */
#edadactual, #edadsolicitud, #18años {
    max-width: 180px;
}

/* Número de determinación: un poco más ancho */
#numero_expediente {
    min-width: 140px;
}

/* Nombre: ocupa más espacio */
#nombre {
    min-width: 160px;
}

/* ── Cotizations section ── */
.section-cotizations {
    padding: 10px 14px;
    flex: 0 0 auto;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.table-scroll,
.dash-table-wrap {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.section-cotizations table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 12px;
    background: #FFFFFF;
    border: none;
}

/* Sticky thead (both header row + new-row stay pinned) */
.section-cotizations thead {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #F8FAFC;
}

/* Header row */
.section-cotizations thead tr:first-child {
    background: #F8FAFC;
    color: #475569;
    border: none;
}

.section-cotizations thead tr:first-child th {
    padding: 10px 8px;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #475569;
    background: #F8FAFC;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1.5px solid #E2E8F0;
    white-space: nowrap;
    text-align: left;
}

.section-cotizations thead tr:first-child th:first-child,
.section-cotizations thead tr:first-child th:nth-child(2) {
    text-align: center;
}

/* Checkbox in header and rows */
.section-cotizations thead tr:first-child th input[type="checkbox"],
.section-cotizations tbody tr td input[type="checkbox"] {
    accent-color: var(--accent);
    cursor: pointer;
    width: 15px;
    height: 15px;
}

/* New-row (data entry row) */
.section-cotizations thead tr.newrow {
    background: #FFFFFF;
    border-top: none;
    border-bottom: 1.5px solid #E2E8F0;
}

.section-cotizations thead tr.newrow td {
    padding: 4px 4px;
    background: #FFFFFF;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1.5px solid #E2E8F0;
    vertical-align: middle;
}

/* Body rows */
.section-cotizations tbody tr {
    background: #FFFFFF;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid #F1F5F9;
    transition: background .12s ease;
}

.section-cotizations tbody tr:nth-child(even) {
    background: #FAFCFF;
}

.section-cotizations tbody tr:hover {
    background: #F1F5F9 !important;
}

/* Fila en edición */
.section-cotizations tbody tr.editing,
.section-cotizations tbody tr:focus-within {
    background: #EFF6FF !important;
}

.section-cotizations tbody td {
    padding: 7px 8px;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid #F1F5F9;
    color: #1E293B;
    vertical-align: middle;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-body);
    font-size: 12px;
}

.section-cotizations tbody tr:last-child td {
    border-bottom: none;
}

.section-cotizations .td-num {
    text-align: center;
    font-family: var(--font-mono);
    font-weight: 600;
    color: #475569;
    font-size: 11.5px;
}

.section-cotizations .td-desde,
.section-cotizations .td-hasta {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: #334155;
}

.section-cotizations .td-razon {
    font-weight: 600;
    color: #0F172A;
}

.section-cotizations .td-caja {
    color: #475569;
    font-size: 11.5px;
}

.section-cotizations .td-tipo {
    color: #334155;
    font-size: 11.5px;
}

/* Columnas numéricas: centradas para lectura más rápida en columnas angostas */
.section-cotizations table th:nth-child(8),
.section-cotizations table td:nth-child(8),
.section-cotizations table th:nth-child(9),
.section-cotizations table td:nth-child(9),
.section-cotizations table th:nth-child(10),
.section-cotizations table td:nth-child(10),
.section-cotizations table th:nth-child(11),
.section-cotizations table td:nth-child(11),
.section-cotizations table th:nth-child(12),
.section-cotizations table td:nth-child(12) {
    text-align: center;
    font-family: var(--font-mono);
    font-weight: 600;
    color: #334155;
}
.section-cotizations .cell-input[type="number"] {
    text-align: center;
    font-family: var(--font-mono);
}

.section-cotizations .td-acciones {
    overflow: visible;
    white-space: nowrap;
    text-overflow: clip;
    padding: 3px 5px;
    text-align: right;
}

/* Acciones: botones alineados y refinados */
.section-cotizations .td-acciones .btn-row {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s ease;
    font-size: 12px;
    opacity: 0;
    transform: translateX(3px);
    margin-left: 2px;
    padding: 0;
    line-height: 1;
}

.section-cotizations .td-acciones .btn-row:hover {
    border-color: #94A3B8;
    background: #F8FAFC;
    color: #0F172A;
}

.section-cotizations .td-acciones .btn-row.btn-edit:hover {
    border-color: #BFDBFE;
    background: #EFF6FF;
    color: #2563EB;
}

.section-cotizations .td-acciones .btn-row.btn-delete:hover {
    border-color: #FECACA;
    background: #FEF2F2;
    color: #DC2626;
}

.section-cotizations .td-acciones .btn-row.btn-save {
    color: #059669;
    border-color: #A7F3D0;
}
.section-cotizations .td-acciones .btn-row.btn-save:hover {
    border-color: #059669;
    background: #ECFDF5;
}

.section-cotizations .td-acciones .btn-row.btn-cancel {
    color: #64748B;
}
.section-cotizations .td-acciones .btn-row.btn-cancel:hover {
    background: #F1F5F9;
    color: #1E293B;
}

.section-cotizations tbody tr:hover .td-acciones .btn-row,
.section-cotizations tbody tr:focus-within .td-acciones .btn-row,
.section-cotizations tbody tr.editing .td-acciones .btn-row {
    opacity: 1;
    transform: translateX(0);
}
.section-cotizations .td-acciones:not(:has(.btn-row)) {
    text-align: center;
    color: var(--text-muted);
}

/* Footer */
.section-cotizations tfoot tr {
    background: #F8FAFC;
    border-top: 1.5px solid #E2E8F0;
    font-weight: 700;
    color: #0F172A;
}

.section-cotizations tfoot td {
    padding: 9px 8px;
    border-top: 1.5px solid #E2E8F0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    color: #0F172A;
    font-family: var(--font-display);
    font-size: 11.5px;
    font-weight: 700;
}

.section-cotizations tfoot #totY,
.section-cotizations tfoot #totM,
.section-cotizations tfoot #totD {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 800;
    color: #0F172A;
    text-align: center;
}

/* Cell inputs (inside table) */
.cell-input,
select.cell-input {
    border: 1.5px solid #CBD5E1;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 12px;
    padding: 3px 6px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #FFFFFF;
    color: #0F172A;
    outline: none;
    height: 28px;
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

/* newrow header cells don't overflow */
thead tr.newrow td {
    overflow: hidden;
}

.cell-input:hover,
select.cell-input:hover {
    border-color: #94A3B8;
}

.cell-input:focus,
select.cell-input:focus {
    border-color: var(--accent);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Add-row button */
.btn.btn-success {
    cursor: pointer;
    padding: 4px 12px;
    font-size: 12px;
    font-family: var(--font-display);
    font-weight: 600;
    color: #047857;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    border-radius: 6px;
    line-height: 1.2;
    transition: background .15s, color .15s, box-shadow .15s;
    box-shadow: var(--shadow-sm);
}

.btn.btn-success:hover {
    background: #059669;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(5,150,105,.25);
}

/* La fila nueva se carga con Enter o al pasar a la siguiente fila */
.td-newrow-hint {
    text-align: right;
}
.newrow-hint {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 600;
    color: #64748B;
    background: #F8FAFC;
    border: 1px dashed #CBD5E1;
    border-radius: 6px;
    padding: 2px 6px;
    white-space: nowrap;
    cursor: default;
}

/* ── Results section ── */
.section-results {
    padding: 12px 16px;
    flex-shrink: 0;
    background: var(--bg);
    border-top: 1.5px solid var(--border);
}

/* ── Result viewer ── */
.rv-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: var(--fs-base);
}

/* Verdict banner */
.rv-verdict {
    padding: 12px 16px;
    border-radius: 8px;
    border: 1.5px solid transparent;
    border-left: 4px solid;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.rv-verdict.ok   { background: #ECFDF5; border-color: #A7F3D0; border-left: 4px solid #059669; }
.rv-verdict.fail { background: #FEF2F2; border-color: #FECACA; border-left: 4px solid #DC2626; }

.rv-verdict-title {
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: 800;
    letter-spacing: -.1px;
    line-height: 1.3;
}
.rv-verdict.ok   .rv-verdict-title { color: #065F46; }
.rv-verdict.fail .rv-verdict-title { color: #991B1B; }

.rv-verdict-sub {
    font-size: var(--fs-base);
    color: var(--text-muted);
    margin-top: 3px;
}

/* Requirement rows */
.rv-req {
    display: grid;
    grid-template-columns: 100px 1fr 1fr auto;
    align-items: center;
    gap: 3px 16px;
    padding: 10px 16px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-left: 4px solid var(--border-dark);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.rv-req.ok   { border-left-color: var(--success); }
.rv-req.fail { border-left-color: var(--danger); }

.rv-req-lbl {
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.rv-req-val {
    font-family: var(--font-mono);
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.rv-req-req {
    font-size: var(--fs-base);
    color: var(--text-muted);
}
.rv-req-status {
    font-family: var(--font-display);
    font-size: var(--fs-base);
    font-weight: 700;
    white-space: nowrap;
    text-align: right;
}
.rv-req-status.ok   { color: var(--success); }
.rv-req-status.fail { color: var(--danger); }

/* Detail row (legacy, no usado) */
.rv-detail {
    display: flex;
    flex-wrap: wrap;
    column-gap: 16px;
    row-gap: 2px;
    padding: 5px 12px;
    background: var(--row-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--fs-base);
    color: var(--text-muted);
    line-height: 1.65;
}
.rv-detail b { color: var(--text); font-weight: 600; }

/* ── Prorrateo + Caja otorgante lado a lado ── */
.rv-extras {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}
.rv-extras > * { flex: 1 1 0; min-width: 0; }

/* ── Summary panel dos columnas ── */
.rv-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1px;
    background: var(--border);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.rv-col {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    padding: 12px 18px;
}
.rv-col:first-child {
    border-right: none;
}
.rv-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #F1F5F9;
    font-size: var(--fs-base);
}
.rv-row:last-child { border-bottom: none; }
.rv-row-lbl {
    font-family: var(--font-display);
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.rv-row-val {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}
.rv-col-sep {
    border: none;
    border-top: 1px solid var(--border);
    margin: 6px 0;
}
.rv-row-total .rv-row-lbl {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--text);
}
.rv-row-total .rv-row-val {
    font-family: var(--font-mono);
    font-weight: 800;
    color: var(--accent);
    font-size: var(--fs-md);
}
.rv-row-status {
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    white-space: nowrap;
}
.rv-row-status.ok   { background: var(--success-bg); color: var(--success); border: 1px solid #A7F3D0; }
.rv-row-status.fail { background: var(--danger-bg);  color: var(--danger); border: 1px solid #FECACA; }
.rv-row-edad-val {
    font-family: var(--font-mono);
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

/* Notices */
.rv-notice {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: var(--fs-base);
    border: 1px solid transparent;
    border-left: 3px solid;
    line-height: 1.55;
}
.rv-notice.warn { background: var(--danger-bg);  border-color: rgba(239, 68, 68, 0.15); border-left: 3px solid var(--danger);  color: var(--danger); font-weight: 600; }
.rv-notice.info { background: #EEF6FF; border-color: rgba(47, 111, 235, 0.15); border-left: 3px solid var(--accent); color: #1E3A6E; }
.rv-notice.hint { background: #FEFCE8; border-color: rgba(202, 138, 4, 0.15); border-left: 3px solid #CA8A04; color: #713F12; }

/* Accordion (prorrateo / caja otorgante) */
.rv-xblock > summary {
    padding: 7px 14px;
    border-radius: 6px;
    font-family: var(--font-display);
    font-size: var(--fs-base);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    list-style: none;
    background: #F8FAFC;
    border: 1.5px solid var(--border);
    color: #1E293B;
    gap: 8px;
    transition: background .12s;
}
.rv-xblock > summary:hover {
    background: #F1F5F9;
}
.rv-xblock > summary::-webkit-details-marker { display: none; }
.rv-xblock[open] > summary { border-radius: 6px 6px 0 0; }
.rv-xblock-toggle { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 400; flex-shrink: 0; }

.rv-xblock-body {
    padding: 9px 14px;
    border-radius: 0 0 6px 6px;
    font-size: var(--fs-base);
    line-height: 1.7;
    background: #FFFFFF;
    border: 1.5px solid var(--border);
    border-top: none;
    color: var(--text);
}

/* Caja otorgante rows */
.rv-caja-hint {
    font-size: var(--fs-base);
    color: var(--text-muted);
    margin-bottom: 6px;
    line-height: 1.55;
}
.rv-caja-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
    font-size: var(--fs-base);
}
.rv-caja-row:last-child { border-bottom: none; }
.rv-caja-name  { flex: 1; color: var(--text); font-weight: 500; }
.rv-caja-det   { font-size: var(--fs-sm); color: var(--text-muted); }
.rv-caja-total { font-family: var(--font-mono); font-weight: 600; min-width: 80px; text-align: right; color: var(--text-muted); }
.rv-caja-row.winner .rv-caja-name  { font-family: var(--font-display); font-weight: 700; color: var(--accent); }
.rv-caja-row.winner .rv-caja-total { color: var(--accent); font-weight: 700; }

/* ── Meses en término (autónomo / monotributista) ── */
.badge-mterm {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 5px;
    vertical-align: middle;
    white-space: nowrap;
}
.mterm-wrap {
    margin-top: 3px;
}
.btn-mterm {
    font-size: 10px;
    padding: 3px 8px;
    background: var(--accent-light);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--primary);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    white-space: nowrap;
}
.btn-mterm:hover { background: var(--border); }

/* ── Dropdown SICA personalizado ── */
.sica-select-wrap {
    position: relative;
    display: block;
}
.sica-select-input {
    width: 100%;
    cursor: text;
}
.sica-select-panel {
    position: fixed;
    z-index: 9999;
    background: #fff;
    border: 1px solid var(--border-dark);
    border-radius: 5px;
    box-shadow: 0 6px 20px rgba(0,0,0,.18);
    max-height: 300px;
    overflow-y: auto;
    min-width: 300px;
    max-width: 460px;
}
.sica-select-item {
    padding: 6px 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f4fa;
}
.sica-select-item:last-child { border-bottom: none; }
.sica-select-item:hover,
.sica-select-item.is-highlighted {
    background: var(--accent-light);
}
.sica-select-item.is-selected {
    background: #e4edf8;
}
.sica-select-item.is-selected.is-highlighted {
    background: var(--accent-light);
}
.sica-select-name {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--text);
    white-space: normal;
}
.sica-select-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}
.sica-select-empty {
    padding: 10px;
    color: var(--text-muted);
    font-size: var(--fs-base);
    text-align: center;
}

/* ── Badge Código SICA ── */
.sica-badge {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 3px;
    font-size: 10px;
    line-height: 1.3;
}
.sica-badge-code {
    background: #e8f0fb;
    color: var(--primary);
    border: 1px solid #b0c4e0;
    border-radius: 3px;
    padding: 1px 5px;
    font-weight: 700;
    white-space: nowrap;
}
.sica-badge-norma {
    background: #f5f7fa;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 5px;
    white-space: nowrap;
}
.sica-chip {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
    background: #e8f0fb;
    border: 1px solid #b0c4e0;
    border-radius: 3px;
    padding: 1px 5px;
    margin-right: 5px;
    vertical-align: middle;
    white-space: nowrap;
    cursor: help;
}
/* IPS Corrientes usa un régimen distinto al SICA: color propio para
   distinguirlo de un vistazo en vez de mezclarse con las filas SICA. */
.sica-chip.ips-chip {
    color: var(--violet);
    background: var(--violet-bg);
    border-color: var(--violet-border);
}

/* Modal de selección de meses en término */
#mtermModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    align-items: center;
    justify-content: center;
    z-index: 9500;
    padding: 16px;
}
#mtermModal.mterm-open { display: flex; }
.mterm-box {
    background: var(--surface);
    border-radius: 8px;
    width: min(760px, 100%);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,.35);
    animation: sm-in .15s ease;
}
.mterm-hdr {
    background: var(--primary);
    color: #fff;
    padding: 11px 18px 10px;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
}
.mterm-hdr-title {
    font-size: var(--fs-base);
    font-weight: 700;
    letter-spacing: .2px;
}
.mterm-hdr-sub {
    font-size: 10px;
    opacity: .7;
    margin-top: 2px;
}
.mterm-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--accent-light);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.mterm-counter {
    margin-left: auto;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-muted);
}
.mterm-body {
    flex: 1;
    overflow: auto;
    padding: 12px 16px;
}
.mterm-table {
    border-collapse: separate;
    border-spacing: 2px;
    font-size: 10.5px;
}
.mterm-yhdr { width: 44px; }
.mterm-mhdr {
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 9.5px;
    text-transform: uppercase;
    padding: 3px 2px;
    width: 44px;
}
.mterm-year {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    padding-right: 6px;
    white-space: nowrap;
}
.mterm-cell {
    width: 44px;
    height: 28px;
    border-radius: 4px;
    background: #f0f4f8;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background .1s, border-color .1s;
}
.mterm-cell:hover { background: var(--row-hover); border-color: var(--accent); }
.mterm-cell.mterm-sel {
    background: #dcfce7;
    border-color: #16a34a;
}
.mterm-cell.mterm-sel:hover { background: #bbf7d0; }
.mterm-cell.mterm-out {
    background: transparent;
    border-color: transparent;
    cursor: default;
    pointer-events: none;
}
.mterm-ftr {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* ── Disabled inputs ── */
.input_data:disabled {
    background: #e9ecef;
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: var(--border);
}

/* ── Row action buttons ── */
.btn-row {
    cursor: pointer;
    padding: 3px 8px;
    font-size: var(--fs-base);
    border-radius: var(--radius-sm);
    border: 1.5px solid;
    line-height: 1.4;
    transition: background .15s, color .15s, box-shadow .15s, opacity .15s ease, transform .15s ease;
    margin: 0 1px;
    font-family: var(--font-display);
    font-weight: 600;
}

.btn-edit {
    color: var(--accent);
    background: var(--accent-light);
    border-color: #BFDBFE;
}

.btn-crm-row {
    color: #1E40AF;
    background: #EFF6FF;
    border-color: #BFDBFE;
    font-size: var(--fs-sm);
    font-weight: 700;
    letter-spacing: .3px;
    padding: 2px 6px;
}

.btn-crm-row:hover {
    background: #DBEAFE;
    border-color: #93C5FD;
}

.btn-edit:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-save {
    color: var(--success);
    background: var(--success-bg);
    border-color: #A7F3D0;
}

.btn-save:hover {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-delete,
.btn-cancel {
    color: var(--danger);
    background: var(--danger-bg);
    border-color: #FECACA;
}

.btn-delete:hover,
.btn-cancel:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

/* ── Personal Embarcado — filas con elevación D.L. 6395/46 ── */
tr[data-elevado="true"] .td-y,
tr[data-elevado="true"] .td-m {
    color: var(--accent);
    font-weight: 700;
}

tr[data-elevado="true"] .td-tipo {
    font-style: italic;
}

/* ── Dropdown menus ── */
.menu-item {
    position: relative;
    display: inline-flex;
    align-items: stretch;
}

.menu-trigger::after {
    content: ' ▾';
    font-size: 10px;
    opacity: .75;
    margin-left: 3px;
    color: inherit;
}

.menu-item.open > .menu-trigger::after {
    content: ' ▴';
}

.dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--surface);
    border: 1.5px solid var(--border);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
    min-width: 220px;
    z-index: 500;
    padding: 6px 4px;
    border-radius: 8px;
}

.menu-item.open > .dropdown {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 12px;
    font-size: 12px;
    font-family: var(--font-display);
    font-weight: 500;
    color: #1E293B;
    background: transparent;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
    transition: background .12s ease, color .12s ease;
}

.dropdown-item:hover {
    background: #EFF6FF;
    color: var(--accent);
}

.dropdown-sep {
    margin: 4px 0;
    border: none;
    border-top: 1px solid var(--border);
}

/* ── Estado vacío compartido (mismo tono amigable en toda la app: ícono +
   título, en vez de un simple texto plano de instrucciones) ── */
.empty-state { text-align: center; padding: 60px 32px; color: var(--text-muted); }
.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state-hint { font-size: var(--fs-sm); color: var(--text-muted); }
/* Variante compacta, para usar dentro de una tarjeta chica en vez de una
   página/panel entero (ej. el resultado vacío de un formulario de cálculo). */
.empty-state.compact { padding: 18px 12px; }
.empty-state.compact .empty-state-icon { font-size: 26px; margin-bottom: 6px; }
.empty-state.compact .empty-state-title { font-size: var(--fs-base); }

/* ── Shared header nav ─────────────────────────────────────────────────── */

.hdr-nav {
    display: flex;
    align-items: center;
    gap: 1px;
    margin-left: 14px;
}

.hdr-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: var(--fs-base);
    font-weight: 500;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    border-radius: 5px;
    transition: background .12s, color .12s;
    white-space: nowrap;
    letter-spacing: .15px;
}

.hdr-nav-link:hover {
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.9);
}

.hdr-nav-link.hdr-nav-active {
    background: rgba(255,255,255,.14);
    color: #fff;
    font-weight: 600;
}

/* .menu-trigger normalmente se combina con .button-action (que ya resetea
   los estilos nativos de <button>); en el nav se combina con .hdr-nav-link,
   que está pensado para <a>, así que hace falta el reset acá. */
.hdr-nav .menu-trigger {
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
}

.hdr-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hdr-email {
    color: rgba(255,255,255,.7);
    font-size: 11px;
    max-width: 160px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ── Logout button ── */
.btn-logout {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,.82);
    background: rgba(180,50,50,.18);
    border: 1px solid rgba(210,80,80,.35);
    border-radius: 4px;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    font-family: inherit;
    letter-spacing: .2px;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-logout:hover {
    background: rgba(200,55,55,.38);
    border-color: rgba(230,90,90,.65);
    color: #fff;
    box-shadow: 0 2px 8px rgba(180,40,40,.25);
}
.btn-logout:active {
    background: rgba(160,40,40,.45);
}

/* ── Auth loading overlay & centered modal ── */
#authOverlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

@keyframes authModalPop {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.auth-modal {
    background: #FFFFFF;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.05);
    width: 100%;
    max-width: 360px;
    padding: 32px 28px 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: authModalPop .28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    overflow: hidden;
}

.auth-modal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563EB, #60A5FA);
}

.auth-modal-logo {
    width: 48px;
    height: 48px;
    background: #EFF6FF;
    border: 1px solid #DBEAFE;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
}

.auth-modal-brand {
    font-family: var(--font-display, 'Plus Jakarta Sans', system-ui, sans-serif);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 3px;
    color: #0F172A;
    text-transform: uppercase;
    line-height: 1.2;
}

.auth-modal-sub {
    font-size: 10px;
    font-weight: 700;
    color: #64748B;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 3px;
    margin-bottom: 18px;
}

.auth-modal-spinner-wrap {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes pv-spin {
    to { transform: rotate(360deg); }
}

.auth-spinner,
.auth-modal-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3.5px solid #E2E8F0;
    border-top-color: #2563EB;
    border-right-color: #3B82F6;
    animation: pv-spin .75s linear infinite;
}

.auth-modal-title {
    font-family: var(--font-display, 'Plus Jakarta Sans', system-ui, sans-serif);
    font-size: 14px;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 4px;
}

.auth-modal-desc {
    font-size: 12px;
    color: #64748B;
    line-height: 1.45;
}

/* ── Spinner chico, para usar inline en botones/estados de carga ── */
.spinner-sm {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    opacity: .75;
    animation: pv-spin .7s linear infinite;
    vertical-align: -2px;
    margin-right: 6px;
    flex-shrink: 0;
}

/* ── Trial toast (bottom-left, closeable) ── */
@keyframes toast-slide-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.trial-toast-inner {
    position: relative;
    background: var(--surface);
    border: 1px solid #fed7aa;
    border-left: 4px solid #f97316;
    border-radius: 8px;
    padding: 14px 16px 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,.14);
    min-width: 210px;
    animation: toast-slide-in .3s ease-out;
}

.trial-toast-close {
    position: absolute;
    top: 7px; right: 9px;
    background: none; border: none;
    color: var(--text-muted);
    font-size: 18px; line-height: 1;
    cursor: pointer; padding: 0;
    font-family: inherit;
    transition: color .15s;
}
.trial-toast-close:hover { color: var(--text); }

.trial-toast-header {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 5px;
}
.trial-toast-icon  { font-size: 14px; }
.trial-toast-title { font-size: var(--fs-base); font-weight: 700; color: #c2410c; }

.trial-toast-body {
    font-size: var(--fs-base); color: var(--text-muted);
    margin-bottom: 10px; line-height: 1.4;
}

.trial-toast-cta {
    display: block; text-align: center;
    padding: 6px 12px;
    background: #f97316; color: #fff;
    border-radius: 4px;
    font-size: 11px; font-weight: 700;
    text-decoration: none;
    transition: background .15s;
}
.trial-toast-cta:hover { background: #ea6a0e; }

/* ── Edición masiva — modal fields ── */
.em-field { display: flex; flex-direction: column; gap: 3px; }
.em-lbl   { font-size: 10px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .4px; }
.em-input {
    border: 1.5px solid var(--border); border-radius: 7px;
    font-size: 12px; padding: 5px 9px; outline: none;
    font-family: inherit; color: var(--text); background: #fff;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}
.em-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }

/* ── Superposición — filas en conflicto ── */
tr.sup-conflict {
    background: #fef9c3 !important;
    outline: 2px solid #eab308;
    outline-offset: -2px;
}
tr.sup-conflict:hover { background: #fef08a !important; }

/* ── Superposición — modal list items ── */
.sup-item {
    display: flex; flex-wrap: wrap; align-items: center; gap: 3px;
    font-size: 11px; padding: 3px 0;
    border-bottom: 1px solid #fca5a5; color: #7f1d1d;
}
.sup-item:last-child { border-bottom: none; }
.sup-num   { font-weight: 700; color: #dc2626; }
.sup-razon { font-weight: 600; }
.sup-dates { color: #64748b; font-size: 10px; }
.sup-arrow { color: #dc2626; font-weight: 700; margin: 0 3px; }

/* ── Superposición — botones de opciones ── */
.sup-opt-btn {
    padding: 9px 12px; color: #fff; border: none; border-radius: 8px;
    cursor: pointer; font-size: 12px; font-family: inherit;
    text-align: left; display: flex; flex-direction: column; gap: 2px;
}
.sup-opt-btn:hover { filter: brightness(1.1); }
.sup-opt-sub { font-size: 10px; font-weight: 400; opacity: .85; }

/* ── Notification bell ─────────────────────────────────────────────────── */
.notif-wrap {
    position: relative;
}

.notif-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 6px;
    color: rgba(255,255,255,.85);
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}
.notif-btn:hover { background: rgba(255,255,255,.2); }

.notif-badge {
    position: absolute;
    top: -5px; right: -5px;
    min-width: 16px; height: 16px;
    background: #ef4444;
    color: #fff;
    border-radius: 8px;
    font-size: 9px; font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 1.5px solid var(--primary);
    line-height: 1;
    pointer-events: none;
}

/* ── Notification panel ── */
.notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 300px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    z-index: 700;
    overflow: hidden;
}

.notif-panel-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--primary);
}
.notif-panel-title {
    font-size: var(--fs-base); font-weight: 700;
    color: #fff; letter-spacing: .3px;
}
.notif-markall {
    font-size: var(--fs-sm); color: rgba(255,255,255,.6);
    background: none; border: none;
    cursor: pointer; font-family: inherit; padding: 0;
    transition: color .15s;
}
.notif-markall:hover { color: #fff; }

.notif-list { max-height: 320px; overflow-y: auto; }

.notif-empty {
    padding: 28px 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Notification items ── */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .12s;
    position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--accent-light); }

.notif-item.unread { background: #f0f5ff; }
.notif-item.unread:hover { background: #e4edff; }
.notif-item.unread::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
}

.notif-item-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.notif-item-content { flex: 1; min-width: 0; }
.notif-item-title {
    font-size: 12px; font-weight: 700;
    color: var(--text); margin-bottom: 2px;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.notif-item-body {
    font-size: var(--fs-base); color: var(--text-muted);
    line-height: 1.55; margin-bottom: 3px;
}

/* ── Site Modal ── */
#siteModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
#siteModal.sm-open { display: flex; }
.sm-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 460px;
    width: 100%;
    overflow: hidden;
    animation: sm-in .15s ease;
    border: 1px solid var(--border);
}
@keyframes sm-in {
    from { opacity: 0; transform: scale(.96) translateY(-8px); }
    to   { opacity: 1; transform: scale(1)  translateY(0); }
}
.sm-header {
    background: var(--primary);
    padding: 14px 20px;
}
.sm-title {
    font-size: var(--fs-base);
    font-weight: 700;
    color: #fff;
    letter-spacing: .2px;
}
.sm-body {
    padding: 20px 20px 14px;
    font-size: 13px;
    color: var(--text);
    line-height: 1.65;
    word-break: break-word;
}
.sm-footer {
    padding: 0 20px 18px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.sm-btn {
    padding: 8px 22px;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, transform .1s, box-shadow .15s;
}
.sm-btn-ok {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59,130,246,.3);
}
.sm-btn-ok:hover  { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(59,130,246,.4); }
.sm-btn-ok:focus  { outline: 2px solid var(--accent); outline-offset: 2px; }
.sm-btn-cancel {
    background: var(--bg);
    color: var(--text-muted);
    border: 1.5px solid var(--border);
}
.sm-btn-cancel:hover { background: var(--border); color: var(--text); }
.sm-btn-cancel:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.notif-item-date { font-size: var(--fs-sm); color: var(--border-dark); }

/* ── Tab layout (wrapper con pestañas abajo) ── */
.tab-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ── Tab strip horizontal abajo ── */
.tab-strip {
    display: flex;
    flex-direction: row;
    background: #FFFFFF;
    flex-shrink: 0;
    width: 100%;
    height: 38px;
    border-top: 1.5px solid var(--border);
    border-right: none;
    padding: 0 16px;
    gap: 6px;
    align-items: stretch;
    justify-content: flex-start;
    order: 2;
    box-shadow: 0 -1px 3px rgba(15, 23, 42, 0.04);
    z-index: 20;
}
.tab-strip .tab-btn {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    width: auto;
    height: 100%;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-top: 2.5px solid transparent;
    border-left: none;
    cursor: pointer;
    font-family: var(--font-display);
    transition: all .15s ease-in-out;
    white-space: nowrap;
}
.tab-strip .tab-btn span {
    writing-mode: horizontal-tb;
    text-orientation: initial;
    font-size: 12px;
    letter-spacing: .3px;
    text-transform: none;
    font-weight: 600;
}
.tab-strip .tab-btn:hover {
    color: var(--text);
    background: #F8FAFC;
}
.tab-strip .tab-btn.tab-active {
    color: var(--accent);
    border-top-color: var(--accent);
    background: #EFF6FF;
    font-weight: 700;
}
.tab-strip .tab-btn.tab-active span {
    font-weight: 700;
    color: var(--accent);
}

/* ── Tab content area (solo dentro del tab-layout de determination) ── */
.tab-layout > .tab-content {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    order: 1;
}

/* ── Main panels ── */
.main-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* ── Planning panel ── */
.plan-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
    background: #f5f5f5;
}
.plan-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.plan-kpi-card {
    background: #ffffff;
    border: 1px solid #706f6f;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.plan-kpi-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #475569;
    margin-bottom: 4px;
}
.plan-kpi-val {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 800;
    color: #000000;
    line-height: 1.2;
}
.plan-kpi-sub {
    font-size: 11px;
    color: #64748B;
    margin-top: 4px;
}
.plan-section {
    background: #ffffff;
    border: 1px solid #706f6f;
    border-radius: 8px;
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.plan-section-hdr {
    background: #cecece;
    color: #000000;
    border-bottom: 1px solid #706f6f;
    padding: 9px 16px;
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
}
.plan-section-body {
    padding: 14px 16px;
    font-size: 12.5px;
    line-height: 1.6;
    color: #000000;
}
.plan-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}
.plan-row:last-child { border-bottom: none; }
.plan-label {
    font-family: var(--font-display);
    font-weight: 600;
    color: #1e293b;
    min-width: 220px;
    flex-shrink: 0;
}
.plan-val { font-family: var(--font-mono); font-weight: 700; color: #000000; text-align: right; }
.plan-ok   { color: #15803d; font-weight: 700; font-family: var(--font-display); }
.plan-warn { color: #b45309; font-weight: 700; font-family: var(--font-display); }
.plan-err  { color: #b91c1c; font-weight: 700; font-family: var(--font-display); }

.plan-highlight {
    background: #f8fafc;
    border: 1px solid #706f6f;
    border-radius: 7px;
    padding: 12px 14px;
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.65;
    color: #000000;
}
.plan-highlight.green {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}
.plan-highlight.yellow {
    background: #fefce8;
    border-color: #fde047;
    color: #854d0e;
}
.plan-highlight.red {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}
.plan-monto {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 800;
    color: #000000;
    letter-spacing: -.3px;
}

/* Tabla de cuotas de moratoria */
.plan-cuotas-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    border: 1px solid #706f6f;
    border-radius: 6px;
    overflow: hidden;
    font-size: 12px;
}
.plan-cuotas-table th {
    background: #cecece;
    color: #000000;
    font-weight: 700;
    padding: 6px 10px;
    text-align: left;
    border-right: 1px solid #706f6f;
    border-bottom: 1px solid #706f6f;
}
.plan-cuotas-table th:last-child { border-right: none; text-align: right; }
.plan-cuotas-table td {
    padding: 6px 10px;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    color: #000000;
}
.plan-cuotas-table td:last-child { border-right: none; text-align: right; font-family: var(--font-mono); font-weight: 700; }
.plan-cuotas-table tr:last-child td { border-bottom: none; }
.plan-cuotas-table tr:hover { background: #f1f5f9; }

/* ── Report preview panel ── */
.report-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.report-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: #cecece;
    border-bottom: 1px solid #706f6f;
    flex-shrink: 0;
    min-height: 32px;
}

.report-sheet-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 28px 20px;
    background: #334155;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.report-sheet {
    background: #ffffff;
    width: 210mm;
    min-height: 297mm;
    padding: 14mm 16mm;
    box-shadow: 0 8px 30px rgba(0,0,0,.35);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    color: #000000;
    line-height: 1.5;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* ══════════════════════════════════════════════
   REPORTE — DICTAMEN PREVISIONAL FORMAL
   ══════════════════════════════════════════════ */

/* ── Encabezado ── */
.rpt-hdr {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    padding-bottom: 8px;
    border-bottom: 2px solid #000000;
}
.rpt-logo {
    font-size: 14px;
    font-weight: 800;
    color: #000000;
    letter-spacing: .5px;
}
.rpt-subtitle {
    font-size: 10px;
    color: #333333;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.rpt-meta { text-align: right; }
.rpt-num  { font-size: 12px; font-weight: 800; color: #000000; }
.rpt-date { font-size: 10px; color: #333333; margin-top: 2px; }

.rpt-rule {
    border: none;
    border-top: 1px solid #706f6f;
    margin: 8px 0 12px;
}

/* ── Títulos de sección: negrita + barra de contraste ── */
.rpt-sec-title {
    font-size: 11px;
    font-weight: 700;
    color: #000000;
    background: #cecece;
    border: 1px solid #706f6f;
    padding: 4px 8px;
    margin-bottom: 6px;
    margin-top: 14px;
    display: block;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.rpt-sec-title:first-of-type { margin-top: 0; }

/* ── Datos del Solicitante ── */
.rpt-datos-grid {
    margin-bottom: 10px;
    border: 1px solid #706f6f;
    padding: 8px 10px;
    background: #fafafa;
}
.rpt-datos-row {
    display: flex;
    gap: 20px;
    padding: 3px 0;
    font-size: 11px;
    color: #000000;
}

/* ── Tabla Aportes ── */
.rpt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
    color: #000000;
    border: 1px solid #706f6f;
}
.rpt-table thead tr {
    background: #cecece;
    border-bottom: 1.5px solid #706f6f;
}
.rpt-table thead th {
    padding: 5px 6px;
    font-weight: 700;
    text-align: left;
    font-size: 10px;
    color: #000000;
    border-right: 1px solid #706f6f;
}
.rpt-table thead th:last-child { text-align: right; border-right: none; }
.rpt-table tbody tr { border-bottom: 1px solid #e2e8f0; }
.rpt-table tbody tr:nth-child(even) { background: #f8fafc; }
.rpt-table tbody td {
    padding: 4px 6px;
    color: #000000;
    border-right: 1px solid #e2e8f0;
}
.rpt-table tbody td:nth-child(1) { white-space: nowrap; }   /* Desde */
.rpt-table tbody td:nth-child(2) { white-space: nowrap; }   /* Hasta */
.rpt-table tbody td:last-child   { text-align: right; white-space: nowrap; border-right: none; } /* Duración */
.rpt-table tfoot tr {
    background: #cecece;
    border-top: 1.5px solid #706f6f;
}
.rpt-table tfoot td {
    padding: 5px 6px;
    font-weight: 700;
    color: #000000;
    border-right: 1px solid #706f6f;
}
.rpt-table tfoot td:last-child { text-align: right; white-space: nowrap; border-right: none; }

.rpt-empty {
    font-style: italic;
    color: #666666;
    font-size: 10px;
    padding: 6px 2px;
}

/* ── Resultado del cálculo ── */
.rpt-resultado {
    margin-top: 4px;
    margin-bottom: 4px;
    border: 1px solid #706f6f;
    padding: 8px 10px;
    background: #fafafa;
}
.rpt-edad-line {
    font-size: 11px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: #000000;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
}
.rpt-result-block {
    margin-left: auto;
    width: 100%;
    font-size: 11px;
}
.rrt-row {
    display: flex;
    justify-content: space-between;
    padding: 2.5px 0;
    gap: 8px;
    color: #000000;
    border-bottom: 1px dashed #e2e8f0;
}
.rrt-row:last-child { border-bottom: none; }
.rrl { color: #000000; font-weight: 500; }
.rrv { text-align: right; white-space: nowrap; color: #000000; font-family: monospace; font-weight: 700; }
.rrt-total {
    font-weight: 700;
    background: #f1f5f9;
    padding: 4px 6px;
    border-top: 1px solid #706f6f;
    border-bottom: 1px solid #706f6f;
    margin: 4px 0;
}

/* ── Dictamen y conclusión ── */
.rpt-dictamen-box {
    border: 1.5px solid #706f6f;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 8px;
    background: #ffffff;
}
.rpt-dictamen-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 10.5px;
    margin-bottom: 4px;
}
.rpt-dictamen-badge.cumple { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.rpt-dictamen-badge.nocumple { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Planificación Jubilatoria ── */
.rpt-plan-ok {
    font-size: 11px;
    color: #166534;
    font-weight: 600;
    margin: 4px 0 10px 0;
}
.rpt-plan-subsec { margin-bottom: 10px; }
.rpt-plan-subhdr {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #000000;
}
.rpt-plan-subsec p {
    font-size: 10.5px;
    margin: 3px 0;
    color: #000000;
    line-height: 1.5;
}

/* ── Observaciones y Firma ── */
.rpt-observaciones-box {
    margin-top: 10px;
    border: 1px solid #706f6f;
    padding: 8px 10px;
    background: #fafafa;
    min-height: 48px;
}
.rpt-observaciones-text {
    font-size: 10.5px;
    color: #000000;
    line-height: 1.5;
    outline: none;
}
.rpt-observaciones-text:focus {
    background: #ffffff;
}
.rpt-firmas-wrap {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 24px;
    padding-top: 10px;
}
.rpt-firma-box {
    width: 200px;
    text-align: center;
    border-top: 1px solid #000000;
    padding-top: 4px;
    font-size: 9.5px;
    color: #000000;
}

/* ── Pie / Disclaimer ── */
.rpt-footer {
    margin-top: 14px;
    border-top: 1px solid #706f6f;
    padding-top: 6px;
}
.rpt-condicion {
    font-size: 8.5px;
    color: #333333;
    margin: 0 0 4px 0;
    line-height: 1.35;
}
.rpt-disclaimer {
    font-size: 8px;
    color: #555555;
    font-style: italic;
    margin: 0;
    line-height: 1.35;
}

/* ── Compatibilidad: resultados clonados del screen ── */
.rpt-results { margin-top: 4px; }
.rpt-results .rv-wrap { gap: 6px; }

/* ── Buscador de casos guardados (barra superior) — compartido entre
   haber.html y determination.html ── */
.oculto { display: none !important; }
.caso-buscador { position: relative; width: 210px; margin: 0; flex-shrink: 0; }
.caso-buscador input {
    width: 100%; height: 30px; box-sizing: border-box;
    background: #FFFFFF; border: 1px solid #CBD5E1;
    border-radius: 6px; color: #0F172A;
    font-family: var(--font-display); font-size: 12px;
    padding: 0 26px 0 10px; outline: none;
    transition: all .15s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.caso-buscador input::placeholder { color: #64748B; font-weight: 500; }
.caso-buscador input:focus {
    border-color: #2563EB;
    background: #FFFFFF;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.caso-buscador-lista {
    position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; width: 320px;
    max-height: 280px; overflow-y: auto;
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: 10px; box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
}
.caso-buscador-item {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 12px; cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background .12s ease;
}
.caso-buscador-item:last-child { border-bottom: none; }
.caso-buscador-item:hover, .caso-buscador-item.activo { background: #EFF6FF; }
.caso-buscador-item .cb-nombre { font-size: 13px; font-weight: 600; color: #0F172A; }
.caso-buscador-item .cb-fila2 { display: flex; align-items: center; gap: 6px; }
.caso-buscador-item .cb-fecha { font-size: 10.5px; color: #64748B; }
.caso-buscador-item .cb-beneficio {
    font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
    color: #2563EB; background: #EFF6FF; border-radius: 4px; padding: 1px 6px;
}
.caso-buscador-vacio { padding: 14px 12px; font-size: 12px; color: #64748B; text-align: center; }
.caso-buscador-spinner { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #64748B; }

/* ── Impresión ── */
@media print {
    @page { margin: 14mm 16mm; }

    body {
        background: #fff !important;
        height: auto !important;
        overflow: visible !important;
        display: block !important;
        font-size: 11px !important;
        color: #000 !important;
    }

    /* Ocultar chrome de la UI */
    header,
    .section-action,
    .tab-strip,
    #authOverlay,
    #trialToast,
    #notifPanel,
    .notif-wrap,
    .report-actions {
        display: none !important;
    }

    /* Reporte: quitar el fondo oscuro y el scroll, mostrar hoja plana */
    .report-wrap,
    .report-sheet-wrap {
        background: none !important;
        padding: 0 !important;
        overflow: visible !important;
        display: block !important;
    }
    .report-sheet {
        width: auto !important;
        min-height: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    /* Liberar el panel activo; ocultar el inactivo (marcado por JS con print-hide) */
    .main-panel {
        display: block !important;
        overflow: visible !important;
        height: auto !important;
        min-height: 0 !important;
        flex: none !important;
    }

    .main-panel.print-hide { display: none !important; }

    /* ── Planificación: estilos limpios para papel ── */
    .plan-scroll {
        overflow: visible !important;
        background: none !important;
        flex: none !important;
    }

    .plan-section {
        background: none !important;
        border: none !important;
        border-top: 0.5pt solid #ccc !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin-bottom: 8px !important;
        page-break-inside: avoid;
    }

    .plan-section-hdr {
        background: none !important;
        color: #000 !important;
        border-bottom: none !important;
        text-decoration: underline !important;
        padding: 4px 0 !important;
        font-size: 10px !important;
        text-transform: none !important;
        letter-spacing: 0 !important;
        font-weight: 700 !important;
    }

    .plan-section-body {
        padding: 4px 0 !important;
        font-size: 10px !important;
    }

    .plan-row {
        border-bottom: 0.4pt solid #eee !important;
        padding: 2px 0 !important;
    }

    .plan-label { color: #333 !important; }

    .plan-highlight {
        background: none !important;
        border: none !important;
        border-left: none !important;
        border-radius: 0 !important;
        padding: 2px 0 !important;
        margin: 4px 0 !important;
        color: #000 !important;
    }

    .plan-highlight.green { }
    .plan-highlight.red   { }
    .plan-highlight.yellow{ }

    .plan-monto {
        font-size: 11px !important;
        color: #000 !important;
    }

    .plan-warn { color: #000 !important; }
    .plan-err  { color: #000 !important; }

    /* Formulario: aspecto limpio sin bordes ni sombras */
    .section-data,
    .section-data-double {
        background: none !important;
        box-shadow: none !important;
        border: none !important;
        padding: 4px 0 !important;
    }

    .box-input-data label:first-child {
        color: #666 !important;
        font-size: 9px !important;
        text-transform: uppercase !important;
    }

    .input_data {
        border: none !important;
        border-bottom: 0.5pt solid #bbb !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 1px 0 !important;
        color: #000 !important;
        -webkit-appearance: none;
        appearance: none;
    }

    /* Tabla: ocultar fila de ingreso y columnas de interfaz */
    .newrow { display: none !important; }

    table th:nth-child(1),
    table td:nth-child(1),
    table th:last-child,
    table td:last-child {
        display: none !important;
    }

    /* Liberar scroll de la tabla */
    .section-cotizations {
        overflow: visible !important;
        border: none !important;
        flex: none !important;
    }

    .table-scroll {
        overflow: visible !important;
    }

    table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 9px !important;
        page-break-inside: auto;
    }

    table thead th {
        background: none !important;
        color: #000 !important;
        border-top: none !important;
        border-bottom: 1pt solid #333 !important;
        border-left: none !important;
        border-right: none !important;
        padding: 3px 5px !important;
        font-weight: bold !important;
    }

    table tbody td {
        background: none !important;
        border: none !important;
        border-bottom: 0.4pt solid #ddd !important;
        padding: 2px 5px !important;
        color: #000 !important;
    }

    table tbody tr:last-child td { border-bottom: none !important; }

    table tfoot td {
        background: none !important;
        border-top: 1pt solid #333 !important;
        border-bottom: none !important;
        padding: 3px 5px !important;
        font-weight: bold !important;
        color: #000 !important;
    }

    /* Resultados: sin fondo, con separador superior */
    .section-results {
        height: auto !important;
        overflow: visible !important;
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        border-top: 1pt solid #ccc !important;
        padding: 8px 0 !important;
        margin-top: 6px !important;
        color: #000 !important;
        page-break-inside: avoid;
    }

    /* Force color fidelity */
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

    /* Result viewer: estructurado para papel */
    .rv-wrap { gap: 3px !important; }

    .rv-verdict {
        border-radius: 0 !important;
        border-left-width: 4pt !important;
        padding: 7px 10px !important;
    }
    .rv-verdict.ok   { background: #f0fdf4 !important; border-left-color: #16a34a !important; }
    .rv-verdict.fail { background: #fef2f2 !important; border-left-color: #dc2626 !important; }
    .rv-verdict.ok   .rv-verdict-title { color: #15803d !important; }
    .rv-verdict.fail .rv-verdict-title { color: #b91c1c !important; }
    .rv-verdict-sub  { color: #444 !important; }

    .rv-req {
        border-radius: 0 !important;
        border-left-width: 3pt !important;
        padding: 6px 10px !important;
        background: #fafafa !important;
    }
    .rv-req.ok   { border-left-color: #16a34a !important; }
    .rv-req.fail { border-left-color: #dc2626 !important; }
    .rv-req-lbl  { color: #555 !important; }
    .rv-req-val  { color: #000 !important; }
    .rv-req-req  { color: #444 !important; }
    .rv-req-status.ok   { color: #15803d !important; }
    .rv-req-status.fail { color: #b91c1c !important; }

    .rv-detail {
        background: #f4f4f4 !important;
        border-radius: 0 !important;
        padding: 5px 10px !important;
    }
    .rv-detail b { color: #000 !important; }

    .rv-notice {
        border-radius: 0 !important;
        padding: 5px 10px !important;
    }
    .rv-notice.warn {
        background: #fff5f5 !important;
        border-color: #dc2626 !important;
        color: #b91c1c !important;
    }
    .rv-notice.info {
        background: #eff6ff !important;
        border-color: #3b82f6 !important;
        color: #1e3a6e !important;
    }

    /* Acordeones: expandidos en impresión */
    .rv-xblock { border-radius: 0 !important; }
    .rv-xblock > summary {
        background: #f0f4f8 !important;
        border: none !important;
        border-bottom: 0.5pt solid #ccc !important;
        color: #1e2b4a !important;
        padding: 5px 10px !important;
    }
    .rv-xblock-toggle { display: none !important; }
    .rv-xblock-body {
        background: #fafafa !important;
        padding: 6px 10px !important;
        border: 0.5pt solid #ddd !important;
        border-top: none !important;
    }
    .rv-caja-row.winner .rv-caja-name  { color: #2B3F6C !important; }
    .rv-caja-row.winner .rv-caja-total { color: #2B3F6C !important; }

    /* ── Reporte panel: restaurar todas las columnas de la tabla ── */
    #reportContent table th:nth-child(1),
    #reportContent table td:nth-child(1),
    #reportContent table th:last-child,
    #reportContent table td:last-child {
        display: table-cell !important;
    }

    /* ── Reporte panel: anular colores de UI, todo negro/blanco ── */
    #reportContent * {
        color: #000 !important;
        background: none !important;
        border-color: #ccc !important;
        box-shadow: none !important;
        text-transform: none !important;
        letter-spacing: 0 !important;
    }
    #reportContent .rpt-sec-title {
        text-decoration: underline !important;
        font-weight: 700 !important;
        font-size: 11px !important;
        border: none !important;
        margin-top: 12px !important;
        margin-bottom: 5px !important;
    }
    #reportContent .rpt-rule {
        border-top: 1px solid #000 !important;
    }
    #reportContent .rpt-table thead tr { border-bottom: 1.5px solid #000 !important; }
    #reportContent .rpt-table tfoot tr { border-top: 1.5px solid #000 !important; }
    #reportContent .rpt-table td,
    #reportContent .rpt-table th {
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: normal !important;
        word-break: break-word;
    }
    #reportContent .rrt-total { text-decoration: underline !important; font-weight: 700 !important; }
    #reportContent .rpt-footer { border-top: 1px solid #000 !important; }
    /* Neutralizar resultados clonados de pantalla si aparecen */
    #reportContent .rv-verdict,
    #reportContent .rv-req    { border-left: none !important; border-radius: 0 !important; }
}