/* ============================================================ */
/* PIPELINE NEURO v20.0 - DISEÑO PRO DASHBOARD                  */
/* ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6C5CE7;
    --primary-light: #A29BFE;
    --primary-dark: #4834D4;
    --secondary: #00CEC9;
    --success: #00B894;
    --warning: #FDCB6E;
    --danger: #FF7675;
    --info: #74B9FF;
    --dark: #2D3436;
    --gray: #636E72;
    --gray-light: #B2BEC3;
    --light: #DFE6E9;
    --bg: #F0F2F5;
    --white: #FFFFFF;
    --shadow: 0 2px 16px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 32px rgba(0,0,0,0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--dark);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.screen {
    display: none;
    height: 100vh;
    width: 100vw;
    overflow-y: auto;
}
.screen.active { display: flex; flex-direction: column; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }

/* ============================================================ */
/* REGISTRO */
/* ============================================================ */
#registroScreen {
    background: linear-gradient(135deg, #6C5CE7 0%, #0984E3 100%);
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-height: 100vh;
}

#registroScreen .container {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 32px 28px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-height: 95vh;
    overflow-y: auto;
}

.logo { text-align: center; margin-bottom: 24px; }
.logo-icon {
    display: inline-block;
    font-size: 48px;
    color: var(--primary);
    background: rgba(108,92,231,0.1);
    padding: 16px;
    border-radius: 50%;
}
.logo h1 {
    font-size: 24px;
    margin-top: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}
.logo p { color: var(--gray); font-size: 14px; margin-top: 4px; font-weight: 500; }

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 5px;
}
.form-group label i { margin-right: 8px; color: var(--primary); }
.form-group input, .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: var(--transition);
    background: var(--white);
    font-family: var(--font);
}
.form-group input:focus, .form-group select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(108,92,231,0.08);
}
.form-group small { display: block; font-size: 11px; color: var(--gray); margin-top: 4px; }

.idioma-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}
.idioma-row .idioma-input {
    flex: 2;
    padding: 10px 12px;
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--white);
}
.idioma-row .idioma-input:focus {
    border-color: var(--primary);
    outline: none;
}
.idioma-row .nivel-select {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--white);
}
.btn-remove-idioma {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 18px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 50%;
    transition: var(--transition);
    flex-shrink: 0;
}
.btn-remove-idioma:hover { background: rgba(255,118,117,0.1); }
.btn-add-idioma {
    background: none;
    border: 2px dashed var(--light);
    color: var(--gray);
    padding: 10px;
    border-radius: var(--radius-sm);
    width: 100%;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-family: var(--font);
}
.btn-add-idioma:hover { border-color: var(--primary); color: var(--primary); }

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(108,92,231,0.3); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    padding: 10px 20px;
    background: var(--white);
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
    color: var(--dark);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* ============================================================ */
/* HEADER PRO */
/* ============================================================ */
header {
    background: var(--white);
    padding: 10px 16px 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}
.brand i { font-size: 24px; }
.brand span { background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 16px;
    background: var(--bg);
    border-radius: 24px;
    cursor: pointer;
    transition: var(--transition);
}
.user-badge:hover { background: var(--light); }
.user-name { font-weight: 600; font-size: 14px; }
.user-avatar { font-size: 24px; color: var(--primary); }

.icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--gray);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: var(--transition);
}
.icon-btn:hover { background: var(--bg); color: var(--primary); }

/* Progress Bar */
.progress-bar {
    margin-top: 8px;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}
.progress-label {
    position: absolute;
    right: 0;
    top: -18px;
    font-size: 11px;
    color: var(--gray);
    font-weight: 600;
}

/* Neuro Stats */
.neuro-stats {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 10px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}
.neuro-stat {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}
.neuro-stat .stat-icon { font-size: 12px; }
.neuro-stat .stat-value { font-size: 14px; font-weight: 700; color: var(--dark); }
.neuro-stat .stat-label { font-size: 9px; color: var(--gray); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }

/* ============================================================ */
/* BARRAS DE ACTIVIDAD - VIGÍA Y CENTINELA */
/* ============================================================ */

.activity-container {
    display: flex;
    gap: 12px;
    margin-top: 6px;
    padding: 6px 10px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}

