/* Archivo: public/mod_assets/iam/style.css */

/* ==========================================================================
   MASTER STYLESHEET - CHEISCA LIGHT VISUAL IDENTITY
   Restauración Exacta - 100% Persistencia Funcional y Visual
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Manrope:wght@600;700&display=swap');

/* ==========================================================================
   1. VARIABLES GLOBALES (UI KIT)
   ========================================================================== */
:root {
    /* Fondos y Superficies (Light Theme) */
    --cheisca-white: #FFFFFF;
    --cheisca-smoke: #F7F7F5;
    --bg-color: #F8F9FA;
    --surface-color: #FFFFFF;
    
    /* Tipografía Base y Textos */
    --cheisca-black: #151515;
    --text-main: #202124;
    --text-muted: #5F6368;
    
    /* Colores de Acento de Marca */
    --cheisca-gold: #D4AF37;
    --cheisca-orange: #F28C28;
    --cheisca-blue: #3B82F6;
    --cheisca-purple: #7C4DFF;
    --primary-color: #1A73E8;
    --primary-hover: #1557B0;
    --secondary-color: #6200EA;
    
    /* Estados y Feedback */
    --cheisca-danger: #EF4444;
    --cheisca-success: #10B981;
    --success: #0F9D58;
    --warning: #F4B400;
    --danger: #DB4437;
    
    /* UI Elements */
    --cheisca-border: #E5E5E5;
    --border-color: #DADCE0;
    
    /* Tipografía */
    --font-heading: 'Manrope', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Bordes y Radios */
    --radius: 12px;
    --radius-btn: 12px;
    --radius-input: 14px;
    --radius-card: 20px;
    --radius-dialog: 24px;
    --radius-avatar: 50%;
    --step-node-size: 32px;
    
    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.03);
    --shadow-soft: 0 4px 12px rgba(21, 21, 21, 0.03), 0 1px 2px rgba(21, 21, 21, 0.04);
    --shadow-hover: 0 12px 24px rgba(21, 21, 21, 0.06), 0 4px 8px rgba(21, 21, 21, 0.04);
    
    /* Efectos Varios */
    --gradient-brand: linear-gradient(135deg, #1A73E8 0%, #00C6FF 100%);
    --auth-bg: #f4f7fc;
    --input-focus: rgba(26, 115, 232, 0.2);
    --trans-fast: 0.2s ease;
}

/* ==========================================================================
   2. RESETEO Y BASE (MOBILE FIRST)
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
}

body {
    background-color: var(--cheisca-smoke);
    color: var(--cheisca-black);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

a { 
    text-decoration: none; 
    color: inherit; 
    transition: var(--trans-fast); 
}

.hidden { display: none !important; }

.main-content-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.brand-logo { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    font-family: var(--font-heading); 
    font-size: 22px; 
    font-weight: 800; 
}

/* ==========================================================================
   3. ANIMACIONES GLOBALES
   ========================================================================== */
@keyframes aiPulse {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0.6; transform: scale(0.95); }
}

@keyframes skeleton-wave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

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

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

@keyframes progress { 
    0% { stroke-dasharray: 0 100; } 
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse-blue {
    0% { box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(26, 115, 232, 0); }
    100% { box-shadow: 0 0 0 0 rgba(26, 115, 232, 0); }
}

@keyframes slideInRight { 
    from { transform: translateX(100%); opacity: 0; } 
    to { transform: translateX(0); opacity: 1; } 
}

@keyframes status-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.5); opacity: 0; }
}

@keyframes slideUpIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   4. ESTRUCTURAS COMPARTIDAS Y UTILIDADES GLOBALES
   ========================================================================== */
.iam-auth-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.iam-container { 
    width: 100%; 
    max-width: 100%; 
    text-align: center; 
}

.auth-box {
    background: var(--cheisca-white);
    padding: 24px;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--cheisca-border);
    text-align: left;
    transition: box-shadow 0.3s ease;
}

.iam-header { margin-bottom: 24px; text-align: center; }

