:root {
    --brand-green: #76BC21;
    --brand-blue: #2C5697;
    --brand-gray: #54575A;
    --brand-cyan: var(--brand-green);
    --brand-purple: var(--brand-blue);
    --brand-white: #ffffff;
    --bg-soft: #F5F7FA;
    --text-main: #2B2E31;
}

body {
    background: var(--bg-soft);
    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;
}

/* ---- Navbar global (home / formularios / admin) ---- */
.app-topnav {
    background: #fff;
    border-bottom: 3px solid var(--brand-green);
    box-shadow: none;
    margin-bottom: 1.5rem;
}

.app-topnav-inner {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0.85rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1.25rem;
}

.app-topnav-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.app-topnav-logo {
    height: 36px;
    width: auto;
}

.app-topnav-by {
    height: 34px;
    width: auto;
}

.app-topnav-sep {
    width: 1px;
    height: 32px;
    background: #E3E8EE;
    flex-shrink: 0;
}

.app-topnav-navrow {
    border-top: 1px solid #EEF1F5;
}

.app-topnav-navrow .app-topnav-links {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 1rem;
}

.app-topnav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.app-topnav-link {
    font-family: "Montserrat", sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--brand-gray);
    text-decoration: none;
    padding: 0.85rem 0.75rem 0.65rem;
    border-radius: 0;
    border-bottom: 3px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.app-topnav-link:hover {
    color: var(--brand-blue);
    background: transparent;
}

.app-topnav-link.is-active {
    color: var(--brand-blue);
    background: transparent;
    border-bottom-color: var(--brand-blue);
}

.app-topnav-user {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.app-topnav-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-purple);
    color: #fff;
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-topnav-user-meta {
    line-height: 1.2;
}

.app-topnav-user-name {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-main);
}

.app-topnav-user-role {
    display: inline-block;
    margin-top: 0.25rem;
    font-family: "Montserrat", sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #3A6C10;
    background: #EEF7E3;
    border-radius: 6px;
    padding: 0.22rem 0.55rem;
    text-transform: uppercase;
}

.app-topnav-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
    border-radius: 10px;
    background: #fde8e8;
    color: #b42318;
    font-family: "Montserrat", sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
}

.app-topnav-logout:hover {
    background: #f9d2d2;
}

@media (max-width: 768px) {
    .app-topnav-inner {
        padding: 0.75rem;
    }

    .app-topnav-user-meta {
        display: none;
    }

    .app-topnav-link {
        font-size: 0.8rem;
        padding: 0.45rem 0.7rem;
    }
}

.page-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    max-width: 1220px;
    margin: 1.5rem auto 0;
    color: var(--brand-gray);
    font-size: 0.82rem;
    padding: 1rem 1rem 1.5rem;
    border-top: 1px solid #DDE3EA;
}

.page-footer-by img {
    height: 28px;
    width: auto;
    display: block;
}

/* Portada (Figma hoja 2) */
.page-home .app-topnav {
    margin-bottom: 0;
}

.home-main {
    padding-top: 2rem;
    padding-bottom: 2.5rem;
}

.page-home .home-hero,
.page-radian .home-hero,
.page-admin-panel .home-hero {
    margin-bottom: 2rem;
    background: var(--brand-blue);
    border-radius: 20px;
    padding: 2rem 2.25rem 1.85rem 2.4rem;
    position: relative;
    overflow: hidden;
}

.page-home .home-hero::before,
.page-radian .home-hero::before,
.page-admin-panel .home-hero::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--brand-green);
}

.page-home .eyebrow,
.page-radian .eyebrow,
.page-admin-panel .eyebrow {
    color: #C6E59A;
}

.page-home .hero-title,
.page-radian .hero-title,
.page-admin-panel .hero-title {
    color: #fff;
}

.page-home .home-hero-desc,
.page-radian .hero-subtitle,
.page-admin-panel .hero-subtitle {
    color: #DCE6F3;
}

.page-home .status-ok {
    background: #fff !important;
    color: #3A6C10 !important;
    border-color: #fff !important;
}

.home-hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-bottom: 0.85rem;
}

.home-hero-desc {
    max-width: 58rem;
    line-height: 1.55;
    color: #5c5a6a;
    font-size: 0.95rem;
}

.home-modules .module-card {
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(46, 45, 56, 0.07);
    border: 1px solid rgba(46, 45, 56, 0.05);
    padding: 1.5rem 1.4rem 1.35rem;
    gap: 0.65rem;
}