.activity-bar-wrapper {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.activity-bar-wrapper .activity-label {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.activity-bar-wrapper .activity-label .activity-icon {
    font-size: 10px;
}

.activity-bar-wrapper .activity-label .activity-value {
    font-weight: 700;
    font-size: 10px;
}

.activity-status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 3px;
    animation: dotPulse 1.5s ease-in-out infinite;
    vertical-align: middle;
}

.activity-status-dot.online {
    background: #00B894;
    box-shadow: 0 0 8px rgba(0,184,148,0.5);
}
.activity-status-dot.offline {
    background: #FF7675;
    box-shadow: 0 0 8px rgba(255,118,117,0.3);
    animation: none;
}
.activity-status-dot.busy {
    background: #FDCB6E;
    box-shadow: 0 0 8px rgba(253,203,110,0.5);
    animation: dotPulse 0.6s ease-in-out infinite;
}
.activity-status-dot.activo {
    background: #00CEC9;
    box-shadow: 0 0 8px rgba(0,206,201,0.5);
}
.activity-status-dot.fatiga {
    background: #FDCB6E;
    box-shadow: 0 0 8px rgba(253,203,110,0.4);
    animation: dotPulse 1s ease-in-out infinite;
}
.activity-status-dot.critico {
    background: #FF7675;
    box-shadow: 0 0 8px rgba(255,118,117,0.5);
    animation: dotPulse 0.4s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

.activity-bar-track {
    width: 100%;
    height: 5px;
    background: rgba(0,0,0,0.06);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.activity-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    position: relative;
}

.activity-bar-fill.vigia {
    background: linear-gradient(90deg, #6C5CE7, #A29BFE);
}
.activity-bar-fill.vigia.online {
    background: linear-gradient(90deg, #00B894, #55EFC4);
    box-shadow: 0 0 12px rgba(0,184,148,0.2);
}
.activity-bar-fill.vigia.busy {
    background: linear-gradient(90deg, #FDCB6E, #F9CA24);
    animation: pulseBar 0.8s ease-in-out infinite;
}
.activity-bar-fill.vigia.offline {
    background: linear-gradient(90deg, #FF7675, #FD79A8);
}

.activity-bar-fill.centinela {
    background: linear-gradient(90deg, #00CEC9, #81ECEC);
}
.activity-bar-fill.centinela.activo {
    background: linear-gradient(90deg, #00CEC9, #55EFC4);
    box-shadow: 0 0 12px rgba(0,206,201,0.2);
}
.activity-bar-fill.centinela.fatiga {
    background: linear-gradient(90deg, #FDCB6E, #F9CA24);
    animation: pulseBar 1.2s ease-in-out infinite;
}
.activity-bar-fill.centinela.critico {
    background: linear-gradient(90deg, #FF7675, #FD79A8);
    animation: pulseBar 0.5s ease-in-out infinite;
}
.activity-bar-fill.centinela.offline {
    background: linear-gradient(90deg, #FF7675, #FD79A8);
}

@keyframes pulseBar {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.activity-bar-fill.vigia.online::after,
.activity-bar-fill.centinela.activo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.activity-tooltip {
    font-size: 10px;
    color: var(--gray);
    padding: 2px 8px;
    background: var(--white);
    border-radius: 4px;
    box-shadow: var(--shadow);
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 10;
}

.activity-bar-wrapper:hover .activity-tooltip {
    display: block;
}

/* ============================================================ */
/* MAIN CONTENT */
/* ============================================================ */
main {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 80px;
    background: var(--bg);
}
.view { display: none; }
.view.active { display: block; animation: fadeUp 0.3s ease; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.module-view {
    display: none;
    animation: fadeUp 0.3s ease;
}
.module-view.active { display: block; }

/* ============================================================ */
/* DASHBOARD GRID */
/* ============================================================ */
.dashboard-header {
    margin-bottom: 20px;
}
.dashboard-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--dark);
}
.dashboard-header p {
    color: var(--gray);
    font-size: 14px;
    margin-top: 2px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.dash-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    border: 1px solid transparent;
}
.dash-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}
.dash-card:active { transform: scale(0.98); }

.dash-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--white);
    font-size: 20px;
}
.dash-card-content {
    flex: 1;
    min-width: 0;
}
.dash-card-content h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
}
.dash-card-meta {
    font-size: 13px;
    color: var(--gray);
    margin-top: 2px;
}
.dash-card-progress {
    margin-top: 8px;
}
.dash-progress-bar {
    height: 4px;
    background: var(--bg);
    border-radius: 2px;
    overflow: hidden;
}
.dash-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.dash-card-arrow {
    color: var(--gray-light);
    font-size: 16px;
    transition: var(--transition);
    flex-shrink: 0;
}
.dash-card:hover .dash-card-arrow {
    color: var(--primary);
    transform: translateX(4px);
}

/* ============================================================ */
/* MÓDULOS - HEADER Y BREADCRUMB */
/* ============================================================ */
.module-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--light);
}
.btn-back {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--gray);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: var(--transition);
}
.btn-back:hover { background: var(--bg); color: var(--primary); }

.module-title h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
}
.module-breadcrumb {
    font-size: 12px;
    color: var(--gray-light);
    display: block;
    margin-top: 2px;
}
.module-content { padding-bottom: 20px; }

/* Breadcrumb Nav */
.breadcrumb-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--light);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray);
    z-index: 100;
    font-weight: 500;
}
.breadcrumb-item {
    cursor: pointer;
    transition: var(--transition);
    padding: 4px 8px;
    border-radius: 6px;
}
.breadcrumb-item:hover { background: var(--bg); color: var(--primary); }
.breadcrumb-item.active { color: var(--primary); font-weight: 600; }
.breadcrumb-separator { color: var(--gray-light); }

