:root {
    --primary: #062B63;
    --secondary: #0B5ED7;
    --green: #138A36;
    --light: #F5F8FC;
    --dark: #102033;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    color: var(--dark);
}

.hero-section {
    background: linear-gradient(135deg, #062B63 0%, #0B5ED7 60%, #138A36 100%);
    color: white;
    padding: 90px 0;
}

.hero-content {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 40px;
    align-items: center;
}

.badge-custom {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 8px 16px;
    border-radius: 30px;
    margin-bottom: 20px;
    font-weight: 600;
}

.hero-text h1 {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero-text p {
    font-size: 20px;
    max-width: 680px;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-primary-custom {
    background: var(--green);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    border: 2px solid var(--green);
}

    .btn-primary-custom:hover {
        background: #0f742d;
        color: white;
    }

.btn-outline-custom {
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    border: 2px solid white;
}

    .btn-outline-custom:hover {
        background: white;
        color: var(--primary);
    }

.hero-card {
    background: white;
    color: var(--dark);
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.20);
}

    .hero-card h3 {
        color: var(--primary);
        font-weight: 800;
        margin-bottom: 18px;
    }

    .hero-card ul {
        padding-left: 20px;
        margin-bottom: 0;
    }

    .hero-card li {
        margin-bottom: 10px;
    }

.section {
    padding: 75px 0;
}

.light-section {
    background: var(--light);
}

.section-title {
    text-align: center;
    margin-bottom: 45px;
}

    .section-title h2 {
        color: var(--primary);
        font-size: 36px;
        font-weight: 800;
    }

    .section-title p {
        font-size: 18px;
        color: #5b6775;
    }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.service-card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 8px 24px rgba(6, 43, 99, 0.10);
    border: 1px solid #e5edf7;
}

    .service-card h3 {
        color: var(--primary);
        font-weight: 800;
        margin-bottom: 12px;
    }

    .service-card p {
        color: #5b6775;
        margin-bottom: 0;
    }

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

    .about-grid h2 {
        color: var(--primary);
        font-weight: 800;
    }

    .about-grid p {
        font-size: 18px;
        color: #5b6775;
    }

.contact-box {
    text-align: center;
    background: var(--light);
    padding: 50px;
    border-radius: 20px;
    border: 1px solid #e5edf7;
}

    .contact-box h2 {
        color: var(--primary);
        font-weight: 800;
    }

    .contact-box p {
        font-size: 18px;
        color: #5b6775;
        max-width: 760px;
        margin: 15px auto 30px;
    }

@media (max-width: 992px) {
    .hero-content,
    .cards-grid,
    .about-grid,
    .rubros-grid {
        grid-template-columns: 1fr;
    }

    .hero-text h1 {
        font-size: 38px;
    }

    .hero-buttons {
        flex-direction: column;
    }
}

.rubros-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.rubro-card {
    background: white;
    border-radius: 16px;
    padding: 26px;
    box-shadow: 0 8px 24px rgba(6, 43, 99, 0.10);
    border: 1px solid #e5edf7;
}

    .rubro-card h3 {
        color: var(--primary);
        font-weight: 800;
        margin-bottom: 10px;
    }

    .rubro-card p {
        color: #5b6775;
        margin-bottom: 0;
    }

@media (max-width: 992px) {
    .rubros-grid {
        grid-template-columns: 1fr;
    }
}


.problems-grid,
.steps-grid,
.cases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.problems-grid {
    grid-template-columns: repeat(3, 1fr);
}

.steps-grid {
    grid-template-columns: repeat(4, 1fr);
}

.cases-grid {
    grid-template-columns: repeat(4, 1fr);
}

.problem-card,
.step-card,
.case-card {
    background: white;
    border-radius: 16px;
    padding: 26px;
    box-shadow: 0 8px 24px rgba(6, 43, 99, 0.10);
    border: 1px solid #e5edf7;
}

    .problem-card h3,
    .step-card h3,
    .case-card h3 {
        color: var(--primary);
        font-weight: 800;
        margin-bottom: 10px;
    }

    .problem-card p,
    .step-card p,
    .case-card p {
        color: #5b6775;
        margin-bottom: 0;
    }

    .step-card span {
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: var(--green);
        color: white;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        margin-bottom: 16px;
    }

.trust-card {
    background: linear-gradient(135deg, #062B63 0%, #0B5ED7 60%, #138A36 100%);
    color: white;
    border-radius: 22px;
    padding: 55px;
    box-shadow: 0 14px 35px rgba(6, 43, 99, 0.18);
}

    .trust-card h2 {
        font-size: 34px;
        font-weight: 800;
        margin-top: 18px;
        margin-bottom: 18px;
    }

    .trust-card p {
        font-size: 18px;
        max-width: 900px;
        opacity: 0.95;
        margin-bottom: 0;
    }

.dark-badge {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    border: 2px solid #25D366;
}

    .btn-whatsapp:hover {
        background: #1fb85a;
        color: white;
    }

@media (max-width: 992px) {
    .problems-grid,
    .steps-grid,
    .cases-grid {
        grid-template-columns: 1fr;
    }

    .trust-card {
        padding: 35px;
    }

        .trust-card h2 {
            font-size: 28px;
        }
}

.login-section {
    min-height: calc(100vh - 130px);
    background: linear-gradient(135deg, #062B63 0%, #0B5ED7 55%, #138A36 100%);
    padding: 80px 0;
    color: white;
}

.login-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 45px;
    align-items: center;
}

.login-info h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 18px;
}

.login-info p {
    font-size: 19px;
    max-width: 680px;
    opacity: 0.95;
}

.login-benefits {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 35px;
}

    .login-benefits div {
        background: rgba(255, 255, 255, 0.12);
        border: 1px solid rgba(255, 255, 255, 0.20);
        border-radius: 16px;
        padding: 20px;
    }

    .login-benefits h3 {
        font-size: 20px;
        font-weight: 800;
        margin-bottom: 6px;
    }

    .login-benefits p {
        font-size: 15px;
        margin-bottom: 0;
    }

.login-card {
    background: white;
    color: var(--dark);
    border-radius: 22px;
    padding: 38px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22);
}

    .login-card h2 {
        color: var(--primary);
        font-weight: 800;
        margin-bottom: 8px;
    }