.home-modules .module-card-title {
    font-size: 1.15rem;
    line-height: 1.3;
    color: #2a2850;
}

.home-modules .module-card-desc {
    font-size: 0.88rem;
    line-height: 1.45;
    color: #6b6978;
}

.home-modules .btn-brand-primary {
    margin-top: 0.75rem;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    font-weight: 600;
    background: var(--brand-purple);
}

.home-modules .btn-brand-primary:hover {
    background: #23467c;
}

.module-card-tag {
    display: inline-block;
    font-family: "Montserrat", sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--brand-purple);
    background: rgba(44, 86, 151, 0.12);
    border-radius: 8px;
    padding: 0.32rem 0.6rem;
}

.module-card-freq {
    font-family: "Montserrat", sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--brand-cyan);
    text-transform: uppercase;
}

.module-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.module-card-icon {
    color: #8b8998;
    font-size: 1.2rem;
}

@media (max-width: 991.98px) {
    .home-modules .col-lg-4:last-child {
        margin-left: auto;
        margin-right: auto;
        max-width: 28rem;
    }
}

@media (max-width: 767.98px) {
    .home-hero-top {
        flex-direction: column;
    }

    .home-modules .col-lg-4:last-child {
        max-width: none;
    }
}

.hero-card,
.panel-card {
    background: var(--brand-white);
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(44, 86, 151, 0.1);
    border: 1px solid rgba(44, 86, 151, 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: #1a7a5c !important;
    background-color: #e8f7f0 !important;
    border: 1px solid #cfeee0 !important;
}

.status-ok .dot {
    background-color: #1a9a78 !important;
}

.status-bad {
    color: #721c24 !important;
    background-color: #f8d7da !important;
    border: 1px solid #f5c6cb !important;
}

.status-bad .dot {
    background-color: #dc3545 !important;
}

.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(44, 86, 151, 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(118, 188, 33, 0.2);
}

.btn-brand-primary {
    background: linear-gradient(90deg, var(--brand-purple), #3d6cb0);
    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, #1f4578, #3d6cb0);
    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(118, 188, 33, 0.12);
    color: var(--brand-purple);
}

.divider {
    border-color: rgba(44, 86, 151, 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(44, 86, 151, 0.15);
}

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

.result-empty {
    border: 1px dashed rgba(44, 86, 151, 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(44, 86, 151, 0.15);
}

.resultado-tabla-wrap {
    border-radius: 10px;
    border: 1px solid rgba(44, 86, 151, 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(118, 188, 33, 0.12);
    border-bottom: 1px solid rgba(44, 86, 151, 0.12);
    white-space: nowrap;
}


.status-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.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(44, 86, 151, 0.08);
}

.tabla-resultados-compacta tbody tr:nth-child(even) {
    background: rgba(118, 188, 33, 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(44, 86, 151, 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(44, 86, 151, 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(44, 86, 151, 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(44, 86, 151, 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(44, 86, 151, 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(44, 86, 151, 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(44, 86, 151, 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(118, 188, 33, 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(44, 86, 151, 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(44, 86, 151, 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 {

    /* Estilos para Resultados Formulario 300 */
    .resultado-seccion {
        margin-top: 1rem;
    }

    .resultado-titulo {
        color: var(--brand-purple);
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid var(--brand-cyan);
    }

    .table-results {
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid rgba(44, 86, 151, 0.1);
    }

    .table-results thead th {
        background: var(--brand-purple);
        color: white;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.05em;
        padding: 0.75rem;
        border: none;
    }

    .table-results tbody td {
        padding: 0.85rem 1rem;
        border-color: rgba(44, 86, 151, 0.05);
        font-size: 0.9rem;
        color: #4a4a4a;
    }

    .bg-success-subtle {
        background-color: #e7f6f2 !important;
        border-left: 4px solid #126950;
    }

    .bg-warning-subtle {
        background-color: #fff8f0 !important;
        border-left: 4px solid #f39c12;
    }

    .bg-light {
        background-color: #f8f9fa !important;
        border-left: 4px solid #ced4da;
    }

    .fw-bold td {
        font-weight: 700 !important;
        color: var(--brand-purple) !important;
    }
}

/* Estilos para Modal Parámetros con Sidebar */
#modalParametros .nav-pills .nav-link {
    border-radius: 8px;
    margin-bottom: 5px;
    color: #495057;
    transition: all 0.2s;
}

#modalParametros .nav-pills .nav-link.active {
    background-color: var(--brand-purple);
    color: white;
    box-shadow: 0 4px 6px rgba(44, 86, 151, 0.2);
}

#modalParametros .nav-pills .nav-link:hover:not(.active) {
    background-color: rgba(44, 86, 151, 0.05);
}

#modalParametros .section-title {
    border-bottom: 2px solid var(--brand-cyan);
    padding-bottom: 8px;
    color: var(--brand-purple);
    font-weight: 700;
}

#modalParametros .table thead th {
    background-color: #f8f9fa;
    color: #495057;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 2px solid #dee2e6;
}

#modalParametros .text-brand-purple {
    color: var(--brand-purple);
}

/* Formulario 300 — alinear inputs de valores manuales en la misma fila */
.manual-values-panel .manual-field-col {
    display: flex;
}

.manual-values-panel .manual-field {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.manual-values-panel .manual-field label {
    flex: 1 1 auto;
}

.manual-values-panel .manual-field .form-control {
    flex: 0 0 auto;
    margin-top: auto;
}

/* Estilos para el Modal de Progreso */
.progreso-paso {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.progreso-paso.active {
    background-color: rgba(44, 86, 151, 0.05);
    border-color: rgba(44, 86, 151, 0.1);
}

.progreso-paso.completed {
    background-color: rgba(25, 135, 84, 0.05);
}

.progreso-paso.completed .paso-icon i {
    color: #198754;
}

.progreso-paso.completed .paso-status i {
    color: #198754;
}

.progreso-paso.completed .paso-status i::before {
    content: "\F26A";
    /* bi-check-circle-fill */
}

.paso-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f8f9fa;
    color: #6c757d;
}

.progreso-paso.active .paso-icon {
    background: #2C5697;
    color: white;
}

.text-purple {
    color: #2C5697;
}

/* Estilos para el Modal de Progreso Premium (Override) */
.progreso-paso {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    margin-bottom: 8px;
    padding: 10px 15px;
}

.progreso-paso.active {
    background-color: rgba(44, 86, 151, 0.08);
    border-color: rgba(44, 86, 151, 0.2);
    transform: translateX(8px);
}

.progreso-paso.completed {
    background-color: rgba(40, 167, 69, 0.05);
}

.progreso-paso.completed .paso-icon {
    background: #28a745 !important;
    color: white !important;
}

.progreso-paso.completed .paso-status i {
    color: #28a745 !important;
}

.progreso-paso.completed .paso-status i::before {
    content: '\F26A' !important;
}

.paso-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #f8f9fa;
    color: #6c757d;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.progreso-paso.active .paso-icon {
    background: #2C5697;
    color: white;
    box-shadow: 0 4px 12px rgba(44, 86, 151, 0.3);
}

.progress {
    overflow: hidden;
    height: 8px;
    border-radius: 4px;
    background: #E6EDF7;
    box-shadow: none;
}

#progresoBar,
.progress-bar,
#progress-fill {
    transition: width 0.8s cubic-bezier(0.1, 0.7, 0.1, 1);
    background: var(--brand-blue);
    background-image: none;
    animation: none;
    box-shadow: none;
}

#progress-steps li.is-active {
    color: var(--brand-blue);
    font-weight: 700;
}

#progress-steps li.is-done {
    color: #3A6C10;
}

@keyframes gradientMove {
    0% {
        background-position: 100% 0%;
    }

    100% {
        background-position: -100% 0%;
    }
}

.progress-glow {
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.5) !important;
}

.bg-purple {
    background-color: var(--brand-purple) !important;
}

.text-purple {
    color: var(--brand-purple) !important;
}

/* Deshabilitar todas las animaciones y transiciones en botones */
.btn,
.btn *,
.btn:hover,
.btn:focus,
.btn-brand-primary,
.btn-outline-brand {
    transition: none !important;
    animation: none !important;
    transform: none !important;
}

/* Hub principal (pantalla de inicio unificada) */
.module-card {
    background: var(--brand-white);
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(44, 86, 151, 0.1);
    border: 1px solid rgba(44, 86, 151, 0.08);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.module-card-title {
    color: var(--brand-purple);
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.module-card-desc {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
    flex-grow: 1;
}

.hub-back-link {
    color: var(--brand-cyan);
    text-decoration: none;
    font-weight: 600;
}

.hub-back-link:hover {
    text-decoration: underline;
    color: var(--brand-purple);
}

.hub-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
    padding: 0.4rem 0.85rem 0.4rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(44, 86, 151, 0.15);
    background: #fff;
    color: var(--brand-purple);
    font-family: "Montserrat", sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(44, 86, 151, 0.08);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.hub-back-btn:hover {
    background: rgba(118, 188, 33, 0.12);
    border-color: var(--brand-cyan);
    color: var(--brand-purple);
}

.hub-back-btn .bi {
    font-size: 1.1rem;
    line-height: 1;
}

.formulario-fijo {
    background-color: #f8f9fc;
    color: var(--brand-purple);
    font-weight: 600;
    cursor: not-allowed;
    opacity: 1;
}

/* Rete ICA — pestañas de resultado */
.ica-tabs .nav-link {
    border-radius: 999px;
    color: var(--brand-purple);
    font-weight: 600;
    font-size: 0.82rem;
    padding: 0.4rem 0.9rem;
}

.ica-tabs .nav-link.active {
    background: var(--brand-purple);
    color: #fff;
}

.ica-table-wrap {
    max-height: min(56vh, 480px);
    border-radius: 12px;
    border: 1px solid rgba(44, 86, 151, 0.12);
    overflow: auto;
}

.ica-table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #e8f7f8;
    box-shadow: 0 1px 0 rgba(44, 86, 151, 0.12);
    white-space: nowrap;
}

.ica-table-wrap .tabla-resultados-compacta {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
}

.input-ica {
    width: 100%;
    min-width: 0;
    font-size: 0.78rem;
    padding: 0.32rem 0.45rem;
    border-radius: 8px;
    border: 1px solid rgba(44, 86, 151, 0.18);
}

.input-ica:focus {
    border-color: var(--brand-cyan);
    box-shadow: 0 0 0 0.15rem rgba(118, 188, 33, 0.2);
}

/* Proveedores planilla */
#tablaProvIca th:nth-child(1),
#tablaProvIca td:nth-child(1) { min-width: 14rem; max-width: 22rem; }
#tablaProvIca th:nth-child(2),
#tablaProvIca td:nth-child(2) { min-width: 9.5rem; width: 9.5rem; }
#tablaProvIca th:nth-child(3),
#tablaProvIca td:nth-child(3) { min-width: 7.5rem; width: 8rem; }
#tablaProvIca th:nth-child(4),
#tablaProvIca td:nth-child(4) { min-width: 8rem; width: 9rem; }
#tablaProvIca th:nth-child(5),
#tablaProvIca td:nth-child(5) { min-width: 12rem; max-width: 18rem; }
#tablaProvIca th:nth-child(6),
#tablaProvIca td:nth-child(6) { min-width: 12rem; max-width: 18rem; }

/* Datos (homologacion) */
#tablaDatosIca th:nth-child(1),
#tablaDatosIca td:nth-child(1) { min-width: 16rem; max-width: 28rem; }
#tablaDatosIca th:nth-child(2),
#tablaDatosIca td:nth-child(2) { min-width: 5.5rem; width: 6.5rem; }
#tablaDatosIca th:nth-child(3),
#tablaDatosIca td:nth-child(3) { min-width: 6rem; width: 7rem; }

/* Base actividad economica */
#tablaBaseIca th:nth-child(1),
#tablaBaseIca td:nth-child(1) { min-width: 7.5rem; width: 8.5rem; }
#tablaBaseIca th:nth-child(2),
#tablaBaseIca td:nth-child(2) { min-width: 9rem; width: 10rem; }
#tablaBaseIca th:nth-child(3),
#tablaBaseIca td:nth-child(3) { min-width: 14rem; max-width: 22rem; }
#tablaBaseIca th:nth-child(4),
#tablaBaseIca td:nth-child(4) { min-width: 12rem; max-width: 20rem; }
#tablaBaseIca th:nth-child(5),
#tablaBaseIca td:nth-child(5) { min-width: 5rem; width: 6rem; }

#tablaProvIca tbody tr.table-warning {
    --bs-table-bg: #fff6e0;
}

/* Panel de control */
.page-admin-panel {
    background: #F4F6F8;
}

.page-admin-panel .module-card {
    border: 1px solid #DDE3EA;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(44, 86, 151, 0.05);
}

.page-admin-panel .module-card-title {
    color: #1F2937;
    font-size: 1.15rem;
}

.panel-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    border-bottom: 1px solid rgba(44, 86, 151, 0.12);
    padding-bottom: 0.65rem;
}

.panel-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: "Montserrat", sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: #5c5a6a;
    text-decoration: none;
    padding: 0.55rem 0.95rem;
    border-radius: 10px;
    transition: background 0.15s ease, color 0.15s ease;
}

.panel-tab:hover {
    color: var(--brand-purple);
    background: rgba(44, 86, 151, 0.06);
}

.panel-tab.is-active {
    color: var(--brand-purple);
    background: rgba(44, 86, 151, 0.12);
}

.kpi-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #DDE3EA;
    box-shadow: 0 8px 22px rgba(44, 86, 151, 0.05);
    padding: 1rem 1.1rem;
    height: 100%;
}

.kpi-label {
    font-size: 0.78rem;
    color: var(--brand-gray);
    font-weight: 600;
}

.kpi-value {
    font-family: "Montserrat", sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-purple);
    line-height: 1.2;
    margin: 0.15rem 0;
}

.table-scroll {
    max-height: 22rem;
    overflow: auto;
    border: 1px solid rgba(44, 86, 151, 0.08);
    border-radius: 10px;
}

.table-scroll thead th {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    box-shadow: 0 1px 0 rgba(44, 86, 151, 0.08);
}

.scroll-panel {
    max-height: 70vh;
    overflow: auto;
    padding-right: 0.25rem;
}

.panel-filters {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #DDE3EA;
    box-shadow: 0 8px 22px rgba(44, 86, 151, 0.04);
    padding: 1rem 1.1rem;
}

.role-badge {
    font-family: "Montserrat", sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 6px;
    padding: 0.25rem 0.45rem;
}

.role-badge.role-contador {
    background: #e8f7f8;
    color: #0f6f73;
}

.role-badge.role-administrador {
    background: rgba(44, 86, 151, 0.12);
    color: #2C5697;
}

.role-badge.role-desarrollador {
    background: #eef2ff;
    color: #3949ab;
}

.role-badge.role-na {
    background: #f1f1f4;
    color: #6b6978;
}

.form-audit-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    margin-top: 0.75rem;
    font-size: 0.78rem;
    color: #5c5a6a;
}

.form-audit-card .kpi-value {
    font-size: 1.85rem;
}

.mosaic-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow-x: auto;
}