/* ============================================================ */
/* ESTUDIAR - CARD */
/* ============================================================ */
.card-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    margin-bottom: 16px;
}
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px 24px;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid transparent;
    transition: var(--transition);
}
.card:hover { border-color: var(--primary-light); }

.card .card-badge {
    font-size: 11px;
    padding: 4px 14px;
    border-radius: 20px;
    background: rgba(108,92,231,0.08);
    color: var(--primary);
    font-weight: 600;
    display: inline-block;
    margin-bottom: 12px;
}
.card .card-hanzi {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: 2px;
}
.card .card-pinyin {
    font-size: 18px;
    color: var(--gray);
    margin-top: 6px;
    font-weight: 400;
}
.card .card-traduccion {
    font-size: 22px;
    font-weight: 600;
    color: var(--primary);
    margin-top: 14px;
    padding-top: 14px;
    border-top: 2px solid var(--bg);
}
.card .card-palabras {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}
.card .card-palabra {
    background: var(--bg);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}
.card .card-palabra .tipo {
    color: var(--gray);
    font-size: 10px;
    font-weight: 400;
}
.card .card-progress {
    margin-top: 16px;
    font-size: 13px;
    color: var(--gray);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

/* Study Actions */
.study-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px;
    max-width: 500px;
    margin: 0 auto 12px;
}
.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 8px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
    color: var(--white);
}
.action-btn i { font-size: 18px; }
.action-btn:active { transform: scale(0.92); }
.action-btn.success { background: var(--success); }
.action-btn.success:hover { box-shadow: 0 4px 16px rgba(0,184,148,0.3); transform: translateY(-2px); }
.action-btn.warning { background: var(--warning); color: var(--dark); }
.action-btn.warning:hover { box-shadow: 0 4px 16px rgba(253,203,110,0.3); transform: translateY(-2px); }
.action-btn.info { background: var(--info); }
.action-btn.info:hover { box-shadow: 0 4px 16px rgba(116,185,255,0.3); transform: translateY(-2px); }
.action-btn.danger { background: var(--danger); }
.action-btn.danger:hover { box-shadow: 0 4px 16px rgba(255,118,117,0.3); transform: translateY(-2px); }

.navigation-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    max-width: 500px;
    margin: 0 auto;
}
.nav-btn {
    padding: 10px 16px;
    background: var(--white);
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 16px;
    color: var(--dark);
}
.nav-btn:hover { border-color: var(--primary); color: var(--primary); transform: scale(1.05); }
.counter { font-size: 14px; color: var(--gray); font-weight: 500; }

/* ============================================================ */
/* GRAMÁTICA */
/* ============================================================ */
.grammar-grid { display: grid; gap: 14px; }
.grammar-group {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}
.grammar-group h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}
.grammar-group .grammar-item {
    display: inline-block;
    background: var(--bg);
    padding: 4px 14px;
    border-radius: 20px;
    margin: 3px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}
.grammar-group .grammar-item:hover {
    background: var(--primary-light);
    color: var(--white);
    transform: translateY(-2px);
}