.iam-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--cheisca-black);
    letter-spacing: -0.02em;
}

.iam-subtitle {
    font-size: 0.95rem;
    color: var(--cheisca-black);
    opacity: 0.6;
    line-height: 1.6;
}

.text-glow-blue { 
    color: var(--cheisca-blue); 
    text-decoration: none; 
    font-weight: 600; 
    transition: opacity 0.2s ease;
}
.text-glow-blue:hover { opacity: 0.8; }

.wide-box {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    animation: fadeIn 0.5s ease-out;
    padding: 16px;
    transition: all 0.3s ease;
}

/* ==========================================================================
   5. COMPONENTES DE FORMULARIO PREMIUM
   ========================================================================== */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.input-group { display: flex; flex-direction: column; gap: 8px; }

.input-group label {
    font-size: 0.875rem;
    color: var(--cheisca-black);
    font-weight: 500;
    opacity: 0.8;
}

.input-group input {
    background: var(--cheisca-white);
    border: 1px solid var(--cheisca-border);
    color: var(--cheisca-black);
    padding: 14px 16px;
    border-radius: var(--radius-input);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group input:focus { 
    border-color: var(--cheisca-blue); 
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

select, .select-premium {
    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='%23151515' 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 16px center;
    background-size: 16px;
    padding-right: 40px !important;
    background-color: var(--cheisca-white);
    border: 1px solid var(--cheisca-border);
    color: var(--cheisca-black);
    padding: 14px 16px;
    border-radius: var(--radius-input);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

textarea, .textarea-premium {
    background-color: var(--cheisca-white);
    border: 1px solid var(--cheisca-border);
    color: var(--cheisca-black);
    padding: 14px 16px;
    border-radius: var(--radius-input);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    resize: vertical;
    min-height: 100px;
    transition: all 0.3s ease;
}

select:focus, textarea:focus, input:focus {
    border-color: var(--cheisca-blue) !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1) !important;
}

.search-container-premium {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--cheisca-white);
    border: 1.5px solid var(--cheisca-border);
    border-radius: var(--radius-input, 14px);
    padding: 0 16px;
    height: 52px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-soft);
}

.search-container-premium:focus-within {
    border-color: var(--cheisca-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background-color: #FFFFFF;
}

.search-container-premium .material-symbols-outlined {
    color: var(--cheisca-black);
    opacity: 0.4;
    font-size: 20px;
}

.search-container-premium input {
    border: none !important;
    background: transparent !important;
    width: 100%;
    height: 100%;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--cheisca-black);
    outline: none;
}

.search-container-premium input::placeholder {
    color: var(--cheisca-black);
    opacity: 0.4;
}

/* ==========================================================================
   6. SISTEMA DE BOTONES (BUTTONS)
   ========================================================================== */
.btn-primary {
    background-color: var(--cheisca-orange);
    color: var(--cheisca-white);
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius-btn);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn-primary:hover:not(:disabled) { 
    transform: translateY(-2px); 
    box-shadow: var(--shadow-soft);
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    background-color: var(--cheisca-white);
    color: var(--cheisca-black);
    border: 1px solid var(--cheisca-black);
    padding: 14px 24px;
    border-radius: var(--radius-btn);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}
.btn-secondary:hover:not(:disabled) {
    background-color: var(--cheisca-smoke);
    transform: translateY(-2px);
}

