:root {
    --brand-cyan: #1AC0C4;
    --brand-purple: #47368C;
    --brand-white: #ffffff;
    --bg-soft: #f4f7ff;
    --text-main: #2e2d38;
}

body {
    background: linear-gradient(160deg, var(--bg-soft) 0%, #eef9f9 100%);
    color: var(--text-main);
    font-family: "Comfortaa", sans-serif;
    min-height: 100vh;
}

/* Evita que quede el scroll bloqueado si el modal de carga no limpia bien el estado (Bootstrap 5). */
body:not(.modal-open) {
    overflow: auto !important;
}

h1, h2, h3, h4, h5, h6, .btn, .status-pill {
    font-family: "Montserrat", sans-serif;
}

.app-shell {
    max-width: 1220px;
}

.hero-card,
.panel-card {
    background: var(--brand-white);
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(71, 54, 140, 0.1);
    border: 1px solid rgba(71, 54, 140, 0.08);
}

.hero-card {
    padding: 1.5rem 1.75rem;
    border-top: 6px solid var(--brand-cyan);
}

.eyebrow {
    color: var(--brand-cyan);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}

.hero-title {
    color: var(--brand-purple);
    font-size: clamp(1.4rem, 2vw, 2rem);
    font-weight: 700;
}

.hero-subtitle {
    color: #666;
    font-size: 0.95rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.status-ok {
    color: #126950;
    background: rgba(26, 192, 196, 0.18);
}

.status-bad {
    color: #8f1f1f;
    background: rgba(255, 98, 98, 0.14);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.section-title {
    color: var(--brand-purple);
    font-size: 1.05rem;
    font-weight: 700;
}

.sub-title {
    color: var(--brand-purple);
    font-size: 0.92rem;
    font-weight: 600;
}

.form-label {
    font-size: 0.88rem;
    color: #4a4760;
    margin-bottom: 0.4rem;
}

.form-control {
    border-radius: 12px;
    border-color: rgba(71, 54, 140, 0.2);
    font-size: 0.9rem;
    padding: 0.55rem 0.75rem;
}

.form-control:focus {
    border-color: var(--brand-cyan);
    box-shadow: 0 0 0 0.25rem rgba(26, 192, 196, 0.2);
}

.btn-brand-primary {
    background: linear-gradient(90deg, var(--brand-purple), #5947a4);
    color: var(--brand-white);
    border: none;
    border-radius: 12px;
    padding: 0.65rem 0.9rem;
    font-weight: 600;
}

.btn-brand-primary:hover {
    background: linear-gradient(90deg, #3f2f7e, #4b3d91);
    color: var(--brand-white);
}

.btn-outline-brand {
    border: 1px solid var(--brand-cyan);
    color: var(--brand-purple);
    border-radius: 12px;
    padding: 0.6rem 0.9rem;
    font-weight: 600;
}

.btn-outline-brand:hover {
    background: rgba(26, 192, 196, 0.12);
    color: var(--brand-purple);
}

.divider {
    border-color: rgba(71, 54, 140, 0.12);
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-list li {
    font-size: 0.86rem;
    padding: 0.38rem 0;
    border-bottom: 1px dashed rgba(71, 54, 140, 0.15);
}

.file-list li:last-child {
    border-bottom: 0;
}

.result-empty {
    border: 1px dashed rgba(71, 54, 140, 0.28);
    border-radius: 14px;
    padding: 1rem;
    color: #777;
    font-size: 0.92rem;
}

.result-ready {
    padding: 0;
}

/* Resumen formulario 350: mismo orden conceptual que el PDF, tablas compactas */
.resultado-form-350 {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.resultado-grupo-titulo {
    font-family: "Montserrat", sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--brand-purple);
    margin: 0 0 0.25rem 0;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid rgba(71, 54, 140, 0.15);
}

.resultado-tabla-wrap {
    border-radius: 10px;
    border: 1px solid rgba(71, 54, 140, 0.1);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.85);
}

.tabla-resultados-compacta {
    font-size: 0.78rem;
    --bs-table-bg: transparent;
}

.tabla-resultados-compacta thead th {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5c5878;
    font-weight: 700;
    padding: 0.35rem 0.5rem;
    background: rgba(26, 192, 196, 0.12);
    border-bottom: 1px solid rgba(71, 54, 140, 0.12);
    white-space: nowrap;
}

.tabla-resultados-compacta thead .th-cas {
    width: 2.6rem;
}

.tabla-resultados-compacta tbody td {
    padding: 0.32rem 0.5rem;
    vertical-align: middle;
    border-color: rgba(71, 54, 140, 0.08);
}

.tabla-resultados-compacta tbody tr:nth-child(even) {
    background: rgba(26, 192, 196, 0.05);
}

.tabla-resultados-compacta tbody tr.js-audit-casilla {
    cursor: pointer;
    transition: background 0.15s ease;
}

.tabla-resultados-compacta tbody tr.js-audit-casilla:hover {
    background: rgba(71, 54, 140, 0.1) !important;
}

.tabla-resultados-compacta tbody tr.js-audit-casilla:focus {
    outline: 2px solid var(--brand-cyan);
    outline-offset: -2px;
}

.audit-formula-bar {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 1px solid rgba(71, 54, 140, 0.2);
    border-radius: 8px;
    overflow: hidden;
    background: #f1f3f5;
    font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
    font-size: 0.78rem;
}

.audit-formula-fx {
    flex: 0 0 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e6ea;
    color: #5c5f66;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
}

.audit-formula-text {
    flex: 1;
    padding: 0.45rem 0.65rem;
    color: #1e1e24;
    line-height: 1.35;
    word-break: break-word;
}

.audit-spreadsheet-outer {
    border-radius: 10px;
    border: 1px solid rgba(71, 54, 140, 0.15);
    background: #fff;
}

.audit-spreadsheet-wrap {
    max-height: min(50vh, 380px);
    overflow: auto;
}

.audit-spreadsheet-table {
    border-collapse: separate;
    border-spacing: 0;
    font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
    font-size: 0.72rem;
}

.audit-spreadsheet-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #e8f4f4 !important;
    border: 1px solid rgba(71, 54, 140, 0.15);
    font-weight: 600;
    color: #3c3975;
    white-space: nowrap;
    padding: 0.35rem 0.5rem;
}

.audit-spreadsheet-table tbody td {
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.3rem 0.45rem;
    vertical-align: middle;
    background: #fff;
}

.audit-spreadsheet-table tbody tr:nth-child(even) td {
    background: #fafbff;
}

.audit-spreadsheet-foot td {
    border: 1px solid rgba(71, 54, 140, 0.2);
    background: #f0f7ff !important;
    font-weight: 700;
    color: #2a2550;
}

.audit-col-letter {
    display: block;
    font-size: 0.6rem;
    color: #888;
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.modal-audit-table-wrap {
    max-height: min(55vh, 420px);
    border-radius: 10px;
    border: 1px solid rgba(71, 54, 140, 0.12);
}

#modalAuditoriaTabla thead th {
    font-size: 0.72rem;
    white-space: nowrap;
}

#modalAuditoriaTabla tbody td {
    font-size: 0.8rem;
    vertical-align: middle;
}

.tabla-resultados-compacta .col-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--brand-purple);
    white-space: nowrap;
}

.tabla-resultados-compacta .col-num-exacto {
    font-weight: 600;
    color: #4a4760;
    font-size: 0.76rem;
}

.resultado-carga-id {
    padding-top: 0.35rem;
    margin-top: 0.15rem !important;
    border-top: 1px dashed rgba(71, 54, 140, 0.2);
}

.detail-table-wrap {
    max-height: 380px;
}

#detalleTabla thead th {
    position: sticky;
    top: 0;
    background: #e9fafa;
    color: #3c3975;
    font-size: 0.8rem;
}