/* ============================================================ */
/* HISTORIAS */
/* ============================================================ */
.stories-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.stories-grid { display: grid; gap: 12px; }
.story-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    border-left: 4px solid var(--primary-light);
}
.story-item:hover { transform: translateX(6px); box-shadow: var(--shadow-hover); }
.story-item .story-title { font-size: 16px; font-weight: 700; }
.story-item .story-meta { font-size: 13px; color: var(--gray); margin-top: 4px; }
.story-status {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
}
.status-green { background: rgba(0,184,148,0.12); color: var(--success); }
.status-yellow { background: rgba(253,203,110,0.12); color: #D4A000; }
.status-red { background: rgba(255,118,117,0.12); color: var(--danger); }

/* ============================================================ */
/* CHAT - VIGÍA */
/* ============================================================ */
.chat-container {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    height: 400px;
    display: flex;
    flex-direction: column;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chat-messages .message {
    display: flex;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    max-width: 85%;
    font-size: 14px;
    line-height: 1.6;
    animation: fadeUp 0.3s ease;
}
.chat-messages .message.system {
    background: var(--bg);
    align-self: flex-start;
}
.chat-messages .message.user {
    background: var(--primary);
    color: var(--white);
    align-self: flex-end;
}
.chat-messages .message.vigia {
    background: rgba(0,206,201,0.08);
    align-self: flex-start;
    border-left: 3px solid var(--secondary);
}
.chat-messages .message .message-content { flex: 1; }
.chat-input {
    display: flex;
    padding: 12px;
    border-top: 1px solid var(--light);
    gap: 10px;
}
.chat-input input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
}
.chat-input input:focus {
    border-color: var(--primary);
    outline: none;
}
.chat-input button {
    padding: 10px 18px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
.chat-input button:hover { background: var(--primary-dark); }

/* ============================================================ */
/* HERRAMIENTAS */
/* ============================================================ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.tool-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    font-family: var(--font);
}
.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}
.tool-card i {
    font-size: 32px;
    color: var(--primary);
    display: block;
    margin-bottom: 8px;
}
.tool-card span {
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
    display: block;
}
.tool-card small {
    font-size: 11px;
    color: var(--gray);
    display: block;
    margin-top: 2px;
}

/* ============================================================ */
/* MODALES */
/* ============================================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    z-index: 200;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal.open { display: flex; }
.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: scaleIn 0.3s ease;
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--light);
}
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
    transition: var(--transition);
}
.modal-close:hover { color: var(--danger); transform: rotate(90deg); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }

.json-textarea {
    width: 100%;
    min-height: 300px;
    padding: 12px;
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
    background: var(--bg);
}
.json-textarea:focus { border-color: var(--primary); outline: none; }

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}
.modal-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.modal-actions button:hover { transform: translateY(-2px); }
.modal-actions .btn-primary { background: var(--primary); color: var(--white); }
.modal-actions .btn-success { background: var(--success); color: var(--white); }

/* ============================================================ */
/* TOAST */
/* ============================================================ */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 300;
    animation: toastIn 0.4s ease;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--dark); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================ */
/* OFFLINE BANNER */
/* ============================================================ */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--danger);
    color: var(--white);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    z-index: 500;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================ */
/* INDICADORES EN HEADER */
/* ============================================================ */
.vigia-indicator, .centinela-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--bg);
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
}

.vigia-dot, .centinela-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.vigia-dot.online {
    background: #00B894;
    box-shadow: 0 0 8px rgba(0,184,148,0.5);
}
.vigia-dot.offline {
    background: #FF7675;
    box-shadow: 0 0 8px rgba(255,118,117,0.3);
}

.centinela-dot.activo {
    background: #00CEC9;
    box-shadow: 0 0 8px rgba(0,206,201,0.5);
}
.centinela-dot.fatiga {
    background: #FDCB6E;
}
.centinela-dot.offline {
    background: #FF7675;
}

.vigia-status, .centinela-status {
    font-size: 9px;
    font-weight: 600;
    color: var(--gray);
}
.vigia-status.online { color: #00B894; }
.vigia-status.offline { color: #FF7675; }
.centinela-status.activo { color: #00CEC9; }
.centinela-status.fatiga { color: #FDCB6E; }
.centinela-status.offline { color: #FF7675; }

/* ============================================================ */
/* RESPONSIVE */
/* ============================================================ */
@media (max-width: 480px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .neuro-stats { flex-wrap: wrap; }
    .neuro-stat { flex: 1 1 45%; }
    .study-actions { grid-template-columns: 1fr 1fr; }
    .tools-grid { grid-template-columns: 1fr 1fr; }
    .module-header { flex-wrap: wrap; gap: 8px; }
    .brand span { font-size: 14px; }
    .user-name { font-size: 12px; }
    .card { padding: 20px 16px; }
    .card .card-hanzi { font-size: 24px; }
    .breadcrumb-nav { font-size: 12px; padding: 8px 16px; }
    #registroScreen .container { padding: 20px 16px; }
    
    .activity-bar-wrapper { min-width: 80px; }
    .activity-bar-wrapper .activity-label { font-size: 8px; }
    .activity-bar-wrapper .activity-label .activity-value { font-size: 9px; }
    .activity-bar-track { height: 4px; }
    .neuro-stat .stat-value { font-size: 12px; }
    .neuro-stat .stat-label { font-size: 8px; }
}

@media (min-width: 768px) {
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .card { max-width: 600px; padding: 36px 32px; }
    .study-actions { max-width: 600px; }
    main { padding: 24px 32px 80px; }
}

@media (min-width: 1024px) {
    .dashboard-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================ */
/* TEMAS - ESTILOS */
/* ============================================================ */

.temas-grid {
    display: grid;
    gap: 16px;
}

.tema-card {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tema-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.historia-item {
    background: var(--white);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--gray);
    transition: all 0.3s ease;
}

.historia-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-hover);
}

.historia-item.completada {
    border-left-color: var(--success);
}

.historia-item.en_curso {
    border-left-color: var(--warning);
}

.historia-item.pendiente {
    border-left-color: var(--gray);
}

@media (max-width: 480px) {
    .tema-card { padding: 16px; }
    .historia-item { padding: 12px; }
}

/* ============================================================ */
/* CHAT PRO - ESTILOS COMPLETOS */
/* ============================================================ */

.chat-pro-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 500px;
    max-height: 70vh;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.chat-pro-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--light);
    background: var(--bg);
}

.chat-pro-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-pro-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 18px;
}

.chat-pro-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--white);
}