.login-subtitle {
    color: #5b6775;
    margin-bottom: 25px;
}

.login-card .form-label {
    font-weight: 700;
    color: var(--dark);
}

.login-card .form-control {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #d8e2ef;
}

    .login-card .form-control:focus {
        border-color: var(--secondary);
        box-shadow: 0 0 0 0.2rem rgba(11, 94, 215, 0.15);
    }

.login-help {
    text-align: center;
    margin-top: 20px;
}

    .login-help a {
        color: var(--secondary);
        text-decoration: none;
        font-weight: 600;
    }

        .login-help a:hover {
            text-decoration: underline;
        }

@media (max-width: 992px) {
    .login-container {
        grid-template-columns: 1fr;
    }

    .login-info h1 {
        font-size: 38px;
    }
}

.portal-section {
    min-height: calc(100vh - 80px);
    background: #f4f7fb;
}

.portal-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    padding: 0;
}

.portal-sidebar {
    background: #062B63;
    color: white;
    min-height: calc(100vh - 80px);
    padding: 28px 22px;
}

.sidebar-brand {
    margin-bottom: 35px;
}

    .sidebar-brand h2 {
        font-size: 28px;
        font-weight: 800;
        margin-bottom: 0;
    }

    .sidebar-brand span {
        color: #9bd3ff;
        font-weight: 600;
    }

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .sidebar-menu a {
        color: white;
        text-decoration: none;
        padding: 12px 14px;
        border-radius: 10px;
        font-weight: 600;
        opacity: 0.88;
    }

        .sidebar-menu a:hover,
        .sidebar-menu a.active {
            background: rgba(255, 255, 255, 0.14);
            opacity: 1;
        }