#detalleTabla tbody td {
    font-size: 0.86rem;
}

#detalleTabla tbody td:nth-child(3),
#detalleTabla tbody td:nth-child(4) {
    text-align: right;
    font-weight: 700;
}

.guia-usuario-panel {
    background: rgba(26, 192, 196, 0.12) !important;
    color: var(--text-main);
    border-radius: 12px;
}

.modal-content {
    border-radius: 16px;
    border: none;
}

.spinner-border {
    color: var(--brand-cyan);
}

@media (max-width: 991px) {
    .tabla-resultados-compacta {
        font-size: 0.74rem;
    }
}


.btn-link-brand {
    border: 1px dashed rgba(71, 54, 140, 0.35);
    color: var(--brand-purple);
    border-radius: 12px;
    padding: 0.55rem 0.9rem;
    font-weight: 600;
    background: rgba(255,255,255,0.6);
}

.btn-link-brand:hover {
    background: rgba(71, 54, 140, 0.08);
    color: var(--brand-purple);
}

.reglas-wrap {
    max-height: 460px;
}

#tablaReglas thead th {
    position: sticky;
    top: 0;
    background: #efeefe;
    font-size: 0.77rem;
    white-space: nowrap;
}

#tablaReglas td {
    font-size: 0.8rem;
    vertical-align: middle;
}

.input-mini {
    min-width: 92px;
    font-size: 0.78rem;
    padding: 0.35rem 0.45rem;
    border-radius: 8px;
}

.input-mini-sm {
    width: 72px;
}