.chat-pro-status.online {
    background: var(--success);
    box-shadow: 0 0 12px rgba(0,184,148,0.5);
}

.chat-pro-status.offline {
    background: var(--danger);
}

.chat-pro-title h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--dark);
}

.chat-pro-title .chat-pro-model {
    font-size: 11px;
    font-weight: 400;
    color: var(--gray-light);
    margin-left: 6px;
}

.chat-pro-subtitle {
    font-size: 12px;
    color: var(--gray);
    margin: 0;
}

.chat-pro-actions {
    display: flex;
    gap: 4px;
}

.chat-pro-actions .icon-btn {
    padding: 6px 8px;
    font-size: 14px;
}

/* MÉTRICAS */
.chat-pro-metrics {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--light);
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.metric-item:hover {
    background: var(--white);
}

.metric-item .metric-icon {
    font-size: 14px;
}

.metric-item .metric-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
}

.metric-item .metric-label {
    font-size: 9px;
    color: var(--gray);
    font-weight: 600;
    text-transform: uppercase;
}

/* SUGERENCIAS */
.chat-pro-suggestions {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--light);
    background: var(--white);
}

.suggestion-chip {
    padding: 4px 12px;
    border: 1px solid var(--light);
    border-radius: 20px;
    background: var(--white);
    font-size: 12px;
    font-weight: 500;
    color: var(--dark);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.suggestion-chip:hover {
    border-color: var(--primary);
    background: rgba(108,92,231,0.05);
    transform: translateY(-2px);
}

/* MENSAJES */
.chat-pro-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-pro-messages .message {
    display: flex;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    max-width: 85%;
    font-size: 14px;
    line-height: 1.6;
    animation: fadeUp 0.3s ease;
}

.chat-pro-messages .message.system {
    background: var(--bg);
    align-self: flex-start;
    border-left: 3px solid var(--primary);
}

.chat-pro-messages .message.user {
    background: var(--primary);
    color: var(--white);
    align-self: flex-end;
}

.chat-pro-messages .message.assistant {
    background: rgba(108,92,231,0.06);
    align-self: flex-start;
    border-left: 3px solid var(--secondary);
}

.chat-pro-messages .message .message-content {
    flex: 1;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-pro-messages .message .message-content strong {
    color: var(--primary);
}

.chat-pro-messages .message.user .message-content strong {
    color: var(--white);
}

/* INPUT */
.chat-pro-input {
    border-top: 1px solid var(--light);
    padding: 12px;
    background: var(--white);
}

.chat-pro-input textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
    resize: vertical;
    transition: var(--transition);
    min-height: 50px;
    max-height: 120px;
}

.chat-pro-input textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(108,92,231,0.08);
}

.chat-pro-input-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
    gap: 8px;
}

.chat-pro-send {
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.chat-pro-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(108,92,231,0.3);
}

/* TYPING INDICATOR */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    align-items: center;
    align-self: flex-start;
}

.typing-indicator .dot {
    width: 8px;
    height: 8px;
    background: var(--gray-light);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* ============================================================ */
/* CENTRO DE CONTROL - ESTILOS PROFESIONALES                     */
/* ============================================================ */

.config-container.neuro-control-center {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.config-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--light);
}

.config-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
}

.config-header h2 i {
    color: var(--primary);
    margin-right: 12px;
}

.config-header p {
    color: var(--gray);
    font-size: 16px;
    margin-top: 4px;
}

/* Secciones */
.config-section {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--light);
    transition: all 0.3s ease;
}

.config-section:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.config-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-section h3 i {
    color: var(--primary);
}

/* Grid de 2 columnas */
.config-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.config-item label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 6px;
}

.config-item input, .config-item select {
    padding: 10px 14px;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font);
    transition: all 0.3s;
}

.config-item input:focus, .config-item select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

.preference-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.preference-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
    cursor: pointer;
}

/* Tarjetas de Idiomas */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.language-card {
    background: var(--bg);
    border-radius: 12px;
    padding: 16px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.language-card.active {
    border-color: var(--primary);
    background: var(--primary)04;
}

.language-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.language-icon {
    font-size: 28px;
}

.language-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    flex: 1;
}