.portal-main {
    padding: 35px;
}

.portal-header {
    background: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 8px 24px rgba(6, 43, 99, 0.08);
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 25px;
}

.portal-badge {
    display: inline-block;
    background: #e7f3ff;
    color: #0B5ED7;
    padding: 7px 14px;
    border-radius: 30px;
    font-weight: 700;
    margin-bottom: 12px;
}

.portal-header h1 {
    color: #062B63;
    font-weight: 800;
    margin-bottom: 8px;
}

.portal-header p {
    color: #5b6775;
    max-width: 780px;
    margin-bottom: 0;
}

.portal-user-card {
    background: #f5f8fc;
    border: 1px solid #e5edf7;
    border-radius: 14px;
    padding: 18px 22px;
    min-width: 220px;
}

    .portal-user-card strong {
        display: block;
        color: #062B63;
    }

    .portal-user-card span {
        color: #5b6775;
        font-size: 14px;
    }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 25px;
}

.dashboard-card {
    background: white;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(6, 43, 99, 0.08);
    border: 1px solid #e5edf7;
}

    .dashboard-card span {
        color: #138A36;
        font-weight: 800;
    }

    .dashboard-card h2 {
        color: #062B63;
        font-size: 42px;
        font-weight: 800;
        margin: 8px 0;
    }

    .dashboard-card p {
        color: #5b6775;
        margin-bottom: 0;
    }

.portal-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.portal-panel {
    background: white;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 8px 24px rgba(6, 43, 99, 0.08);
    border: 1px solid #e5edf7;
}

    .portal-panel h3 {
        color: #062B63;
        font-weight: 800;
        margin-bottom: 18px;
    }

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

    .quick-actions a {
        background: #f4f7fb;
        border: 1px solid #e5edf7;
        padding: 14px;
        border-radius: 12px;
        text-decoration: none;
        color: #062B63;
        font-weight: 700;
    }

        .quick-actions a:hover {
            background: #e7f3ff;
        }

.module-list {
    margin-bottom: 0;
    padding-left: 20px;
}

    .module-list li {
        margin-bottom: 10px;
        color: #5b6775;
    }

@media (max-width: 992px) {
    .portal-container {
        grid-template-columns: 1fr;
    }

    .portal-sidebar {
        min-height: auto;
    }

    .dashboard-grid,
    .portal-content-grid {
        grid-template-columns: 1fr;
    }

    .portal-header {
        flex-direction: column;
        align-items: flex-start;
    }
}


.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

    .table-header h3 {
        margin-bottom: 4px;
    }

    .table-header p {
        color: #5b6775;
        margin-bottom: 0;
    }

.custom-table {
    border: 1px solid #e5edf7;
    border-radius: 12px;
    overflow: hidden;
}

    .custom-table thead {
        background: #f4f7fb;
        color: #062B63;
    }

    .custom-table th {
        font-weight: 800;
        padding: 14px;
    }

    .custom-table td {
        padding: 14px;
        color: #415066;
    }

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    background: #e8f7ee;
    color: #138A36;
    border-radius: 999px;
    font-weight: 800;
    font-size: 13px;
}

.empty-state {
    text-align: center;
    padding: 55px 20px;
    background: #f8fbff;
    border: 1px dashed #c9d8ea;
    border-radius: 18px;
}

    .empty-state h4 {
        color: #062B63;
        font-weight: 800;
        margin-bottom: 10px;
    }

    .empty-state p {
        color: #5b6775;
        margin-bottom: 24px;
    }