.mosaic-row {
    display: grid;
    grid-template-columns: 6.5rem repeat(3, minmax(5.5rem, 1fr));
    gap: 0.35rem;
    align-items: stretch;
}

.mosaic-head .mosaic-cell,
.mosaic-head .mosaic-label {
    font-family: "Montserrat", sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: #5c5a6a;
    background: transparent !important;
    box-shadow: none;
}

.mosaic-label {
    display: flex;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: #2e2d38;
}

.mosaic-cell {
    min-height: 2.4rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: inset 0 0 0 1px rgba(44, 86, 151, 0.08);
}

.dash-intro {
    color: #5c5a6a;
    font-size: 0.95rem;
    max-width: 46rem;
}

.kpi-hint {
    font-size: 0.72rem;
    color: #9a98a6;
}

.kpi-perf .kpi-value {
    font-size: 1.55rem;
}

.perf-delta.is-better {
    color: #1a9a78;
    font-weight: 700;
}

.perf-delta.is-worse {
    color: #b42318;
    font-weight: 700;
}

.chart-card canvas {
    max-width: 100%;
}

/* Errores de carga renderizados (reemplazan alert() del navegador) */
.app-error-modal {
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(46, 45, 56, 0.18);
}

.app-error-kicker {
    font-family: "Montserrat", sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9a98a6;
}

.app-error-icon {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    background: rgba(180, 35, 24, 0.1);
    color: #b42318;
}

#appErrorModal.is-warning .app-error-icon {
    background: rgba(176, 132, 12, 0.12);
    color: #9a6b00;
}

#appErrorModal.is-success .app-error-icon {
    background: rgba(26, 154, 120, 0.12);
    color: #1a9a78;
}

#appErrorModal.is-info .app-error-icon {
    background: rgba(118, 188, 33, 0.14);
    color: #0f7f83;
}

.app-error-detalle {
    white-space: pre-wrap;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.app-error-label {
    font-family: "Montserrat", sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #5c5a6a;
}

.app-error-meta {
    font-size: 0.85rem;
    color: #5c5a6a;
}

.app-error-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.app-error-chip {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    border: 1px solid transparent;
}

.app-error-chip.is-missing {
    background: rgba(180, 35, 24, 0.08);
    color: #b42318;
    border-color: rgba(180, 35, 24, 0.18);
}

.app-error-chip.is-found,
.app-error-chip.is-expected {
    background: rgba(44, 86, 151, 0.08);
    color: var(--brand-purple);
    border-color: rgba(44, 86, 151, 0.16);
}