.language-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
}

.active-badge {
    background: var(--success)15;
    color: var(--success);
}

.inactive-badge {
    background: var(--bg);
    color: var(--gray);
}

.language-card-body {
    margin-bottom: 12px;
}

.language-level {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.level-label {
    font-size: 12px;
    color: var(--gray);
}

.level-value {
    font-size: 16px;
    font-weight: 700;
}

.progress-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-label {
    font-size: 11px;
    color: var(--gray);
    min-width: 80px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray);
    min-width: 40px;
    text-align: right;
}

.language-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 1px solid var(--light);
    padding-top: 12px;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 11px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: var(--font);
}

.btn-sm.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-sm.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-sm.btn-secondary {
    background: var(--light);
    color: var(--dark);
}
.btn-sm.btn-secondary:hover {
    background: var(--gray-light);
}

.btn-sm.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-sm.btn-danger:hover {
    background: var(--danger-dark);
}

/* Progreso de Niveles */
.levels-progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.level-progress-card {
    background: var(--bg);
    border-radius: 10px;
    padding: 14px 16px;
}

.level-progress-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.level-emoji {
    font-size: 20px;
}

.level-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    flex: 1;
}

.level-stats {
    font-size: 11px;
    color: var(--gray);
}

.level-bar {
    height: 4px;
    margin: 4px 0;
}

.level-badge.complete {
    font-size: 10px;
    color: var(--success);
    font-weight: 600;
}

/* Tarjetas de Estadísticas Visuales */
.stats-grid-visual {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.stat-card {
    background: var(--bg);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    font-size: 28px;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.2;
}

.stat-label {
    font-size: 11px;
    color: var(--gray);
    font-weight: 500;
}

/* Colores específicos para tarjetas de estadísticas */
.stat-card.neuro-score .stat-value { color: var(--primary); }
.stat-card.rcn .stat-value { color: var(--secondary); }
.stat-card.efficiency .stat-value { color: var(--success); }
.stat-card.streak .stat-value { color: var(--warning); }
.stat-card.phrases .stat-value { color: #0984E3; }
.stat-card.words .stat-value { color: #E17055; }
.stat-card.stories .stat-value { color: #A29BFE; }
.stat-card.topics .stat-value { color: #FDCB6E; }

/* Empty State */
.empty-state {
    padding: 30px;
    text-align: center;
    color: var(--gray);
    background: var(--bg);
    border-radius: 8px;
    border: 2px dashed var(--light);
}

/* Responsive para el Centro de Control */
@media (max-width: 768px) {
    .config-grid-2 {
        grid-template-columns: 1fr;
    }
    .languages-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid-visual {
        grid-template-columns: repeat(2, 1fr);
    }
    .levels-progress-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid-visual {
        grid-template-columns: 1fr;
    }
    .levels-progress-grid {
        grid-template-columns: 1fr;
    }
    .config-section {
        padding: 16px;
    }
    .config-header h2 {
        font-size: 22px;
    }
}

/* ============================================================ */
/* ANIMACIONES Y MEJORAS */
/* ============================================================ */

/* Animaciones para celebraciones */
@keyframes confetiFall {
    0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 0.8; }
    100% { transform: translateY(100vh) rotate(720deg) scale(0.5); opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Estilos para recomendaciones */
.recomendacion-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    margin-bottom: 10px;
    transition: var(--transition);
}

.recomendacion-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-hover);
}

.recomendacion-card .recomendacion-titulo {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.recomendacion-card .recomendacion-descripcion {
    font-size: 13px;
    color: var(--gray);
    margin-top: 4px;
}

.recomendacion-card .recomendacion-progreso {
    font-size: 12px;
    color: var(--gray-light);
    margin-top: 8px;
}

/* Badge de bonus */
.bonus-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: linear-gradient(135deg, #FDCB6E, #F9CA24);
    color: var(--dark);
    animation: pulseBonus 2s ease-in-out infinite;
}

@keyframes pulseBonus {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(253,203,110,0.3); }
}

/* Estilos para el examen pro */
.examen-container {
    max-width: 600px;
    margin: 0 auto;
}

.examen-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.examen-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
}

.examen-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.examen-puntuacion {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    min-width: 60px;
    text-align: right;
}

/* Prevenir flicker en carga */
#registroScreen {
    display: none;
}

#registroScreen.active {
    display: flex !important;
}

#mainScreen {
    display: none;
}

#mainScreen.active {
    display: block !important;
}

/* ============================================================ */
/* BARRA NEURO - ESTILOS AVANZADOS                              */
/* ============================================================ */