.btn-tertiary {
    background: transparent;
    color: var(--cheisca-blue);
    border: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.btn-tertiary:hover { opacity: 0.8; }

.btn-gold { background-color: var(--cheisca-gold); color: var(--cheisca-white); }
.mt-20 { margin-top: 24px; }

/* ==========================================================================
   7. MENÚ DEV (MASTER TEST HUB)
   ========================================================================== */
.dev-fab-btn {
    position: fixed;
    bottom: 32px;
    left: 32px;
    width: 60px;
    height: 60px;
    background: var(--cheisca-white);
    border: 1.5px solid var(--cheisca-border);
    color: var(--cheisca-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99999;
    box-shadow: var(--shadow-hover);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dev-fab-btn:hover {
    transform: scale(1.1) rotate(10deg);
    border-color: var(--cheisca-blue);
}

.dev-drawer {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 320px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-right: 1px solid var(--cheisca-border);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    box-shadow: 15px 0 50px rgba(0,0,0,0.05);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateX(-100%);
}

.dev-drawer:not(.hidden) { transform: translateX(0); }
.dev-drawer.hidden { transform: translateX(-100%); }

.dev-drawer-header {
    padding: 24px;
    border-bottom: 1px solid var(--cheisca-smoke);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dev-drawer-header h2 {
    color: var(--cheisca-black);
    font-size: 1.25rem;
    font-weight: 700;
}

#dev-menu-close {
    background: var(--cheisca-smoke);
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    color: var(--cheisca-black);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

#dev-menu-close:hover { opacity: 0.5; }

.dev-drawer-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.dev-drawer-content::-webkit-scrollbar { width: 4px; }
.dev-drawer-content::-webkit-scrollbar-track { background: transparent; }
.dev-drawer-content::-webkit-scrollbar-thumb { background: var(--cheisca-border); border-radius: 8px; }

.dev-nav-group { margin-bottom: 28px; }
.dev-nav-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--cheisca-black);
    opacity: 0.4;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.dev-nav-group h3 span { font-size: 1rem; }

.dev-nav-group a {
    display: block;
    color: var(--cheisca-black);
    text-decoration: none;
    font-size: 0.92rem;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dev-nav-group a:hover {
    background: var(--cheisca-smoke);
    color: var(--cheisca-blue);
    padding-left: 18px;
}

/* ==========================================================================
   8. SKELETON LOADERS
   ========================================================================== */
.skeleton-loader {
    background: linear-gradient(90deg, var(--cheisca-smoke) 25%, #E5E5E5 50%, var(--cheisca-smoke) 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite linear;
    width: 100%;
}

/* ==========================================================================
   9. VISTAS DE MÓDULOS (GUEST LANDING, DISCOVERY, INFO)
   ========================================================================== */
.guest-landing-workspace {
    min-height: 100vh;
    background-color: var(--cheisca-smoke, #F7F7F5);
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.guest-hero-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    max-width: 1200px; 
    width: 100%; 
    margin: 0 auto 20px auto; 
}

.hero-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cheisca-black, #151515);
}

.brand-tag {
    font-size: 0.75rem;
    color: var(--cheisca-purple, #7C4DFF);
    background: rgba(124, 77, 255, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 6px;
    font-weight: 600;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-header-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    text-decoration: none;
}

.login-text-short { display: none; }
.login-text-full { display: inline; }

.user-session-pill {
    display: flex; align-items: center; gap: 10px;
    background: var(--cheisca-white, #FFFFFF); border: 1px solid var(--cheisca-border, #E5E5E5);
    padding: 6px 16px; border-radius: 30px; box-shadow: var(--shadow-soft);
}

.status-dot-active {
    width: 8px; height: 8px; border-radius: 50%;
    background-color: #10B981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.btn-small-action {
    padding: 6px 14px !important; font-size: 0.85rem !important; width: auto !important;
}

.guest-hero-container { 
    max-width: 1200px; 
    width: 100%; 
    margin: 0 auto; 
}

/* Grilla Desktop: 3 Columnas Intactas (300px 1fr 300px) */
.character-select-stage { 
    display: grid !important; 
    grid-template-columns: 300px 1fr 300px !important; 
    gap: 24px !important; 
    background: var(--cheisca-white); 
    border-radius: var(--radius-dialog, 24px); 
    padding: 32px; 
    border: 1px solid var(--cheisca-border); 
    box-shadow: var(--shadow-hover); 
    align-items: center; 
}

.stage-col-left, .stage-col-right { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}

.stage-identity-header {
    display: flex;
    flex-direction: column;
}

.hero-categories-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.agent-role-badge { 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    background: rgba(242, 140, 40, 0.1); 
    color: var(--cheisca-orange); 
    padding: 4px 12px; 
    border-radius: 12px; 
    font-size: 0.75rem; 
    font-weight: 700; 
    width: fit-content; 
}

.stage-agent-title { 
    font-size: 1.8rem; 
    margin: 4px 0 0 0; 
    color: var(--cheisca-black); 
}

.stage-agent-user { 
    font-size: 0.95rem; 
    font-weight: 600; 
    margin: 0; 
}

.stage-collapsible-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stage-info-card { 
    background: var(--cheisca-smoke); 
    padding: 16px; 
    border-radius: var(--radius-card, 16px); 
    border: 1px solid var(--cheisca-border); 
}

.stage-card-label { 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
    font-weight: 700; 
    opacity: 0.5; 
}

.stage-objective-text { 
    font-size: 0.9rem; 
    color: var(--cheisca-black); 
    line-height: 1.5; 
    margin: 6px 0 0 0; 
}

.stage-col-center { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
}

.avatar-showcase-wrapper { 
    position: relative; 
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center; 
}

.avatar-showcase-glow { 
    width: 140px; 
    height: 140px; 
    border-radius: 50%; 
    background: var(--cheisca-white); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 64px; 
    border: 3px solid var(--cheisca-purple); 
    box-shadow: 0 0 32px rgba(124, 77, 255, 0.35); 
}

.avatar-showcase-glow img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.showcase-status-badge { 
    position: relative !important; 
    top: 0 !important; 
    margin-top: 24px !important; 
    z-index: 5; 
    padding: 6px 16px !important; 
    border-radius: 12px !important; 
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2); 
}

.showcase-cta-wrapper { 
    margin-top: 56px !important; 
    width: 100%; 
    display: flex; 
    justify-content: center; 
}

.showcase-btn-cta { 
    width: auto !important; 
    padding: 16px 36px !important; 
    font-size: 1.1rem !important; 
    border-radius: var(--radius-btn, 12px) !important; 
}

.mobile-stage-toggle-wrap {
    display: none !important; /* Oculto en Desktop y Tablet */
}

.star-rating-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; padding: 4px 0; }
.stars-group, .capability-stars-list { color: var(--cheisca-gold); letter-spacing: 2px; }

/* ==========================================================================
   10. FILTROS Y BADGES EN VISTAS
   ========================================================================== */
.filter-chips-container { display: flex !important; flex-wrap: wrap !important; gap: 8px !important; align-items: center; }
.filter-chip { display: inline-flex; align-items: center; background: rgba(124, 77, 255, 0.1); color: var(--cheisca-purple, #7C4DFF); padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; font-weight: 600; margin: 0; }
.provider-badge-tag { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; background: rgba(124, 77, 255, 0.1); color: var(--cheisca-purple, #7C4DFF); padding: 3px 8px; border-radius: 6px; letter-spacing: 0.05em; }

/* ==========================================================================
   11. COMPONENTES DEL CARRUSEL FUTURISTA & CENTRADO PERFECTO
   ========================================================================== */
.selector-carousel-stage {
    background: var(--cheisca-white, #FFFFFF);
    border-radius: var(--radius-card, 20px);
    padding: 20px 24px;
    border: 1px solid var(--cheisca-border, #E5E5E5);
    box-shadow: var(--shadow-soft);
    position: relative;
}

.carousel-stage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 15px;
}

.carousel-title-short { display: none; }
.carousel-title-full { display: inline; }

.btn-catalog-text-short { display: none; }
.btn-catalog-text-full { display: inline; }

.btn-catalog-right {
    background-color: var(--cheisca-white) !important;
    color: var(--cheisca-blue, #3B82F6) !important;
    border: 1.5px solid var(--cheisca-blue, #3B82F6) !important;
    border-radius: var(--radius-btn, 12px) !important;
    padding: 8px 18px !important;
    font-family: var(--font-heading) !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    margin-right: 16px !important;
    box-shadow: var(--shadow-soft);
}

.btn-catalog-right:hover {
    background-color: var(--cheisca-blue, #3B82F6) !important;
    color: var(--cheisca-white, #FFFFFF) !important;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35) !important;
    transform: translateY(-2px);
}

.carousel-viewport-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(247, 247, 245, 0.6) 0%, var(--cheisca-smoke, #F7F7F5) 100%);
    border: 1px solid var(--cheisca-border, #E5E5E5);
}

.carousel-focal-bracket {
    position: absolute;
    top: 10px;
    bottom: 10px;
    width: 24px;
    pointer-events: none;
    z-index: 10;
}

.carousel-focal-bracket.left-bracket {
    left: calc(50% - 122px);
    border-left: 3px solid var(--cheisca-blue, #7CC7D9);
    border-top: 3px solid var(--cheisca-blue, #7CC7D9);
    border-bottom: 3px solid var(--cheisca-blue, #7CC7D9);
    border-radius: 12px 0 0 12px;
    box-shadow: -4px 0 12px rgba(124, 199, 217, 0.35);
}

.carousel-focal-bracket.right-bracket {
    right: calc(50% - 122px);
    border-right: 3px solid var(--cheisca-blue, #7CC7D9);
    border-top: 3px solid var(--cheisca-blue, #7CC7D9);
    border-bottom: 3px solid var(--cheisca-blue, #7CC7D9);
    border-radius: 0 12px 12px 0;
    box-shadow: 4px 0 12px rgba(124, 199, 217, 0.35);
}

.single-row-carousel-track {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 16px;
    overflow-x: auto !important;
    scroll-behavior: smooth !important;
    scroll-snap-type: x mandatory !important;
    padding: 24px 0 !important;
    scrollbar-width: none;
    touch-action: pan-y;
    position: relative;
}
.single-row-carousel-track::-webkit-scrollbar { display: none; }

.single-row-carousel-track::before,
.single-row-carousel-track::after {
    content: '';
    flex: 0 0 calc(50% - 110px);
    scroll-snap-align: none;
}

.carousel-card {
    flex: 0 0 220px !important;
    scroll-snap-align: center !important;
    background: var(--cheisca-white);
    border: 1.5px solid var(--cheisca-border);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0.4;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.carousel-card:hover {
    opacity: 0.7;
    border-color: var(--cheisca-blue, #3B82F6);
}

.carousel-card.is-center-selected, .carousel-card.active {
    border-color: var(--cheisca-purple, #7C4DFF) !important;
    border-width: 2px !important;
    background: var(--cheisca-white) !important;
    opacity: 1 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 8px 24px rgba(124, 77, 255, 0.25) !important;
    z-index: 5;
}

.carousel-nav-bracket {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 25;
    width: 42px;
    height: 64px;
    background: var(--cheisca-white);
    border: 2px solid var(--cheisca-blue, #3B82F6);
    color: var(--cheisca-blue, #3B82F6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.carousel-nav-bracket:hover {
    background: var(--cheisca-blue, #3B82F6);
    color: var(--cheisca-white, #FFFFFF);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
    transform: translateY(-50%) scale(1.08);
}

.carousel-nav-bracket.prev-bracket { left: 8px; border-radius: 14px 4px 4px 14px; }
.carousel-nav-bracket.next-bracket { right: 8px; border-radius: 4px 14px 14px 4px; }

/* ==========================================================================
   12. PANELES DE CONTROL ADMINISTRATIVOS (MDM)
   ========================================================================== */
.iam-admin-view { background-color: var(--cheisca-smoke); min-height: 100vh; padding: 32px 24px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start !important; }
.module-cards-grid, .archetypes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; width: 100%; }

.catalog-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 32px; width: 100%; }
.btn-cta-orange { background-color: var(--cheisca-orange) !important; width: auto !important; padding: 12px 24px !important; }

.toolbar-box, .filter-bar { display: flex; gap: 16px; padding: 16px 20px !important; margin-bottom: 32px; align-items: center; background: var(--cheisca-white); border-radius: 16px; border: 1px solid var(--cheisca-border); box-shadow: var(--shadow-soft); width: 100%; }
.search-container, .search-wrapper { position: relative; flex: 1; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--cheisca-black); opacity: 0.3; font-size: 20px; }
.search-field, .search-input-field { width: 100%; padding: 12px 16px 12px 44px; border-radius: 12px; border: 1px solid var(--cheisca-border); background-color: var(--cheisca-smoke); font-family: var(--font-body); font-size: 0.95rem; outline: none; transition: all 0.2s ease; }
.search-field:focus, .search-input-field:focus { background-color: #fff; border-color: var(--cheisca-blue); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); }
.filter-container, .filter-controls { min-width: 180px; }

.empty-catalog-card { background: var(--cheisca-white); border: 1px solid var(--cheisca-border); border-radius: 24px; padding: 64px 32px; text-align: center; box-shadow: var(--shadow-soft); margin-top: 24px; display: flex; flex-direction: column; align-items: center; width: 100%; }
.empty-icon-wrapper { width: 80px; height: 80px; background: var(--cheisca-smoke); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 24px; }
.empty-icon-wrapper span { font-size: 40px; opacity: 0.2; }

/* Status y Badges */
.badge, .arch-status { display: inline-flex; align-items: center; justify-content: center; padding: 4px 12px; border-radius: 8px; font-family: var(--font-body); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; border: 1px solid transparent; }
.status-active, .badge-success { background-color: rgba(16, 185, 129, 0.1); color: var(--cheisca-success, #10B981); border-color: rgba(16, 185, 129, 0.2); }
.status-inactive, .badge-danger { background-color: rgba(239, 68, 68, 0.1); color: var(--cheisca-danger, #EF4444); border-color: rgba(239, 68, 68, 0.2); }
.status-draft { background-color: var(--cheisca-smoke); color: var(--cheisca-black); opacity: 0.7; border-color: var(--cheisca-border); }
.status-validation, .badge-warning { background-color: rgba(245, 158, 11, 0.1); color: var(--cheisca-warning, #F59E0B); border-color: rgba(245, 158, 11, 0.2); }
.status-archived { background-color: #E5E5E5; color: #666666; border-color: #D1D5DB; }

.badge-ACTIVE { background: rgba(16, 185, 129, 0.1); color: #10B981; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-DRAFT { background: rgba(21, 21, 21, 0.05); color: #151515; border: 1px solid rgba(21, 21, 21, 0.1); }
.badge-INACTIVE { background: rgba(245, 158, 11, 0.1); color: #F59E0B; border: 1px solid rgba(245, 158, 11, 0.2); }

/* ==========================================================================
   13. MEDIA QUERIES (DESKTOP / TABLET INTACTOS + MOBILE OPTIMIZADO)
   ========================================================================== */

/* Mobile Breakpoint (<= 768px) */
@media (max-width: 768px) {
    .guest-landing-workspace { 
        padding: 8px 16px 32px 16px; 
    }
    
    /* Header Móvil Compacto */
    .guest-hero-header {
        padding: 10px 0;
        margin-bottom: 12px;
    }
    .hero-brand .brand-text {
        font-size: 1.15rem;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .brand-tag {
        font-size: 0.65rem;
        padding: 2px 6px;
        margin-left: 0;
    }
    .btn-header-login {
        padding: 6px 12px !important;
        height: 36px !important;
        min-height: 36px !important;
        border-radius: 10px !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
        white-space: nowrap !important;
    }
    .login-text-full { display: none !important; }
    .login-text-short { display: inline !important; font-size: 0.85rem; font-weight: 700; }
    .icon-login { font-size: 18px !important; }

    /* Escenario Principal en Flujo Vertical */
    .character-select-stage { 
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
        padding: 20px 16px !important;
        border-radius: 18px !important;
    }

    /* 1. Nombre y Categorías Arriba */
    .stage-col-left {
        order: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        text-align: center !important;
        align-items: center !important;
        width: 100% !important;
    }
    .stage-identity-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    .hero-categories-chips { 
        justify-content: center !important; 
        margin-bottom: 4px !important; 
    }
    .stage-agent-title { 
        font-size: 1.65rem !important; 
        text-align: center !important; 
    }
    .stage-agent-user { 
        font-size: 0.95rem !important; 
        text-align: center !important; 
        margin: 2px 0 8px 0 !important; 
    }

    /* 2. Avatar y Botón Central */
    .stage-col-center { 
        order: 2 !important; 
        margin-bottom: 8px !important; 
        width: 100% !important;
    }
    .avatar-showcase-glow {
        width: 110px !important;
        height: 110px !important;
        font-size: 52px !important;
    }
    .showcase-status-badge {
        margin-top: 12px !important;
    }
    .showcase-cta-wrapper {
        margin-top: 20px !important;
        width: 100% !important;
    }
    .showcase-btn-cta {
        max-width: 100% !important;
        width: 100% !important;
        height: 48px !important;
        font-size: 1rem !important;
    }

    /* 3. Botón Acordeón */
    .mobile-stage-toggle-wrap {
        order: 3 !important;
        display: block !important;
        width: 100% !important;
        margin-top: 6px !important;
    }
    .btn-toggle-stage-details {
        width: 100% !important;
        height: 42px !important;
        min-height: 42px !important;
        border-radius: 12px !important;
        font-size: 0.85rem !important;
        font-weight: 600 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        background: var(--cheisca-smoke) !important;
        border: 1px solid var(--cheisca-border) !important;
        color: var(--cheisca-black) !important;
        cursor: pointer !important;
    }

    /* 4. Tarjetas Colapsables en Móvil */
    .character-select-stage:not(.is-expanded) .stage-collapsible-group {
        display: none !important;
    }
    .character-select-stage.is-expanded .stage-collapsible-group {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
        animation: fadeIn 0.25s ease;
    }
    .stage-col-right {
        order: 4 !important;
        width: 100% !important;
    }

    /* Cabecera del Carrusel en Móvil */
    .carousel-stage-header {
        padding: 10px 4px !important;
    }
    .carousel-title-full { display: none !important; }
    .carousel-title-short { display: inline !important; font-size: 0.95rem; font-weight: 700; }
    .btn-catalog-text-full { display: none !important; }
    .btn-catalog-text-short { display: inline !important; font-size: 0.82rem; font-weight: 600; }
    .btn-catalog-right {
        padding: 6px 12px !important;
        height: 36px !important;
        min-height: 36px !important;
        border-radius: 10px !important;
        margin-right: 0 !important;
        gap: 4px !important;
    }

    /* Pista de Carrusel en Móvil */
    .carousel-focal-bracket.left-bracket { left: calc(50% - 102px); }
    .carousel-focal-bracket.right-bracket { right: calc(50% - 102px); }
    .single-row-carousel-track { padding: 16px 0 !important; }
    .carousel-card { flex: 0 0 180px !important; padding: 12px; }
    .single-row-carousel-track::before,
    .single-row-carousel-track::after {
        flex: 0 0 calc(50% - 90px);
    }
    .carousel-nav-bracket { display: none !important; }
}

/* Tablet Breakpoints (769px - 900px) */
@media (min-width: 769px) and (max-width: 900px) {
    .iam-auth-view { padding: 32px; }
    .iam-container { max-width: 480px; }
    .auth-box { padding: 32px; }
    .iam-title { font-size: 2.25rem; }
    .dev-drawer { width: 320px; }
    .character-select-stage { grid-template-columns: 240px 1fr 240px !important; gap: 16px !important; }
}

/* Desktop Breakpoints (>= 901px) */
@media (min-width: 901px) {
    .iam-auth-view { padding: 48px; }
    .iam-container { max-width: 520px; }
    .auth-box { padding: 48px; border-radius: var(--radius-dialog); max-width: 100% !important; margin-left: 0; }
    .iam-title { font-size: 2.5rem; letter-spacing: -0.03em; }
    .iam-subtitle { font-size: 1.125rem; }
    .input-group label { font-size: 0.95rem; }
    .input-group input { padding: 16px 20px; font-size: 1.05rem; }
    .btn-primary, .btn-secondary { padding: 16px 32px; font-size: 1.125rem; }
    .dev-fab-btn { bottom: 48px; left: 48px; width: 64px; height: 64px; }
    .dev-drawer { width: 380px; }
    .wide-box { max-width: 1200px; padding: 0 40px; }
}

/* ==========================================================================
   EP-06: MODAL DE CATÁLOGO COMPLETO (ESTILO CHARACTER SELECTOR)
   ========================================================================== */
.cheisca-dialog-catalog {
    border: none !important;
    border-radius: var(--radius-dialog, 24px) !important;
    padding: 0 !important;
    max-width: 940px !important;
    width: 92vw !important;
    max-height: 85vh !important;
    margin: auto !important;
    background: var(--cheisca-white) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35) !important;
    border: 2px solid var(--cheisca-blue, #3B82F6) !important;
    overflow: hidden;
}

.cheisca-dialog-catalog::backdrop {
    background: rgba(10, 10, 10, 0.7) !important;
    backdrop-filter: blur(10px) !important;
}

.catalog-modal-content {
    padding: 28px;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.catalog-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.catalog-modal-layout {
    display: grid !important;
    grid-template-columns: 180px 1fr !important;
    gap: 20px !important;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.catalog-categories-sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-right: 1px solid var(--cheisca-border);
    padding-right: 16px;
    overflow-y: auto;
}

.catalog-cards-grid, #catalog-grid-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 16px !important;
    overflow-y: auto !important;
    padding: 4px 8px 12px 4px !important;
    max-height: 480px;
    align-items: stretch !important;
}

.catalog-agent-card {
    background: var(--cheisca-white) !important;
    border: 2px solid var(--cheisca-border) !important;
    border-radius: 16px !important;
    padding: 16px 12px !important;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    position: relative;
    box-sizing: border-box !important;
    height: 100% !important;
    justify-content: space-between !important;
}

.catalog-agent-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: var(--cheisca-blue, #3B82F6) !important;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2) !important;
}

.catalog-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--cheisca-smoke);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 8px;
    border: 2px solid var(--cheisca-purple);
    box-shadow: 0 4px 12px rgba(124, 77, 255, 0.15);
}

.catalog-card-name {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--cheisca-black);
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.catalog-card-username {
    font-size: 0.75rem;
    color: var(--cheisca-purple);
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.catalog-card-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(124, 77, 255, 0.1);
    color: var(--cheisca-purple);
    padding: 3px 8px;
    border-radius: 6px;
    margin-top: auto;
}

.category-tab-btn {
    background: var(--cheisca-smoke);
    border: 1px solid var(--cheisca-border);
    padding: 12px 16px;
    border-radius: 12px;
    text-align: left;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cheisca-black);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.category-tab-btn:hover {
    background: var(--cheisca-white);
    border-color: var(--cheisca-blue);
    color: var(--cheisca-blue);
}

.category-tab-btn.active {
    background: var(--cheisca-orange, #F28C28) !important;
    color: var(--cheisca-white) !important;
    border-color: var(--cheisca-orange) !important;
    box-shadow: 0 4px 12px rgba(242, 140, 40, 0.3);
}

@media (max-width: 768px) {
    .cheisca-dialog-catalog {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }
    .catalog-modal-layout {
        grid-template-columns: 1fr !important;
    }
    .catalog-cards-grid, #catalog-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
        gap: 12px !important;
    }
    .catalog-categories-sidebar {
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--cheisca-border);
        padding-right: 0;
        padding-bottom: 12px;
    }
    .category-tab-btn {
        white-space: nowrap;
        padding: 8px 14px;
    }
}