/* Archivo: public/mod_assets/users/style.css */
/* Punto de integración: Sobrescribir por completo. Consolida EP-01, EP-05, EP-07, EP-09 y EP-12. */

/* ==========================================================================
   1. ESTRUCTURAS DE LAYOUT Y GRILLAS (MOBILE FIRST)
   ========================================================================== */

.iam-profile-view, .iam-admin-view, .iam-auth-view {
    background-color: var(--cheisca-smoke);
    min-height: 100vh;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wide-box { 
    width: 100%; 
    max-width: 900px; 
    margin: 0 auto; 
}

/* Grilla de Formularios (Registro/Admin) */
.social-login-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* ==========================================================================
   2. COMPONENTES DE SESIÓN (HU-045, HU-046, HU-047)
   ========================================================================== */

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 24px;
}

.session-card {
    background-color: var(--cheisca-white);
    border: 1px solid var(--cheisca-border);
    border-radius: var(--radius-card, 20px);
    padding: 24px;
    display: flex;
    flex-direction: column; /* Apilado en móvil */
    gap: 20px;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.session-card.current-session {
    border: 1.5px solid var(--cheisca-blue);
    background-color: rgba(59, 130, 246, 0.01);
}

.session-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.device-icon-wrapper {
    width: 52px;
    height: 52px;
    background-color: var(--cheisca-smoke);
    color: var(--cheisca-black);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    border: 1px solid var(--cheisca-border);
}

.session-details h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--cheisca-black);
}

.session-meta {
    font-size: 0.85rem;
    color: var(--cheisca-black);
    opacity: 0.6;
    line-height: 1.4;
}

.btn-revoke-session {
    width: 100%; /* Botón ancho en móvil */
}

/* ==========================================================================
   3. TABLAS Y MATRIZ (RBAC / ADMIN)
   ========================================================================== */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-card);
    border: 1px solid var(--cheisca-border);
    background-color: var(--cheisca-white);
    box-shadow: var(--shadow-soft);
}

.table-premium {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table-premium th {
    padding: 16px;
    background-color: var(--cheisca-smoke);
    font-family: var(--font-heading);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    border-bottom: 1px solid var(--cheisca-border);
}

.table-premium td {
    padding: 16px;
    border-bottom: 1px solid var(--cheisca-border);
    font-size: 0.9rem;
}

/* ==========================================================================
   4. UI KIT: BOTONES Y BADGES
   ========================================================================== */

.btn-danger-outline {
    background: transparent;
    color: var(--cheisca-danger);
    border: 1.5px solid rgba(239, 68, 68, 0.3);
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger-outline:hover {
    background-color: rgba(239, 68, 68, 0.05);
    border-color: var(--cheisca-danger);
}

.badge {
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--cheisca-success); border: 1px solid rgba(16, 185, 129, 0.2); }

/* ==========================================================================
   5. COMPONENTES ESPECIALES (AUDITORÍA / PWA)
   ========================================================================== */

.upload-zone {
    border: 2px dashed var(--cheisca-border);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    background-color: var(--cheisca-white);
    cursor: pointer;
}

.upload-zone:hover { border-color: var(--cheisca-blue); background-color: var(--cheisca-smoke); }

.impersonation-banner-wrapper {
    position: sticky; top: 0; z-index: 10000;
    height: 50px; background-color: #FFD54F; color: #000;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; box-shadow: var(--shadow-soft);
}

/* ==========================================================================
   6. ADAPTACIONES TABLET Y DESKTOP
   ========================================================================== */

@media (min-width: 769px) {
    .iam-profile-view, .iam-admin-view { padding: 48px 32px; }
    
    .social-login-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
    
    .session-card {
        flex-direction: row; /* Tarjetas horizontales en PC */
        justify-content: space-between;
        align-items: center;
        padding: 28px;
    }

    .btn-revoke-session {
        width: auto; /* Botones con tamaño de contenido */
    }

    .table-premium th, .table-premium td { padding: 20px 24px; }
}

/* ==========================================================================
   LOGIN UNIFICADO - CHEISCA LIGHT UI (PRODUCCIÓN & MOBILE-FIRST)
   Color Dominante Primario: Naranja CHEISCA (#F28C28)
   ========================================================================== */

.iam-auth-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--cheisca-smoke, #F7F7F5);
    padding: 32px 16px;
    box-sizing: border-box;
}