/* Barra de progreso neuro con efecto de brillo */
.language-card .progress-fill.neuro-fill {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #6C5CE7, #00CEC9, #00B894);
    border-radius: 3px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Efecto shimmer (ondas de plasticidad neuronal) */
.language-card .progress-fill.neuro-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.25) 30%, 
        rgba(255,255,255,0.25) 50%, 
        rgba(255,255,255,0.25) 70%, 
        transparent 100%
    );
    animation: neuroShimmer 3s ease-in-out infinite;
    transform: translateX(-100%);
}

@keyframes neuroShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Porcentaje dentro de la barra */
.language-card .progress-fill.neuro-fill .progress-percent {
    font-size: 9px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
    margin-right: 4px;
}

/* Detalles neuro en línea */
.language-card .neuro-details {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--gray-light);
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed var(--light);
}

.language-card .neuro-details strong {
    color: var(--dark);
    font-weight: 700;
}

.language-card .neuro-details span {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Estado del nivel */
.language-card .level-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--bg);
}

/* Badge de idioma activo más destacado */
.language-card.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary)02, var(--primary)06);
    box-shadow: 0 4px 20px rgba(108,92,231,0.08);
}

.language-card.active .language-name {
    color: var(--primary);
}

/* Responsive para detalles neuro */
@media (max-width: 480px) {
    .language-card .neuro-details {
        flex-wrap: wrap;
        gap: 2px;
        font-size: 9px;
    }
    
    .language-card .neuro-details span {
        flex: 1 1 30%;
        justify-content: center;
    }
    
    .language-card .progress-fill.neuro-fill .progress-percent {
        font-size: 8px;
    }
}

/* ============================================================
   HEADER RESPONSIVE
   ============================================================ */

/* Móvil muy pequeño (menos de 400px) */
@media (max-width: 400px) {
    .header-content {
        gap: 3px 6px !important;
        padding: 4px 6px !important;
    }
    
    .brand {
        font-size: 13px !important;
        gap: 4px !important;
    }
    
    .brand span {
        font-size: 13px !important;
    }
    
    .brand .vigia-indicator,
    .brand .centinela-indicator {
        font-size: 8px !important;
        gap: 2px !important;
    }
    
    .brand .vigia-label,
    .brand .centinela-label {
        display: none !important;
    }
    
    .brand .vigia-status,
    .brand .centinela-status {
        font-size: 7px !important;
    }
    
    .brand .vigia-dot,
    .brand .centinela-dot {
        width: 6px !important;
        height: 6px !important;
    }
    
    .header-right {
        gap: 2px !important;
    }
    
    .user-badge .user-name {
        font-size: 11px !important;
        max-width: 50px !important;
    }
    
    .user-badge .user-avatar {
        font-size: 16px !important;
    }
    
    #vigiaCentinelaContainer {
        min-width: 50px !important;
        max-width: 100px !important;
        padding: 2px 4px !important;
        gap: 1px !important;
    }
    
    #vigiaCentinelaContainer div:first-child {
        font-size: 6px !important;
    }
    
    #vigiaCentinelaContainer .activity-bar-wrapper {
        font-size: 6px !important;
    }
    
    #vigiaCentinelaContainer .activity-status-dot {
        width: 5px !important;
        height: 5px !important;
    }
    
    #tokenIndicator {
        padding: 1px 4px !important;
        font-size: 9px !important;
        border-radius: 6px !important;
    }
    
    #modoInversoBtn {
        font-size: 13px !important;
        padding: 1px 3px !important;
    }
    
    #balanceadorModeloIndicator {
        padding: 1px 4px !important;
        font-size: 7px !important;
        gap: 2px !important;
    }
    
    #balanceadorModeloIndicator .balanceador-dot {
        width: 5px !important;
        height: 5px !important;
    }
    
    #balanceadorModeloIndicator .balanceador-nombre {
        font-size: 7px !important;
        max-width: 40px !important;
    }
    
    #balanceadorModeloIndicator .balanceador-estado {
        font-size: 6px !important;
    }
}

/* Móvil mediano (400-640px) */
@media (max-width: 640px) and (min-width: 401px) {
    .header-content {
        gap: 4px 8px !important;
        padding: 5px 8px !important;
    }
    
    .brand .vigia-label,
    .brand .centinela-label {
        font-size: 8px !important;
    }
    
    #vigiaCentinelaContainer {
        min-width: 60px !important;
        max-width: 140px !important;
        padding: 2px 5px !important;
    }
    
    #vigiaCentinelaContainer div:first-child {
        font-size: 7px !important;
    }
    
    .user-badge .user-name {
        font-size: 12px !important;
        max-width: 60px !important;
    }
}

