:root {
    --principal: #02bda7;
    --principal-hover: #009f8e;
    --oscuro: #0f172a;
    --gris: #64748b;
    --fondo: #f8fafc;
    --borde: #e2e8f0;
    --blanco: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--fondo);
    color: var(--oscuro);
    font-family: system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Pantalla de acceso */

.login-contenedor {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--blanco);
    padding: 36px;
    border: 1px solid var(--borde);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, .05);
}

.logo-nuasof {
    color: var(--principal);
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1.5px;
}

.texto-secundario {
    color: var(--gris);
    font-size: 14px;
}

.login-icono {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: #e6f8f5;
    color: var(--principal-hover);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

/* Formularios */

.form-label {
    font-size: 14px;
    font-weight: 600;
}

.form-control {
    min-height: 52px;
    border-radius: 12px;
    border: 1px solid var(--borde);
    font-size: 16px;
    padding: 12px 15px;
}

.form-control:focus {
    border-color: var(--principal);
    box-shadow: 0 0 0 4px rgba(2, 189, 167, .12);
}

.btn-principal {
    background: var(--principal);
    color: var(--oscuro);
    border: none;
    min-height: 52px;
    border-radius: 12px;
    font-weight: 600;
    transition: background .2s;
}

.btn-principal:hover,
.btn-principal:focus {
    background: var(--principal-hover);
    color: var(--oscuro);
}

.input-codigo {
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 10px;
}

.login-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 12px;
    color: var(--gris);
}

@media (max-width: 576px) {

    .login-contenedor {
        padding: 24px;
        background: var(--blanco);
    }

    .login-card {
        border: none;
        box-shadow: none;
        padding: 10px;
    }

}

/* =================================
   ESTRUCTURA DEL PORTAL
================================= */

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #ffffff;
    border-bottom: 1px solid var(--borde);
    display: flex;
    align-items: center;
    z-index: 1030;
}

.app-header .logo-nuasof {
    font-size: 26px;
}

.app-contenido {
    padding-top: 70px;
    padding-bottom: 90px;
    min-height: 100vh;
}

/* Menú móvil */

.app-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid var(--borde);
    z-index: 1020;
    padding-bottom: env(safe-area-inset-bottom);
}

.menu-opciones {
    display: flex;
    justify-content: space-around;
}

.menu-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 4px;
    color: var(--gris);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
}

.menu-link i {
    font-size: 22px;
}

.menu-link:hover,
.menu-link.activo {
    color: #008f80;
}

.menu-link.activo {
    font-weight: 700;
}

/* Tarjetas */

.card-panel {
    background: #ffffff;
    border: 1px solid var(--borde);
    border-radius: 18px;
    height: 100%;
}

.card-comision {
    background: linear-gradient(135deg,
            #008f80,
            #006f65);
    color: #ffffff;
    border: none;
    border-radius: 22px;
}

.card-icono {
    width: 42px;
    height: 42px;
    background: #e6f8f5;
    color: #008f80;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.valor-indicador {
    font-size: clamp(17px, 2.5vw, 26px);
    font-weight: 700;
    letter-spacing: -0.5px;
    overflow-wrap: anywhere;
}

.titulo-seccion {
    font-size: 17px;
    font-weight: 700;
}

.estado-pagado {
    background: #dcfce7;
    color: #166534;
}

.estado-pendiente {
    background: #fef3c7;
    color: #92400e;
}

/* Menú escritorio */

@media (min-width: 992px) {

    .app-menu {
        top: 70px;
        bottom: 0;
        right: auto;
        width: 240px;
        border-top: none;
        border-right: 1px solid var(--borde);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 24px 16px;
    }

    .menu-opciones {
        flex-direction: column;
        gap: 8px;
    }

    .menu-link {
        flex-direction: row;
        justify-content: flex-start;
        gap: 14px;
        padding: 14px 18px;
        font-size: 14px;
        border-radius: 12px;
    }

    .menu-link.activo {
        background: #e6f8f5;
    }

    .menu-footer {
        padding: 15px;
    }

    .app-contenido {
        margin-left: 240px;
        padding-bottom: 24px;
    }

}

/* =================================
   MÓDULO DE COMISIONES
================================= */

.icono-pendiente {
    background: #fef3c7;
    color: #b45309;
}

.form-select {
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid var(--borde);
}

.form-select:focus {
    border-color: var(--principal);
    box-shadow: 0 0 0 3px rgba(2, 189, 167, 0.12);
}

.estado-pagado,
.estado-pendiente {
    font-weight: 500;
    padding: 6px 9px;
    border-radius: 8px;
    font-size: 11px;
}

/* =================================
   MÓDULO DE CLIENTES
================================= */

.cliente-informacion {
    min-width: 0;
    overflow-wrap: anywhere;
}

.input-group .form-control {
    border-radius: 12px 0 0 12px;
}

.input-group .btn {
    border-radius: 0 12px 12px 0;
}

.btn-outline-secondary {
    border-radius: 10px;
    font-size: 13px;
    padding: 10px 12px;
}

/* =================================
   EXPERIENCIA DE APLICACIÓN MÓVIL
================================= */

body {
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

button,
a,
input,
select {
    touch-action: manipulation;
}

input,
select,
textarea {
    font-size: 16px !important;
}

.app-header {
    padding-top: env(safe-area-inset-top);
    height: calc(70px + env(safe-area-inset-top));
}

.app-contenido {
    padding-top: calc(70px + env(safe-area-inset-top));
}

@media (max-width: 991.98px) {

    .app-contenido {
        padding-bottom: calc(90px + env(safe-area-inset-bottom));
    }

}

@media (min-width: 992px) {

    .app-menu {
        top: calc(70px + env(safe-area-inset-top));
    }

}

::selection {
    background: #02bda7;
    color: #0f172a;
}

/* Logotipo corporativo */

.logo-empresa {
    width: 140px;
    height: auto;
    object-fit: contain;
}

.app-header .logo-empresa {
    width: 115px;
}

@media (max-width: 575.98px) {

    .app-header .logo-empresa {
        width: 100px;
    }

}