.auth-viewport-wrapper {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card-surface {
    background-color: var(--cheisca-white, #FFFFFF);
    border: 1px solid var(--cheisca-border, #E5E5E5);
    border-radius: var(--radius-card, 20px);
    box-shadow: 0 10px 30px rgba(10, 10, 10, 0.04), 0 1px 3px rgba(10, 10, 10, 0.02);
    padding: 36px 32px;
    box-sizing: border-box;
}

/* Encabezado */
.auth-card-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-kpi-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(242, 140, 40, 0.08);
    color: var(--cheisca-orange, #F28C28);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.auth-kpi-badge .badge-icon {
    font-size: 15px;
}

.auth-title-main {
    font-family: var(--font-heading, 'Manrope', sans-serif);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--cheisca-black, #0A0A0A);
    letter-spacing: -0.025em;
    margin: 0 0 6px 0;
    line-height: 1.2;
}

.auth-subtitle-main {
    font-size: 0.88rem;
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.6;
    margin: 0;
    line-height: 1.4;
}

/* Campos de Entrada e Iconos */
.input-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-label {
    font-family: var(--font-heading, 'Manrope', sans-serif);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--cheisca-black, #0A0A0A);
}

.input-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forgot-password-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--cheisca-blue, #3B82F6);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.forgot-password-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.input-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-leading-icon {
    position: absolute;
    left: 14px;
    font-size: 19px;
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.35;
    pointer-events: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.input-styled {
    width: 100%;
    height: 46px;
    background-color: var(--cheisca-smoke, #F7F7F5);
    border: 1px solid var(--cheisca-border, #E5E5E5);
    border-radius: var(--radius-input, 12px);
    padding: 0 14px 0 42px;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.9rem;
    color: var(--cheisca-black, #0A0A0A);
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.input-styled:focus {
    background-color: #FFFFFF;
    border-color: var(--cheisca-orange, #F28C28);
    box-shadow: 0 0 0 3px rgba(242, 140, 40, 0.15);
}

.input-styled:focus + .input-leading-icon,
.input-field-wrapper:focus-within .input-leading-icon {
    color: var(--cheisca-orange, #F28C28);
    opacity: 0.9;
}

/* Reset Visual del Autofill de Chrome */
.input-styled:-webkit-autofill,
.input-styled:-webkit-autofill:hover, 
.input-styled:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px #F7F7F5 inset !important;
    -webkit-text-fill-color: var(--cheisca-black, #0A0A0A) !important;
    caret-color: var(--cheisca-black, #0A0A0A);
    transition: background-color 5000s ease-in-out 0s;
}

.input-styled.password-field {
    padding-right: 44px;
}

.btn-toggle-password {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.btn-toggle-password:hover {
    opacity: 0.9;
    color: var(--cheisca-orange, #F28C28);
}

.btn-toggle-password .pwd-icon {
    font-size: 19px;
}

/* Botón CTA Primario en Color Naranja CHEISCA */
.btn-primary-orange {
    width: 100%;
    height: 48px;
    background-color: var(--cheisca-orange, #F28C28);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-button, 12px);
    font-family: var(--font-heading, 'Manrope', sans-serif);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    margin-top: 20px;
    box-shadow: 0 4px 14px rgba(242, 140, 40, 0.28);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary-orange:hover {
    background-color: #E07D1C;
    box-shadow: 0 6px 18px rgba(242, 140, 40, 0.38);
    transform: translateY(-1px);
}

.btn-primary-orange:active {
    transform: scale(0.985);
    box-shadow: 0 2px 8px rgba(242, 140, 40, 0.25);
}

.btn-primary-orange:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-arrow-icon {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.btn-primary-orange:hover .btn-arrow-icon {
    transform: translateX(3px);
}

/* Divisor Horizontal */
.auth-divider-row {
    display: flex;
    align-items: center;
    margin: 22px 0;
    gap: 12px;
}

.auth-divider-line {
    flex: 1;
    height: 1px;
    background-color: var(--cheisca-border, #E5E5E5);
}

.auth-divider-text {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.45;
    letter-spacing: 0.05em;
    font-weight: 600;
    white-space: nowrap;
}

/* Botones Alternativos SSO & Passkeys */
.auth-alternatives-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-sso-surface {
    width: 100%;
    height: 44px;
    background-color: #FFFFFF;
    border: 1px solid var(--cheisca-border, #E5E5E5);
    border-radius: var(--radius-button, 12px);
    font-family: var(--font-heading, 'Manrope', sans-serif);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--cheisca-black, #0A0A0A);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(10, 10, 10, 0.02);
}

.btn-sso-surface:hover {
    background-color: var(--cheisca-smoke, #F7F7F5);
    border-color: rgba(21, 21, 21, 0.25);
    box-shadow: 0 2px 8px rgba(10, 10, 10, 0.05);
    transform: translateY(-1px);
}

.btn-sso-surface:active {
    transform: scale(0.99);
}

.btn-sso-google .google-svg {
    flex-shrink: 0;
}

.btn-passkey-access .passkey-icon {
    font-size: 20px;
    color: var(--cheisca-purple, #7C4DFF);
}

/* Píldora de Acceso Libre como Invitado */
.auth-guest-footer {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

.guest-action-pill {
    background: transparent;
    border: 1px dashed rgba(21, 21, 21, 0.25);
    border-radius: 20px;
    padding: 8px 16px;
    color: var(--cheisca-black, #0A0A0A);
    font-family: var(--font-heading, 'Manrope', sans-serif);
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.guest-action-pill:hover {
    background-color: var(--cheisca-smoke, #F7F7F5);
    border-style: solid;
    border-color: var(--cheisca-black, #0A0A0A);
    color: var(--cheisca-orange, #F28C28);
}

.guest-pill-icon {
    font-size: 16px;
    color: var(--cheisca-blue, #3B82F6);
}

.guest-action-pill:hover .guest-pill-icon {
    color: var(--cheisca-orange, #F28C28);
}

.guest-pill-arrow {
    transition: transform 0.2s ease;
}

.guest-action-pill:hover .guest-pill-arrow {
    transform: translateX(3px);
}

/* Enlace a Registro */
.auth-register-redirect {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--cheisca-smoke, #F7F7F5);
    text-align: center;
    font-size: 0.84rem;
}

.auth-redirect-text {
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.65;
}

.auth-redirect-link {
    font-weight: 700;
    color: var(--cheisca-orange, #F28C28);
    text-decoration: none;
    margin-left: 4px;
    transition: text-decoration 0.2s ease;
}

.auth-redirect-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   ADAPTATIVO RESPONSIVE (MOBILE-FIRST ≤768px & TABLET/DESKTOP)
   ========================================================================== */
@media (max-width: 480px) {
    .iam-auth-view {
        padding: 16px 12px;
        align-items: flex-start;
    }

    .auth-card-surface {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .auth-title-main {
        font-size: 1.55rem;
    }

    .input-styled {
        height: 48px; /* Ergonomía móvil óptima */
        font-size: 0.92rem;
    }

    .btn-primary-orange {
        height: 50px;
        font-size: 1rem;
    }

    .btn-sso-surface {
        height: 46px;
    }
}

/* ==========================================================================
   PANTALLA DE REGISTRO - CHEISCA LIGHT UI (MOBILE-FIRST & NO-OVERFLOW)
   Acento Dominante: Naranja CHEISCA (#F28C28)
   ========================================================================== */

.register-viewport-wrapper {
    max-width: 490px; /* Ancho optimizado para dar balance a la grilla doble */
}

.register-card-surface {
    padding: 36px 32px;
}

/* Grilla de 2 columnas con prevención estricta de desbordamiento horizontal */
.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
}

.form-row-grid .input-group {
    min-width: 0; /* CRÍTICO: Previene que los inputs de CSS Grid se salgan de la tarjeta */
    width: 100%;
}

.form-row-grid .input-field-wrapper {
    width: 100%;
}

/* Tarjeta Ergonómica del Checkbox Legal */
.input-consent-group {
    margin: 18px 0 10px 0;
}

.consent-checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background-color: var(--cheisca-smoke, #F7F7F5);
    border: 1px solid var(--cheisca-border, #E5E5E5);
    border-radius: var(--radius-input, 12px);
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.consent-checkbox-card:hover {
    background-color: #FFFFFF;
    border-color: var(--cheisca-orange, #F28C28);
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--cheisca-orange, #F28C28);
    cursor: pointer;
    flex-shrink: 0;
}

.consent-text {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.8;
}

.legal-doc-link {
    color: var(--cheisca-blue, #3B82F6);
    font-weight: 600;
    text-decoration: none;
    transition: text-decoration 0.2s ease;
}

.legal-doc-link:hover {
    text-decoration: underline;
}

/* Medidor Progresivo de Seguridad de Contraseña (HU-AU-010) */
.password-strength-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.strength-segments-track {
    display: flex;
    gap: 6px;
    width: 100%;
    height: 4px;
}

.strength-segment {
    flex: 1;
    height: 100%;
    background-color: var(--cheisca-border, #E5E5E5);
    border-radius: 2px;
    transition: background-color 0.25s ease;
}

/* Estados de los segmentos */
.strength-segment.active-weak {
    background-color: var(--cheisca-danger, #EF4444);
}

.strength-segment.active-medium {
    background-color: var(--cheisca-orange, #F28C28);
}

.strength-segment.active-strong {
    background-color: var(--cheisca-success, #10B981);
}

.strength-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.strength-label-text {
    font-size: 0.73rem;
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.6;
    line-height: 1.3;
}

.strength-status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: var(--cheisca-smoke, #F7F7F5);
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.6;
}

.strength-status-badge.badge-weak {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--cheisca-danger, #EF4444);
    opacity: 1;
}

.strength-status-badge.badge-medium {
    background-color: rgba(242, 140, 40, 0.1);
    color: var(--cheisca-orange, #F28C28);
    opacity: 1;
}

.strength-status-badge.badge-strong {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--cheisca-success, #10B981);
    opacity: 1;
}

.register-submit-btn {
    margin-top: 14px;
}

/* ==========================================================================
   RESPONSIVE ADAPTATIVO (MOBILE-FIRST ≤600px)
   ========================================================================== */
@media (max-width: 600px) {
    .register-card-surface {
        padding: 26px 18px;
    }

    .form-row-grid {
        grid-template-columns: 1fr; /* Colapso vertical ergonómico en celulares */
        gap: 16px;
    }

    .strength-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ==========================================================================
   CORRECCIÓN Y BLINDAJE DE INPUTS CON ICONOS (CHEISCA Light UI)
   Archivo: public/mod_assets/users/style.css
   ========================================================================== */

.input-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Icono izquierdo estandarizado y centrado */
.input-leading-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    font-size: 20px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.38;
    pointer-events: none;
    z-index: 2;
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* Input estilizado con separación forzosa a prueba de herencias globales */
.input-field-wrapper .input-styled,
.input-group .input-styled {
    width: 100%;
    height: 48px; /* Altura ergonómica táctil */
    background-color: var(--cheisca-smoke, #F7F7F5);
    border: 1px solid var(--cheisca-border, #E5E5E5);
    border-radius: var(--radius-input, 12px);
    
    /* PADDING BLINDADO: 46px a la izquierda para despejar completamente el icono */
    padding-left: 46px !important;
    padding-right: 16px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.92rem;
    color: var(--cheisca-black, #0A0A0A);
    outline: none;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Espacio derecho reservado exclusivamente para el campo con botón de ver contraseña */
.input-field-wrapper .input-styled.password-field {
    padding-right: 48px !important;
}

/* Estilo y contraste del Placeholder */
.input-field-wrapper .input-styled::placeholder {
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.38;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.9rem;
}

/* Estado Focus con resplandor Naranja CHEISCA */
.input-field-wrapper .input-styled:focus {
    background-color: #FFFFFF;
    border-color: var(--cheisca-orange, #F28C28);
    box-shadow: 0 0 0 3px rgba(242, 140, 40, 0.15);
}

.input-field-wrapper:focus-within .input-leading-icon {
    color: var(--cheisca-orange, #F28C28);
    opacity: 0.95;
}

/* Botón derecho para mostrar / ocultar contraseña */
.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
    z-index: 3;
    transition: opacity 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.btn-toggle-password:hover {
    opacity: 0.9;
    color: var(--cheisca-orange, #F28C28);
    background-color: rgba(242, 140, 40, 0.08);
}

.btn-toggle-password .pwd-icon {
    font-size: 20px !important;
}

/* Reset Visual del Autofill de Chrome/Safari para mantener el fondo y texto nítido */
.input-field-wrapper .input-styled:-webkit-autofill,
.input-field-wrapper .input-styled:-webkit-autofill:hover, 
.input-field-wrapper .input-styled:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px #F7F7F5 inset !important;
    -webkit-text-fill-color: var(--cheisca-black, #0A0A0A) !important;
    padding-left: 46px !important;
    font-family: var(--font-body, 'Inter', sans-serif) !important;
    font-size: 0.92rem !important;
    caret-color: var(--cheisca-black, #0A0A0A);
    transition: background-color 5000s ease-in-out 0s;
}

/* ==========================================================================
   MÓDULO USERS - ASIGNACIÓN DE PERMISOS RBAC (CHEISCA LIGHT UI)
   Archivo: public/mod_assets/users/style.css
   ========================================================================== */

.users-rbac-wrapper {
    width: 100%;
    animation: fadeIn 0.3s ease-out;
    padding: 24px 16px;
    box-sizing: border-box;
}

.rbac-form-container {
    max-width: 1080px;
    margin: 0 auto;
    width: 100%;
}

/* Header Contextual */
.rbac-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.module-kpi-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.08);
    color: var(--cheisca-blue, #3B82F6);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.module-kpi-pill .pill-icon {
    font-size: 16px;
}

.rbac-title-main {
    font-family: var(--font-heading, 'Manrope', sans-serif);
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--cheisca-black, #0A0A0A);
    margin: 0 0 6px 0;
    letter-spacing: -0.02em;
}

.rbac-subtitle-main {
    font-size: 0.95rem;
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.65;
    margin: 0;
}

.contextual-back-btn {
    height: 44px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--cheisca-white, #FFFFFF);
    border: 1px solid var(--cheisca-border, #E5E5E5);
    border-radius: 12px;
    color: var(--cheisca-black, #0A0A0A);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.contextual-back-btn:hover {
    border-color: var(--cheisca-orange, #F28C28);
    color: var(--cheisca-orange, #F28C28);
    transform: translateY(-1px);
}

/* Tarjeta Principal */
.rbac-admin-card {
    background-color: var(--cheisca-white, #FFFFFF);
    border: 1px solid var(--cheisca-border, #E5E5E5);
    border-radius: var(--radius-card, 20px);
    box-shadow: 0 4px 20px rgba(10, 10, 10, 0.03);
    padding: 36px 40px;
    box-sizing: border-box;
}

.form-section-block {
    border-bottom: 1px solid var(--cheisca-smoke, #F5F5F3);
    padding-bottom: 28px;
    margin-bottom: 28px;
}

.form-section-block.no-border-bottom {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.form-section-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
}

.form-section-header .section-icon {
    font-size: 24px;
    color: var(--cheisca-blue, #3B82F6);
    background: rgba(59, 130, 246, 0.08);
    padding: 10px;
    border-radius: 12px;
}

.form-section-title {
    font-family: var(--font-heading, 'Manrope', sans-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--cheisca-black, #0A0A0A);
    margin: 0 0 4px 0;
}

.form-section-subtitle {
    font-size: 0.85rem;
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.6;
    margin: 0;
}

/* Inputs & Alertas */
.role-select-group {
    max-width: 420px;
}

.select-premium {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 0.95rem;
    border-radius: 12px;
    border: 1px solid var(--cheisca-border, #E5E5E5);
    background-color: var(--cheisca-smoke, #F7F7F5);
    color: var(--cheisca-black, #0A0A0A);
    outline: none;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A0A0A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

.select-premium:focus {
    background-color: var(--cheisca-white, #FFFFFF);
    border-color: var(--cheisca-orange, #F28C28);
    box-shadow: 0 0 0 3px rgba(242, 140, 40, 0.15);
}

.alert-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.alert-info {
    background: rgba(59, 130, 246, 0.08);
    border-left: 4px solid var(--cheisca-blue, #3B82F6);
}

.alert-icon {
    color: var(--cheisca-blue, #3B82F6);
    font-size: 24px;
}

.alert-title {
    color: var(--cheisca-blue, #3B82F6);
    font-size: 0.95rem;
    display: block;
    margin-bottom: 4px;
}

.alert-text {
    font-size: 0.85rem;
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.8;
    line-height: 1.5;
}

.hidden {
    display: none !important;
}

/* Grilla de Permisos */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.consent-checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background-color: var(--cheisca-smoke, #F7F7F5);
    border: 1px solid var(--cheisca-border, #E5E5E5);
    border-radius: 16px;
    padding: 16px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.consent-checkbox-card:hover:not(.disabled-card) {
    background-color: var(--cheisca-white, #FFFFFF);
    border-color: var(--cheisca-orange, #F28C28);
    box-shadow: 0 4px 12px rgba(242, 140, 40, 0.08);
    transform: translateY(-2px);
}

.consent-checkbox-card.disabled-card {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: transparent;
}

.custom-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--cheisca-orange, #F28C28);
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.consent-card-body {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.consent-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 8px;
}

.consent-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--cheisca-black, #0A0A0A);
    line-height: 1.3;
}

.consent-code-badge {
    font-family: monospace;
    font-size: 0.72rem;
    background-color: var(--cheisca-white, #FFFFFF);
    border: 1px solid var(--cheisca-border, #E5E5E5);
    padding: 3px 8px;
    border-radius: 6px;
    color: var(--cheisca-blue, #3B82F6);
    font-weight: 700;
    flex-shrink: 0;
}

.consent-card-desc {
    font-size: 0.82rem;
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.65;
    line-height: 1.5;
}

/* Botonera de Envío */
.form-footer-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 24px;
    border-top: 1px solid var(--cheisca-smoke, #F5F5F3);
    margin-top: 32px;
}

.btn-primary-orange {
    height: 48px;
    padding: 0 28px;
    background-color: var(--cheisca-orange, #F28C28);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-button, 12px);
    font-family: var(--font-heading, 'Manrope', sans-serif);
    font-size: 0.95rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(242, 140, 40, 0.25);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary-orange:hover {
    background-color: #E07D1C;
    box-shadow: 0 6px 18px rgba(242, 140, 40, 0.35);
    transform: translateY(-1px);
}

.btn-icon-left {
    font-size: 20px;
}

/* Responsive Adaptativo */
@media (max-width: 768px) {
    .rbac-admin-card {
        padding: 24px 20px;
    }
    .rbac-header-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .permissions-grid {
        grid-template-columns: 1fr; /* 1 sola columna en celular */
    }
    .form-footer-actions {
        justify-content: center;
    }
    .btn-primary-orange {
        width: 100%;
    }
}

/* ==========================================================================
   MATRIZ DE CONTROL DE ACCESO (RBAC) - CHEISCA LIGHT UI
   Archivo: public/mod_assets/users/style.css
   ========================================================================== */

.matrix-view-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.rbac-action-btn {
    height: 42px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: var(--font-heading, 'Manrope', sans-serif);
    border-radius: var(--radius-button, 12px);
    text-decoration: none;
    box-sizing: border-box;
}

.rbac-action-btn .material-symbols-outlined {
    font-size: 18px;
}

/* Tabla Matriz Responsiva Avanzada */
.matrix-table-responsive {
    width: 100%;
    max-height: calc(100vh - 280px);
    overflow: auto;
    border-bottom: 1px solid var(--cheisca-smoke, #F5F5F3);
}

/* Optimización del Scrollbar */
.matrix-table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.matrix-table-responsive::-webkit-scrollbar-track {
    background: transparent;
}
.matrix-table-responsive::-webkit-scrollbar-thumb {
    background: var(--cheisca-border, #E5E5E5);
    border-radius: 4px;
}
.matrix-table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(10, 10, 10, 0.2);
}

.rbac-matrix-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px;
}

/* Congelamiento (Sticky) de Cabeceras y Primera Columna */
.rbac-matrix-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--cheisca-smoke, #F7F7F5);
    border-bottom: 1px solid var(--cheisca-border, #E5E5E5);
    border-right: 1px solid var(--cheisca-border, #E5E5E5);
}

.rbac-matrix-table .col-sticky-left {
    position: sticky;
    left: 0;
    z-index: 5;
    background-color: var(--cheisca-white, #FFFFFF);
    border-right: 1px solid var(--cheisca-border, #E5E5E5);
}

/* Intersección de Sticky (Esquina Superior Izquierda) */
.rbac-matrix-table th.col-sticky-left {
    z-index: 15;
    background-color: var(--cheisca-smoke, #F7F7F5);
}

.rbac-matrix-table th:last-child,
.rbac-matrix-table td:last-child {
    border-right: none;
}

.col-role-header {
    text-align: center;
    min-width: 140px;
}

.role-header-content {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.role-header-icon {
    font-size: 18px !important;
    opacity: 0.6;
}

/* Celdas del Cuerpo */
.cell-permission-desc {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 260px;
    max-width: 320px;
}

.perm-title-text {
    font-weight: 700;
    color: var(--cheisca-black, #0A0A0A);
    font-size: 0.9rem;
    line-height: 1.3;
}

.perm-code-pill {
    font-family: monospace;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--cheisca-blue, #3B82F6);
    background-color: rgba(59, 130, 246, 0.08);
    padding: 2px 8px;
    border-radius: 6px;
}

.perm-category-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--cheisca-black, #0A0A0A);
    background-color: var(--cheisca-smoke, #F7F7F5);
    border: 1px solid var(--cheisca-border, #E5E5E5);
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

/* Insignias de Intersección (Checks & Crosses) */
.cell-status-check {
    text-align: center;
    vertical-align: middle;
    border-right: 1px solid var(--cheisca-smoke, #F5F5F3);
}

.status-check-icon {
    font-size: 22px !important;
    vertical-align: middle;
}

.status-check-icon.granted {
    color: var(--cheisca-success, #10B981);
}

.status-check-icon.denied {
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.15; /* Sutil y no invasivo como Notion */
}

.matrix-empty-cell {
    text-align: center;
    padding: 60px 20px;
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.6;
    font-size: 0.95rem;
}

.matrix-empty-cell .empty-icon {
    font-size: 32px !important;
    display: block;
    margin: 0 auto 12px auto;
    opacity: 0.4;
}

.matrix-footer-info {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--cheisca-black, #0A0A0A);
    opacity: 0.7;
    background-color: var(--cheisca-white, #FFFFFF);
}

.matrix-footer-info .info-icon {
    font-size: 18px !important;
    color: var(--cheisca-blue, #3B82F6);
}

/* ==========================================================================
   ADAPTATIVO RESPONSIVE (MOBILE-FIRST)
   ========================================================================== */
@media (max-width: 768px) {
    .rbac-header-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rbac-header-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .rbac-action-btn {
        width: 100%;
        justify-content: center;
    }
}