/* Animación para estado crítico */
@keyframes pulse-warning {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.token-indicator.critico {
    animation: pulse-warning 1.5s ease-in-out infinite;
}

/* Estilos generales para el indicador de tokens */
.token-indicator {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: clamp(9px, 2vw, 11px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--light);
    background: var(--bg);
    color: var(--gray);
    white-space: nowrap;
    flex-shrink: 0;
}

.token-indicator:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ============================================================
   ESTILOS PARA UI.STUDY V24 - DISEÑO INMERSIVO
   ============================================================ */

/* Tarjeta de estudio */
.study-card {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.study-card:hover {
    box-shadow: 0 12px 60px rgba(0,0,0,0.12) !important;
}

/* Origen badges */
.origen-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 12px;
    border-radius: 16px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.origen-badge.elipse {
    background: rgba(108,92,231,0.12);
    color: #6C5CE7;
    border: 1px solid rgba(108,92,231,0.25);
}
.origen-badge.cruzada {
    background: rgba(0,206,201,0.12);
    color: #00CEC9;
    border: 1px solid rgba(0,206,201,0.25);
}
.origen-badge.tonos {
    background: rgba(253,203,110,0.15);
    color: #E17055;
    border: 1px solid rgba(253,203,110,0.3);
}
.origen-badge.tema {
    background: rgba(0,184,148,0.10);
    color: #00B894;
    border: 1px solid rgba(0,184,148,0.2);
}

/* Botones de respuesta */
.respuesta-btn {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.respuesta-btn:hover {
    transform: translateY(-2px) scale(1.02);
}
.respuesta-btn:active {
    transform: scale(0.95);
}

/* Opciones múltiples */
.multiple-opcion {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.multiple-opcion:not([style*="cursor:default"]):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(108,92,231,0.15);
}

/* Animación de entrada para la tarjeta */
.study-card {
    animation: studyCardIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes studyCardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modo selector */
.modo-btn {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modo-btn.active {
    box-shadow: 0 2px 16px rgba(108,92,231,0.35);
}
.modo-btn:not(.active):hover {
    transform: translateY(-2px);
}

/* Burbujas de palabras desglosadas */
.palabra-burbuja {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}
.palabra-burbuja:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 20px rgba(108,92,231,0.2);
}

/* Responsive */
@media (max-width: 480px) {
    .study-card {
        padding: 16px 14px !important;
        border-radius: 16px !important;
    }
    .frase-container {
        padding: 14px 8px !important;
    }
    .frase-container div:first-child {
        font-size: 26px !important;
    }
    .respuesta-btn {
        padding: 8px 4px !important;
        font-size: 10px !important;
    }
    .respuesta-btn span {
        font-size: 8px !important;
    }
    .multiple-opcion {
        font-size: 13px !important;
        padding: 10px 8px !important;
    }
    .modo-btn {
        font-size: 10px !important;
        padding: 4px 10px !important;
    }
    .nav-btn {
        font-size: 12px !important;
        padding: 8px 12px !important;
    }
}
body > div[style*="z-index"] form:not([data-wall-form]) {
  width: min(520px, 100%) !important; box-sizing: border-box; padding: 26px !important;
  gap: 16px !important; border-radius: 18px !important; border-top: 5px solid var(--secondary);
  box-shadow: 0 20px 60px rgba(0,0,0,.28) !important;
}
body > div[style*="z-index"] form:not([data-wall-form]) h3 { margin: 0; color: var(--dark); font-size: 21px; }
body > div[style*="z-index"] form:not([data-wall-form]) label { display: grid; gap: 7px; color: var(--dark); font-weight: 700; font-size: 13px; }
body > div[style*="z-index"] form:not([data-wall-form]) input:not([type="checkbox"]), body > div[style*="z-index"] form:not([data-wall-form]) textarea { width: 100%; box-sizing: border-box; padding: 11px 12px; border: 2px solid var(--light); border-radius: 9px; font: inherit; font-weight: 400; }
body > div[style*="z-index"] form:not([data-wall-form]) button { padding: 11px; border: 0; border-radius: 9px; font-weight: 700; cursor: pointer; }
body > div[style*="z-index"] [data-wall-form] { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 10px !important; }
body > div[style*="z-index"] [data-wall-form] textarea { width: 100% !important; min-height: 64px !important; }
body > div[style*="z-index"] [data-wall-form] button { min-width: 150px; }
body > div[style*="z-index"] [data-chat-form] { display: grid !important; grid-template-columns: 1fr !important; gap: 10px !important; margin-top: 14px; }
body > div[style*="z-index"] [data-chat-form] input { width: 100% !important; min-height: 110px; box-sizing: border-box; padding: 14px !important; font-size: 16px; }
body > div[style*="z-index"] [data-chat-form] button { width: 100%; min-height: 46px; }
body > div[style*="z-index"] #communityChatItems { width: 100%; }
body > div[style*="z-index"] [data-chat-form] { width: 100% !important; max-width: 900px !important; }