.form-grid {
    max-width: 900px;
}

    .form-grid .form-label {
        font-weight: 800;
        color: #102033;
    }

    .form-grid .form-control,
    .form-grid .form-select {
        padding: 12px 14px;
        border-radius: 10px;
        border: 1px solid #d8e2ef;
    }

        .form-grid .form-control:focus,
        .form-grid .form-select:focus {
            border-color: #0B5ED7;
            box-shadow: 0 0 0 0.2rem rgba(11, 94, 215, 0.15);
        }

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.profile-badge {
    display: inline-block;
    padding: 6px 12px;
    background: #e7f3ff;
    color: #0B5ED7;
    border-radius: 999px;
    font-weight: 800;
    font-size: 13px;
}


.permissions-box {
    margin-top: 25px;
}

    .permissions-box h3 {
        color: #062B63;
        font-weight: 800;
        margin-bottom: 6px;
    }

    .permissions-box p {
        color: #5b6775;
        margin-bottom: 18px;
    }

.permission-table th,
.permission-table td {
    vertical-align: middle;
}

.permission-table .form-check-input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.portal-user-card small {
    display: block;
    color: #5b6775;
    margin-top: 4px;
    font-size: 13px;
}

.portal-mobile-menu-button {
    display: none;
}

.portal-sidebar-close {
    display: none;
}

.portal-sidebar-backdrop {
    display: none;
}

/* ============================================================
   PORTAL - NAVEGACIÓN RESPONSIVE
   El sidebar global es el único dueño del comportamiento móvil.
   Se usan los IDs del partial para ganar prioridad frente a estilos
   particulares que puedan existir dentro de alguna vista.
   ============================================================ */
@media (max-width: 992px) {
    .portal-container {
        display: block;
        padding-top: 64px;
    }

    body.portal-sidebar-open {
        overflow: hidden !important;
    }

    html body #portalMenuOpen {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: fixed !important;
        top: 14px !important;
        left: 14px !important;
        z-index: 2800 !important;
        min-height: 42px !important;
        padding: 8px 14px !important;
        border: 1px solid #dbeafe !important;
        border-radius: 999px !important;
        background: #ffffff !important;
        color: #002b66 !important;
        font-weight: 800 !important;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18) !important;
        cursor: pointer !important;
        touch-action: manipulation;
    }

    html body #portalSidebar {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: auto !important;
        bottom: auto !important;
        width: 285px !important;
        max-width: 86vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        margin: 0 !important;
        padding: 28px 22px !important;
        z-index: 3000 !important;
        transform: translate3d(-105%, 0, 0) !important;
        transition: transform 0.25s ease !important;
        box-shadow: 18px 0 40px rgba(15, 23, 42, 0.35) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        pointer-events: auto !important;
        isolation: isolate;
    }

    html body.portal-sidebar-open #portalSidebar {
        transform: translate3d(0, 0, 0) !important;
    }

    /*
       El backdrop empieza DESPUÉS del ancho del sidebar.
       Así nunca puede interceptar los clics de los enlaces del menú,
       incluso si alguna vista antigua contiene un z-index conflictivo.
    */
    html body #portalSidebarBackdrop {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: min(285px, 86vw) !important;
        z-index: 2900 !important;
        margin: 0 !important;
        background: rgba(15, 23, 42, 0.45) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: opacity 0.2s ease, visibility 0.2s ease !important;
    }

    html body.portal-sidebar-open #portalSidebarBackdrop {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    html body #portalSidebar .sidebar-brand {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        gap: 12px !important;
    }

    html body #portalMenuClose {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 34px !important;
        height: 34px !important;
        flex: 0 0 34px !important;
        border: 1px solid rgba(255, 255, 255, 0.25) !important;
        border-radius: 50% !important;
        background: rgba(255, 255, 255, 0.12) !important;
        color: #ffffff !important;
        font-size: 1.4rem !important;
        line-height: 1 !important;
        font-weight: 700 !important;
        cursor: pointer !important;
        touch-action: manipulation;
    }

    html body #portalSidebar .sidebar-menu a,
    html body #portalSidebar .taller-sidebar-toggle {
        position: relative;
        z-index: 1;
        pointer-events: auto !important;
        touch-action: manipulation;
    }

    .portal-main {
        width: 100%;
        margin-left: 0;
    }
}
