/* ==========================================================================
   STYLE.CSS - DISEÑO "DEEPSEEK CLEAN" (UNIFICADO & OPTIMIZADO)
   ========================================================================== */

/* ************************************************** */
/* ****** BLOQUE: 1. VARIABLES & CONFIGURACIÓN ****** */
/* ************************************************** */
:root {
    /* 5. COLOR: Azul Real Suave */
    --primary-color: #6396e9;
    --primary-hover: #4e81f2;
    --secondary-color: #f1f5f9;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-body: #f8fafc;
    --bg-white: #ffffff;
    --bg-subtle:        #f8fafc;    /* Fons off-white (sidebars, àrees lleugerament grises) */
    --bg-surface:       #f1f5f9;    /* Fons de surface (hover, active, panels) */
    --bg-input:         #ffffff;    /* Fons d'inputs i textareas */
    --text-secondary:   #475569;    /* Text secundari */
    --border-light:     #e2e8f0;    /* Divisors lleugers */
    --border-color: #e2e8f0;

    /* Estados */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;

    /* --- PALETA DE PERFILES (RGB) --- */
    --color-default: 96, 125, 139;
    /* ID 0/Null */
    --color-p1: 69, 90, 100;
    /* ID 1 */
    --color-p2: 33, 150, 243;
    /* ID 2 */
    --color-p3: 233, 30, 99;
    /* ID 3 */
    --color-p4: 255, 152, 0;
    /* ID 4 */
    --color-p5: 76, 175, 80;
    /* ID 5 */
    --color-p6: 255, 193, 7;
    /* ID 6 */
    --color-p7: 156, 39, 176;
    /* ID 7 */
    --color-p8: 0, 150, 136;
    /* ID 8 */
    --color-p9: 244, 67, 54;
    /* ID 9 */
    --color-p10: 0, 188, 212;
    /* ID 10 */
    --color-p11: 139, 195, 74;
    /* ID 11 */
    --color-p12: 63, 81, 181;
    /* ID 12 */
    --color-p13: 121, 85, 72;
    /* ID 13 */
    --color-p14: 205, 220, 57;
    /* ID 14 */
    --color-p15: 103, 58, 183;
    /* ID 15 */
    --color-p16: 0, 94, 184;
    /* ID 16 (David) */
    --color-p17: 255, 87, 34;
    /* ID 17 */

    --color-plugin-master: 245, 158, 11;
    /* Ámbar/Naranja para HERRAMIENTAS EXTERNAS */


    /* Estructura */
    --header-height: 50px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);

    /* Tipografía */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --chat-font-size: 0.95rem;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: var(--header-height);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* ************************************************** */
/* ****** BLOQUE: 2. HEADER & NAVEGACIÓN ************ */
/* ************************************************** */
.header-container {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);

    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;

    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.logo-img {
    height: 38px;
    width: auto;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-button {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 200;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-button:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.nav-button.primary {
    background-color: var(--primary-color);
    color: white;
}

.nav-button.primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.lang-selector {
    color: rgb(97, 117, 147);
    font-size: 50%;
    line-height: 120%;
}

/* ************************************************** */
/* ****** BLOQUE: 3. UI GENERAL (BOTONES/INPUTS) **** */
/* ************************************************** */
.btn {
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-sm);
    font-weight: 400;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--text-main);
    color: white;
}

.btn-secondary:hover {
    background-color: #0f172a;
}

.btn-outline {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--text-muted);
    background-color: var(--bg-subtle);
}

.btn-danger {
    background-color: #fee2e2;
    color: var(--danger-color);
}

.btn-small {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
    display: flex;
}

.btn-success {
    background: #55b412;
    border: 1px solid #438813;
    height: 34px;
}

.contracted {
    background: #55b41220;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 50%;
    padding: 0.85rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background-color: var(--bg-white);
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 1.5rem;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dashboard-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: flex-start;
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1.2rem;
    flex-shrink: 0;
}

.pias-icon {
    background: #e0e7ff;
    color: #4338ca;
}

.plan-icon {
    background: #dcfce7;
    color: #15803d;
}

.stat-content h3 {
    margin: 0 0 5px 0;
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
    margin-bottom: 5px;
}

.stat-details {
    font-size: 0.9rem;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ************************************************** */
/* ****** BLOQUE: 4. BUY-CREDITS ****************** */
/* ************************************************** */

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #64748b;
    font-size: 1.1rem;
}

/* GRID DE PLANES */
.plans-grid {
    display: grid;
    /* Al bajar a 250px, caben 3 tarjetas perfectamente incluso en pantallas medianas */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: stretch;
}

/* TARJETA DE PLAN */
.plan-card {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* PLAN RECOMENDADO (Pro) */
.recommended-plan {
    border: 2px solid #4f46e5;
    /* Color Indigo */
    background: var(--bg-white);
    transform: scale(1.02);
    /* Un pelín más grande */
    z-index: 10;
}

.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #4f46e5;
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.3);
}

/* CABECERA TARJETA */
.plan-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 1.5rem;
}

.plan-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #1e293b;
    font-weight: 700;
}

.plan-price {
    font-size: 3rem;
    font-weight: 800;
    color: #1e293b;
    margin-top: 10px;
    display: flex;
    align-items: baseline;
    justify-content: center;
}

.plan-price span {
    font-size: 1rem;
    color: #64748b;
    font-weight: 500;
    margin-left: 4px;
}

/* CUERPO TARJETA */
.plan-body {
    flex: 1;
    margin-bottom: 2rem;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.plan-features li {
    padding: 10px 0;
    color: #475569;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.plan-features li::before {
    content: "✓";
    color: #10b981;
    /* Verde check */
    font-weight: bold;
    margin-right: 10px;
}

.plan-features li strong {
    color: #1e293b;
    font-weight: 600;
}

/* PLAN ACTUAL (Desactivado) */
.current-plan {
    background: var(--bg-subtle);
    border-color: #cbd5e1;
    opacity: 0.8;
}

.current-plan .plan-header h3::after {
    content: " (Actual)";
    font-size: 0.8rem;
    color: #64748b;
    vertical-align: middle;
}

/* PLAN INFERIOR (Desactivado) */
.disabled-plan {
    background: var(--bg-surface);
    filter: grayscale(100%);
    opacity: 0.6;
}

/* BOTONES */
.btn-disabled {
    background: #cbd5e1;
    color: #64748b;
    border: none;
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: not-allowed;
}

.action-buy-plan {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: transform 0.1s;
}

.action-buy-plan:active {
    transform: scale(0.98);
}

/* --- ESTILOS ESPECÍFICOS PARA PAQUETES (PAYment Mode) --- */
.package-mode .plan-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 2rem;
}

.package-icon-small {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    background: var(--bg-surface);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.package-mode:hover .package-icon-small {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 15px -3px rgba(99, 150, 233, 0.4);
}

.package-mode .plan-price {
    font-size: 2.5rem;
    /* Un poco más pequeño que la suscripción */
}

.package-mode .plan-price span {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4rem 0;
}

/* ************************************************** */
/* ****** BLOQUE: 4. LAYOUT & AUTH ****************** */
/* ************************************************** */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
    flex: 1;
}

.container:has(#profiles-list-view) {
    max-width: 98%;
    padding: 2rem 3rem;
}

/* --- FORMULARIOS LOGIN/REGISTRO --- */
.auth-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
}

.auth-form {
    background-color: var(--bg-white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-muted, #333);
    font-size: 1.4rem;
    font-weight: 500;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4b5563;
    font-weight: 500;
    font-size: 0.9rem;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    background-color: var(--bg-white);
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 0;
}

.auth-form input:focus {
    border-color: var(--primary-color, #3b82f6);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.auth-form button[type="submit"] {
    width: 100%;
    padding: 0.5rem;
    background-color: var(--primary-color, #3b82f6);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 1rem;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-form button[type="submit"]:hover {
    background-color: var(--primary-hover, #2563eb);
    transform: translateY(-1px);
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #64748b;
}

.auth-switch a {
    color: var(--primary-color, #3b82f6);
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ************************************************** */
/* ****** BLOQUE: 5. VISTA: PERFILES (CARDS) ******** */
/* ************************************************** */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
}

.profile-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    flex-direction: column;
    position: relative;
    margin-top: 30px;
    overflow: visible !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.profile-avatar-container {
    height: 0;
    margin-top: -50px;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    background: var(--bg-white);
}

.profile-card-inner {
    padding: 6.5rem 1.5rem 1.5rem 1.5rem;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.profile-title h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.profile-profession {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.skill {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.profile-actions {
    margin-top: auto;
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
}

.profile-actions .btn {
    flex: 0 1 auto;
    min-width: 110px;
    justify-content: center;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.hire-btn {
    background-color: var(--primary-color);
    color: white;
}

.hire-btn:hover {
    background-color: var(--primary-hover);
}

/* ************************************************** */
/* ****** BLOQUE: 6. CHAT UNIFICADO (LAYOUT FIJO) *** */
/* ************************************************** */

/* --- 1. ESTRUCTURA PRINCIPAL (SIN SCROLL GLOBAL) --- */
.meeting-room-layout,
.office-layout,
.entrevista-layout {
    display: flex;
    height: calc(100vh - var(--header-height));
    background: var(--bg-white);
    overflow: hidden;
    /* CRÍTICO: Bloquea scroll en el cuerpo */
}

.meeting-room-container,
.office-container,
.mini-chat-container,
.entrevista-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    height: 100%;
    overflow: hidden;
}

/* --- 2. HEADER DEL CHAT (FIJO ARRIBA) --- */
.meeting-header,
.mini-chat-header,
.office-header,
.entrevista-header {
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    height: 50px;
    flex-shrink: 0;
    /* No encoger */
    position: relative;
    /* CRÍTICO: Crea contexto para el z-index */
    z-index: 50;
    /* Asegura que esté por encima del chat (que suele ser 0 o 1) */
    overflow: visible;
}

.advisor-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.advisor-avatar,
.mini-chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.chat-title,
.advisor-name {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.2;
}

.advisor-profession {
    font-weight: 200;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- 3. BOTONES HEADER --- */
.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-header-actions .btn {
    height: 25px;
	width: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    font-size: 0.85rem;
    line-height: 1;
    margin: 0;
}

.office-header-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 40px;
}

.office-header-btn:hover {
    color: var(--primary-color);
    background-color: rgba(var(--primary-color-rgb), 0.1);
}

#closeMeetingButton,
#closeOfficeButton,
#closeEntrevistaButton,
.square-icon-btn {
    width: 36px !important;
    padding: 0 !important;
    font-size: 1.1rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- 4. VENTANA DE MENSAJES (SCROLL AQUÍ) --- */
.chat-window,
.mini-chat-window,
.office-chat-window {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    /* SCROLL SOLO AQUÍ */
    display: flex;
    flex-direction: column;
    gap: .3rem;
    background-color: var(--bg-white);
    background-image: radial-gradient(var(--bg-subtle) 1px, transparent 1px);
    background-size: 24px 24px;
    scroll-behavior: smooth;
}

#officeTypingIndicator {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255, 107, 0, 0.05);
    border-top: 1px solid rgba(255, 107, 0, 0.1);
    font-size: 14px;
    color: #FF6B00;
}

#officeTypingIndicator .typing-dot {
    width: 10px;
    height: 10px;
    background: #FF6B00;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

#officeTypingIndicator .typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

#officeTypingIndicator .typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing-bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* --- 5. MENSAJES --- */
.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 90%;
    width: fit-content;
}

.chat-message.user {
    align-self: flex-end;
    align-items: flex-end;
    margin-left: auto;
}

.chat-message.david {
    align-self: flex-start;
    align-items: flex-start;
    margin-right: auto;
}

.chat-message.david strong {
    font-weight: 600;
}

/* CABECERA DEL MENSAJE */
.chat-message-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
    font-family: var(--font-sans);
}

.chat-message.user .chat-message-header {
    flex-direction: row-reverse;
}

.chat-message.david .chat-message-header {
    flex-direction: row;
}

.sender-name {
    font-weight: 600;
    font-size: 0.80rem;
    color: var(--text-main);
}

.chat-message.user .sender-name {
    color: var(--primary-color);
}

.chat-message.david .sender-name {
    color: rgb(var(--profile-rgb));
}

.reply-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* --- 6. BURBUJAS --- */
.message-content,
.message-bubble {
    padding: 1rem 1.2rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: var(--chat-font-size);
    font-weight: 300;
    line-height: 1.2;
    position: relative;
    transition: all 1s ease;
}

/* Estilo User */
.chat-message.user .message-content,
.chat-message.user .message-bubble {
    background-color: var(--primary-color);
    color: white;
    border-radius: 12px 0 12px 12px;
    text-align: left;
}

/* Estilo Perfil */
.chat-message.david .message-content,
.chat-message.david .message-bubble {
    background-color: rgba(var(--profile-rgb), 0.1) !important;
    color: var(--text-main);
    border-left: 3px solid rgb(var(--profile-rgb)) !important;
    border-radius: 0 12px 12px 12px;
}

.message-content ul li,
.message-content ol li {
    margin-left: 25px;
    padding-top: 15px;
}

/* ************************************************** */
/* ****** BLOQUE: 7. DASHBOARD (ESTILOS) ************ */
/* ************************************************** */
.dashboard-grid {
    display: grid;
    gap: 3rem;
    padding-bottom: 3rem;
}

/* Fichas Perfiles Contratados */
.profile-header-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.contracted-profile-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    line-height: 1.2;
}

.profile-team-tag {
    font-size: 0.8rem;
    color: var(--text-main);
    font-weight: 600;
    background-color: var(--bg-surface);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.contracted-profile-expiry {
    margin-top: auto;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Advisor Card (DAVID) */
#dashboard-advisor-card {
    background: var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, 0.6);
    overflow: visible !important;
    margin-top: 50px;
    padding: 3.5rem 2rem 2rem 2rem;

    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;

    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#dashboard-advisor-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

#dashboard-advisor-card img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    object-fit: cover;

    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
}

#dashboard-advisor-card h3 {
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 1.5rem;
    color: var(--text-main);
    font-weight: 700;
}

#dashboard-advisor-card p {
    color: var(--text-muted);
    max-width: 600px;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.advisor-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 1rem;
    padding: 0.4rem 1rem;
    background-color: rgba(16, 185, 129, 0.1);
    border-radius: 20px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.status-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--success-color, #10b981);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success-color, #10b981);
    border-radius: 50%;
    display: block;
    position: relative;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

#dashboard-hired-teams-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

#dashboard-hired-teams-card .card-content {
    padding: 0 !important;
}

#dashboard-hired-teams-card h3 {
    margin-bottom: 1.5rem;
    color: var(--text-main);
    padding-left: 0.5rem;
    font-weight: 600;
}

#dashboard-profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* ************************************************** */
/* ****** BLOQUE: 8. WELCOME (VIDEO VERTICAL) ******* */
/* ************************************************** */
.welcome-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.video-chat-wrapper {
    width: 100%;
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 2rem;
    height: 85vh;
    min-height: 650px;
    max-height: 900px;
}

.youtube-video-container {
    position: relative;
    border-radius: var(--radius-md, 15px);
    overflow: hidden;
    background: #000;
    width: 100%;
    height: 100%;
    box-shadow: var(--shadow-lg, 0 10px 25px rgba(0, 0, 0, 0.2));
}

.welcome-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-volume-toggle {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.video-volume-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
}

#minichat-placeholder {
    background: var(--bg-white);
    border-radius: var(--radius-md, 15px);
    border: 1px solid var(--border-color, #e2e8f0);
    box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.welcome-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
    min-height: 450px;
}

.welcome-banner {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.banner-1 {
    background-image: url('assets/img/banner-1-limpio.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 0;
    position: relative;
}

.welcome-overlay {
    background-color: rgba(0, 0, 0, 0.6);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    color: white;
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.welcome-text {
    font-size: 1.1rem;
    max-width: 600px;
    margin-bottom: 2rem;
    color: #e2e8f0;
}

.banner-2 {
    background-image: url('assets/img/hero-team-bg.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.register-overlay {
    background: rgba(0, 0, 0, 0.5);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.banner-2-form {
    background: rgba(255, 255, 255, .8);
    padding: 1rem;
    border-radius: 12px;
    width: 95%;
    max-width: 700px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    margin: 0 auto;
}

.banner-2-form h2 {
    color: #1a202c;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
}

.banner-2-form .form-group {
    margin-bottom: 0;
}

.banner-2-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.banner-2-form .form-input {
    width: 100%;
    padding: .6rem;
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    font-size: 0.8rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.banner-2-form .form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.banner-2-form button[type="submit"] {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 1.5rem;
}

.banner-2-form button[type="submit"]:hover {
    background-color: var(--primary-hover);
}

.banner-2-form .auth-switch {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.95rem;
    color: #718096;
}

/* ************************************************** */
/* ****** BLOQUE: 9. CARRITO & EXTRAS *************** */
/* ************************************************** */
.cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.cart-card {
    display: flex;
    gap: 1.5rem;
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    align-items: center;
    transition: box-shadow 0.2s;
    position: relative;
}

.cart-card:hover {
    box-shadow: var(--shadow-sm);
}

.cart-card-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    background-color: var(--bg-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.cart-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-card-details {
    flex: 1;
}

.cart-card-details h4 {
    margin-bottom: 0.2rem;
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 700;
}

.cart-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.cart-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.price-final {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.2rem;
}

.price-original {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.discount-tag {
    font-size: 0.7rem;
    background: #dcfce7;
    color: #166534;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    margin-top: 2px;
}

.remove-item-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: 50%;
    transition: all 0.2s;
}

.remove-item-btn:hover {
    background-color: #fee2e2;
    color: var(--danger-color);
}

.cart-summary-section {
    position: sticky;
    top: 90px;
}

.cart-summary-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.cart-summary-card h3 {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.2rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.total-row {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text-main);
    margin-top: 1rem;
    border-top: 2px dashed var(--border-color);
    padding-top: 1rem;
    align-items: center;
}

.secure-payment-box {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--border-color);
}

.secure-payment-box p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.payment-icons {
    font-size: 1.8rem;
    color: #64748b;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.summary-footer {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 1rem;
    line-height: 1.4;
}

.empty-cart-container {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
}

.empty-icon {
    font-size: 3rem;
    color: var(--border-color);
    margin-bottom: 1rem;
}

.empty-cart-container h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-cart-container p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* ************************************************** */
/* ****** BLOQUE: 10. FOOTER & UTILS **************** */
/* ************************************************** */
.footer-content {
    padding: 0.5rem;
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: auto;
}

.debug-content {
    background: #1e293b;
    color: #cbd5e1;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    width: 100%;
    max-width: 800px;
    text-align: left;
    font-family: monospace;
    font-size: 0.8rem;
}

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* ************************************************** */
/* ****** BLOQUE: 11. ADMIN SUB-HEADER ************** */
/* ************************************************** */
.admin-sub-header {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 0.6rem 0;
    display: block;
    position: sticky;
    top: var(--header-height);
    z-index: 990;
    box-shadow: var(--shadow-sm);
}

.admin-sub-header.active {
    display: block;
}

.admin-sub-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.admin-sub-button {
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}

.admin-sub-button:hover {
    background-color: var(--bg-body);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.admin-sub-button.active {
    background-color: #eff6ff;
    color: var(--primary-color);
    font-weight: 600;
    border-color: rgba(59, 130, 246, 0.2);
}

/* ************************************************** */
/* ****** BLOQUE: 12. BUSCADOR PERFILES ************* */
/* ************************************************** */
.page-header {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 1rem;
}

.filters {
    display: flex;
    align-items: center;
    background: var(--bg-white);
    padding: 0.3rem 0.3rem 0.3rem 1.5rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 750px;
    gap: 0.5rem;
    transition: box-shadow 0.2s;
}

.filters:focus-within {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    border-color: var(--primary-color);
}

.filters .filter-input {
    margin-bottom: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent;
    padding: 0.5rem;
    height: auto;
    font-size: 0.95rem;
}

#nameFilter {
    flex: 1;
    width: auto;
    outline: none;
}

#profileTypeFilter {
    width: auto;
    color: var(--text-muted);
    border-left: 1px solid var(--border-color) !important;
    border-radius: 0;
    padding-left: 1rem;
    cursor: pointer;
    max-width: 200px;
    text-overflow: ellipsis;
}

#applyFiltersBtn {
    border-radius: 50px;
    padding: 0.6rem 1.5rem;
    margin-left: auto;
    font-size: 0.9rem;
}

#app-container {
    padding-top: .5rem;
}

/* =========================================
   TOGGLE MODELO (GEMINI 2.0 vs 3.0)
========================================= */
.model-toggle-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 15px;
    border-right: 1px solid var(--border-color);
    padding-right: 15px;
}

.model-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface);
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.model-toggle-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.model-toggle-btn i {
    font-size: 0.9rem;
}

.model-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 120%;
    right: 0;
    width: 280px;
    background: var(--bg-white);
    color: var(--text-main);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    line-height: 1.4;
    z-index: 100;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    text-align: left;
}

.model-toggle-wrapper:hover .model-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.tooltip-title {
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
    color: var(--text-main);
}

.tooltip-warning {
    color: #d97706;
    font-weight: 600;
    margin-top: 6px;
    display: block;
    font-size: 0.75rem;
}

/* ************************************************** */
/* ****** BLOQUE: 13. ESTILOS DE EQUIPOS (TEAMS) **** */
/* ************************************************** */
.team-card-dashboard {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: row;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
    min-height: 200px;
    height: auto;
}

.team-card-dashboard:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.team-image-column {
    width: 200px;
    min-width: 200px;
    position: relative;
    background-color: var(--bg-surface);
    display: flex;
}

.team-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.team-capacity-badge {
    position: absolute;
    bottom: 0.8rem;
    left: 0.8rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.team-info-column {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--border-color);
}

.team-card-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.team-card-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.team-pricing-section {
    margin-bottom: 0.8rem;
    padding: 0;
    background: transparent;
    border: none;
}

.team-price-display {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.team-price-final {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
}

.team-price-period {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.team-price-original {
    font-size: 0.9rem;
    text-decoration: line-through;
    color: var(--text-muted);
}

.team-discount-badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    background: #dcfce7;
    color: #166534;
    border-radius: 4px;
    font-weight: 700;
}

.team-card-actions .btn {
    background-color: var(--primary-color) !important;
    color: white !important;
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
    width: auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.team-card-actions .btn:hover {
    background-color: var(--primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.team-members-sidebar {
    width: 270px;
    min-width: 240px;
    flex-shrink: 0;
    background-color: var(--bg-white);
    display: flex;
    flex-direction: column;
}

.sidebar-members-header {
    padding: 0.1rem 1rem;
    background-color: var(--border-color);
}

.sidebar-members-header small {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.6rem;
    letter-spacing: 0.05em;
}

.sidebar-members-list {
    padding: 0.8rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
}

.sidebar-member-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

.empty-slot-item {
    border: 1px dashed #e2e8f0;
}

.sidebar-member-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--bg-surface);
    object-fit: cover;
}

.sidebar-member-info {
    flex: 1;
    overflow: hidden;
}

.sidebar-member-name {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-member-profession {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ************************************************** */
/* ****** BLOQUE: 14. LOGICA COLORES PERFILES ******* */
/* ************************************************** */
.chat-message {
    --profile-rgb: var(--color-default);
}

.chat-message[data-profile-id="23"] {
    --profile-rgb: var(--color-p1);
}

.chat-message[data-profile-id="2"] {
    --profile-rgb: var(--color-p2);
}

.chat-message[data-profile-id="3"] {
    --profile-rgb: var(--color-p3);
}

.chat-message[data-profile-id="4"] {
    --profile-rgb: var(--color-p4);
}

.chat-message[data-profile-id="5"] {
    --profile-rgb: var(--color-p5);
}

.chat-message[data-profile-id="6"] {
    --profile-rgb: var(--color-p6);
}

.chat-message[data-profile-id="7"] {
    --profile-rgb: var(--color-p7);
}

.chat-message[data-profile-id="8"] {
    --profile-rgb: var(--color-p8);
}

.chat-message[data-profile-id="11"] {
    --profile-rgb: var(--color-p9);
}

.chat-message[data-profile-id="16"] {
    --profile-rgb: var(--color-p10);
}

.chat-message[data-profile-id="17"] {
    --profile-rgb: var(--color-p11);
}

.chat-message[data-profile-id="18"] {
    --profile-rgb: var(--color-p12);
}

.chat-message[data-profile-id="24"] {
    --profile-rgb: var(--color-p13);
}

.chat-message[data-profile-id="9"] {
    --profile-rgb: var(--color-p14);
}

.chat-message[data-profile-id="21"] {
    --profile-rgb: var(--color-p15);
}

.chat-message[data-profile-id="10"] {
    --profile-rgb: var(--color-p16);
}

.chat-message[data-profile-id="1"] {
    --profile-rgb: var(--color-p17);
}

.chat-message.plugin-response {
    --profile-rgb: var(--color-plugin-master);
}

/* Estilo del botón "CONTRATAR" dentro del chat (Bloqueo) */
.chat-message.plugin-response .profile-avatar-custom {
    border-color: rgba(var(--color-plugin-master), 0.3);
}

.hire-lock-btn {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
    margin-top: 8px;
    color: var(--primary-color);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.hire-lock-btn:hover {
    background-color: var(--bg-white);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}



/* Animaciones para el selector de modelos */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInOffice {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Estilos para el dropdown de modelos */
.model-selector-dropdown {
    animation: fadeIn 0.2s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilo para el botón activo */
#meetingModelToggle.active,
#officeModelToggle.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #5a67d8;
}

/* Responsive */
@media (max-width: 768px) {
    .model-selector-dropdown {
        position: fixed;
        right: 10px;
        left: 10px;
        top: 60px;
        width: auto;
    }
}

/* ************************************************** */
/* ****** BLOQUE: 15. SIDEBARS UNIFICADOS *********** */
/* ************************************************** */

/* Unificamos el estilo del sidebar izquierdo */
.all-profiles-sidebar {
    width: 260px;
    background-color: var(--bg-subtle);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
}

.contracted-profiles-sidebar {
    width: 260px;
    background-color: var(--bg-subtle);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-title {
    padding: 1.5rem 1rem 0.8rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid transparent;
}

#profiles-scroll-area {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-bottom: 10px;
}

/* Separador de Proyectos */
.sidebar-separator {
    margin: 0;
    padding: 1rem 1rem 0.5rem 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: var(--bg-subtle);
    flex-shrink: 0;
}

/* Contenedor Inferior (Proyectos) */
#projects-scroll-area {
    flex-shrink: 0;
    max-height: 20vh;
    overflow-y: auto;
    padding-bottom: 1rem;
    background-color: var(--bg-subtle);
}

.profiles-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 0.5rem;
}

.profile-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.imatge_avatar_selector {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0px;
}

.profile-list-item:hover {
    background-color: var(--bg-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.profile-list-item.active {
    background-color: var(--bg-white);
    border-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(59, 130, 246, 0.15);
}

.profile-list-avatar {
    width: 35px;
    height: 35px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
    background-color: #e2e8f0;
}

.profile-list-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.profile-list-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-list-profession {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
}

.no-profiles {
    padding: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.contracted-badge {
    color: var(--success-color);
    margin-left: auto;
    font-size: 0.9rem;
}

/* ************************************************** */
/* ****** BLOQUE: 20. DETALLE DE FACTURA (INVOICE) ** */
/* ************************************************** */
.invoice-detail-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 3rem;
}

.invoice-paper {
    background: var(--bg-white);
    width: 100%;
    max-width: 850px;
    padding: 3rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    position: relative;
}

.invoice-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.invoice-id-group .label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 4px;
}

.invoice-id-group h2 {
    font-size: 1.8rem;
    color: var(--text-main);
    margin: 0;
    line-height: 1;
}

.invoice-meta-group {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta-item {
    font-size: 0.9rem;
    color: var(--text-main);
}

.meta-label {
    color: var(--text-muted);
    margin-right: 8px;
}

.invoice-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.invoice-status.pagada,
.invoice-status.paid {
    background: #dcfce7;
    color: #166534;
}

.invoice-status.pendiente,
.invoice-status.pending {
    background: #fef9c3;
    color: #854d0e;
}

.invoice-status.cancelada {
    background: #fee2e2;
    color: #991b1b;
}

.invoice-divider {
    border: 0;
    border-top: 2px solid var(--border-color);
    margin: 1.5rem 0 2rem 0;
}

.invoice-parties {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    gap: 2rem;
}

.party-col {
    flex: 1;
}

.party-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.party-details {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
}

.client-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.invoice-table th {
    text-align: left;
    background-color: var(--bg-subtle);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
}

.invoice-table td {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-main);
}

.invoice-table .text-center {
    text-align: center;
}

.invoice-table .text-right {
    text-align: right;
}

.invoice-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 2rem;
}

.invoice-notes {
    flex: 1;
    color: var(--text-muted);
    font-size: 0.85rem;
    max-width: 50%;
}

.invoice-totals {
    width: 250px;
}

.invoice-totals .total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    border: none;
    padding: 0;
}

.invoice-totals .total-row.final {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--text-main);
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.2rem;
}

.invoice-actions-bar {
    display: flex;
    gap: 1rem;
}

.action-btn {
    min-width: 150px;
}

.loading-state {
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
}

.loading-state .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ************************************************** */
/* ****** BLOQUE: 16. CHAT ACORDEÓN (+/-) *********** */
/* ************************************************** */
.msg-toggle-btn {
    width: 12px;
    height: 10px;
    border: 1px solid currentColor;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8%;
    font-weight: bold;
    background: var(--bg-white);
    transition: all 2s;
    line-height: 0;
}

.chat-message.david .msg-toggle-btn {
    color: rgb(var(--profile-rgb));
    border-color: rgb(var(--profile-rgb));
}

.chat-message.user .msg-toggle-btn {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.msg-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.collapsed-message {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    opacity: 0.7;
}

/* ************************************************** */
/* ****** BLOQUE: 17. CONTROLES TAMAÑO TEXTO ******** */
/* ************************************************** */
.font-size-controls {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-right: 15px;
    padding-right: 15px;
    border-right: 1px solid var(--border-color);
}

.fs-btn {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 2px;
    line-height: 1;
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.fs-btn:hover {
    color: var(--primary-color);
}

.fs-btn.active {
    color: var(--primary-color);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Botón de borrar proyecto en sidebar */
.project-delete-btn {
    opacity: 0.4;
    padding: 6px;
    color: var(--text-muted);
    transition: all 0.2s;
    z-index: 10;
}

.project-delete-btn:hover {
    opacity: 1;
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
    border-radius: 4px;
}

.project-group-item {
    padding-right: 5px !important;
}

/* Estilo específico para el icono del proyecto */
.project-group-icon {
    background-color: #e0e7ff;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.project-group-item:hover .project-group-icon {
    background-color: #4f46e5;
    color: white;
    transition: all 0.2s ease;
}

/* ENLACES DE PERFIL EN CHAT */
.sender-profile-link {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    transition: all 0.2s ease;
}

.sender-profile-link:hover {
    color: var(--primary-color) !important;
    text-decoration-style: solid;
    font-weight: 800;
}

/* ************************************************** */
/* ****** BLOQUE: 18. PERFIL CLIENTE (NEW) ********** */
/* ************************************************** */
.client-profile-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
    width: 100%;
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.profile-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 2rem;
    position: relative;
}

.profile-section h2 {
    font-size: 1.2rem;
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-section h3 {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
    letter-spacing: 0.5px;
}

.compact-form .form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.form-group.compact {
    flex: 1;
    margin-bottom: 0.5rem;
}

.form-group.compact label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    display: block;
}

.form-input.compact {
    width: 100% !important;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0;
}

.form-input.compact:read-only {
    background-color: var(--bg-subtle);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-section-divider {
    margin: 1.5rem 0;
    border-top: 1px dashed var(--border-color);
}

.form-actions.compact {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.billing-actions.compact {
    margin-bottom: 1.5rem;
}

.billing-stats.compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item.compact {
    background-color: var(--bg-body);
    padding: 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-item.compact h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.stat-item.compact .stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.invoices-list-mini {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.invoice-item-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-white);
    transition: background 0.2s;
}

.invoice-item-mini:last-child {
    border-bottom: none;
}

.invoice-item-mini:hover {
    background-color: var(--bg-subtle);
}

.invoice-info-mini h5 {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.invoice-date-mini,
.invoice-amount-mini {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.invoice-status-mini {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    margin-top: 4px;
}

.invoice-status-mini.pagada {
    background: #dcfce7;
    color: #166534;
}

.invoice-status-mini.pendiente {
    background: #fef9c3;
    color: #854d0e;
}

.invoice-actions-mini {
    display: flex;
    gap: 0.5rem;
}

.profiles-grid.compact {
    margin-top: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2rem;
}

.profiles-grid.compact .profile-card {
    margin-top: 30px;
    box-shadow: var(--shadow-sm);
}

.profiles-grid.compact .profile-card-inner {
    padding: 5.5rem 1rem 1.5rem 1rem;
}

.read-more-team {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

.read-more-team:hover {
    text-decoration: underline;
}

/* *************************************************** */
/* ******** ESTOY PENSANDO *************************** */
/* *************************************************** */
.mini-chat-thinking {
    position: relative;
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 107, 0, 0.05);
    border-top: 1px solid rgba(255, 107, 0, 0.1);
    z-index: 100;
}

.thinking-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.thinking-loader {
    display: flex;
    gap: 6px;
}

.thinking-dot {
    width: 10px;
    height: 10px;
    background: #FF6B00;
    border-radius: 50%;
    animation: thinking-wave 1.2s infinite ease-in-out;
}

.thinking-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.thinking-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.thinking-dot:nth-child(3) {
    animation-delay: 0s;
}

.thinking-label {
    color: #FF6B00;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.mini-chat-thinking.greeting {
    background: linear-gradient(135deg, rgba(106, 17, 203, 0.08) 0%, rgba(106, 17, 203, 0.03) 100%);
    border-top: 1px solid rgba(106, 17, 203, 0.1);
}

.mini-chat-thinking.greeting .thinking-dot {
    background: linear-gradient(135deg, #6A11CB, #2575FC);
}

.mini-chat-thinking.greeting .thinking-label {
    background: linear-gradient(90deg, #6A11CB, #2575FC);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes thinking-wave {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.6;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

.mini-chat-thinking {
    animation: thinking-pulse 2s infinite;
}

@keyframes thinking-pulse {

    0%,
    100% {
        background: rgba(255, 107, 0, 0.05);
    }

    50% {
        background: rgba(255, 107, 0, 0.08);
    }
}

/* =========================================
   ESTILO DE INVOCACIÓN DE AGENTES (SQLID33)
========================================= */
.agent-invocation-box {
    margin-top: 5px;
    padding: 5px 7px;
    background-color: #f8fafc85;
    border-left: 3px solid #94a3b8;
    border-radius: 0 6px 6px 0;
    font-size: var(--chat-font-size) !important;
    color: var(--text-main);
    line-height: 1.2;
    display: block;
}

.agent-invocation-box i {
    color: var(--primary-color);
    margin-bottom: 4px;
    font-size: 0.9em;
}

.agent-invocation-box strong {
    color: #334155;
    font-weight: 500;
}

/* =========================================
   FIX INPUT CHAT (TODAS LAS SALAS - RESPONSIVE)
   ========================================= */

/* 1. EL CONTENEDOR: Flexbox en fila */
.chat-input-area,
.office-input-area,
.mini-chat-input-area {
    display: flex !important;
    /* Activar Flexbox */
    flex-direction: row !important;
    /* Una sola línea horizontal */
    align-items: center !important;
    /* Centrado vertical (mejor para inputs simples) */
    width: 100% !important;
    /* Ancho total disponible */
    max-width: 100% !important;
    box-sizing: border-box;
    gap: 10px;
    /* Separación entre input y botón */
    padding: 1rem 1.5rem;
}

/* 2. EL INPUT: El elemento elástico */
/* Incluimos input y textarea para cubrir todos los casos */
textarea.chat-input,
textarea.office-chat-input,
textarea.mini-chat-input,
input.mini-chat-input {
    /* <--- AÑADIDO ESTO */
    flex-grow: 1 !important;
    /* Ocupar todo el espacio sobrante */
    flex-shrink: 1 !important;
    /* Encogerse si falta sitio */
    width: auto !important;
    /* Resetear anchos fijos */
    min-width: 0 !important;
    /* Evitar desbordamiento en móviles */
    margin: 0 !important;
}

/* 3. LOS BOTONES: Rígidos */
.chat-input-area .btn,
.office-input-area .btn,
.mini-chat-input-area .btn,
/* <--- AÑADIDO ESTO */
.mini-chat-send-button,
/* <--- AÑADIDO ESTO */
#attachFileButton,
#sendMessageButton {
    flex-shrink: 0 !important;
    /* Prohibido aplastarse */
    flex-grow: 0 !important;
    /* No crecer */
    white-space: nowrap !important;
    margin: 0 !important;
    height: 42px;
    /* Altura estándar para alinear */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ************************************************** */
/* ****** BLOQUE: 21. MODALES Y OVERLAYS (UNIFICADO) */
/* ************************************************** */

/* --- 1. DEFINICIÓN DE ANIMACIONES --- */
@keyframes fadeInOverlay {
    to {
        opacity: 1;
    }
}

@keyframes slideUpModal {
    to {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- 2. DEFINICIÓN MAESTRA DE OVERLAY --- */
/* Esta regla sirve para TODOS los modales (Galería, Contratación, Confirmaciones) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    /* Oscuro intermedio para todo */
    backdrop-filter: blur(4px);
    /* Efecto blur moderno */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2147483647 !important;
    /* Máxima prioridad sobre cualquier elemento */
    animation: fadeIn 0.2s ease-out forwards;
    opacity: 0;
    /* Empieza invisible para la animación */
}

/* --- 3. ESTILOS ESPECÍFICOS: MODAL DE CONTRATACIÓN --- */
.hire-modal-compact {
    background: var(--bg-white);
    width: 90%;
    max-width: 420px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateY(20px);
    animation: slideUpModal 0.3s forwards;
    margin-top: 30px;
}

.popout-avatar-container {
    position: absolute;
    top: -50px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.popout-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    background: var(--bg-white);
    object-fit: cover;
}

.modal-close-btn.compact-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--bg-surface);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.modal-close-btn.compact-close:hover {
    background: #e2e8f0;
    color: var(--danger-color);
}

.hire-compact-body {
    padding: .8rem 2rem 0rem 2rem;
    text-align: center;
}

.compact-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.compact-profession {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
}

.compact-instruction {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: .3rem;
    text-align: left;
    font-weight: 500;
}

.compact-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 1.5rem 0;
    line-height: 1.5;
}

.compact-options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.hire-option-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: var(--bg-white);
}

.hire-option-compact:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-subtle);
}

.hire-option-compact input[type="radio"] {
    display: none;
}

.hire-opt-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.opt-period {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.opt-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.opt-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.hire-option-compact:has(input:checked) {
    border-color: var(--primary-color);
    background-color: rgba(99, 150, 233, 0.05);
    box-shadow: 0 4px 12px rgba(99, 150, 233, 0.15);
}

.hire-option-compact:has(input:checked) .opt-check {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.hire-option-compact:has(input:checked) .opt-price {
    color: var(--primary-color);
}

.compact-footer {
    margin-top: 1rem;
}

.styled-hire-btn {
    width: 100%;
    justify-content: center;
    padding: 0.3rem;
    font-size: .9rem;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
    width: 100%;
}

/* --- 4. ESTILOS ESPECÍFICOS: GALERÍA DE ARCHIVOS --- */
.gallery-modal-content {
    background-color: var(--bg-white) !important;
    /* Blanco sólido */
    width: 90%;
    max-width: 1000px;
    height: 85vh;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    opacity: 1 !important;
}

.gallery-header {
    background: var(--bg-white);
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.gallery-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gallery-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: var(--bg-subtle);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.gallery-item {
    background: var(--bg-white);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.gallery-item:hover {
    transform: translateY(-5px);
    border-color: #3b82f6;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.gallery-preview {
    height: 120px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-preview i {
    font-size: 3rem;
    color: #94a3b8;
}

.gallery-preview.pdf i {
    color: #ef4444;
}

.gallery-info {
    padding: 8px;
    font-size: 0.8rem;
    color: #333;
    background: var(--bg-white);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-top: 1px solid #f1f5f9;
}

.btn-close-gallery {
    font-size: 1.5rem;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
}

.btn-close-gallery:hover {
    color: #ef4444;
}

/* Genérico modal content (para otros usos) */
.modal-content {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

/* --- DEBUG PANEL --- */
.debug-panel {
    margin-top: 20px;
    padding: 15px;
    border-top: 1px solid #ddd;
    background: var(--bg-surface);
    text-align: left;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    position: relative;
    z-index: 999;
}

.debug-logs h4 {
    margin-top: 0;
}

.log-info {
    color: #005eb8;
}

.log-error {
    color: #ef4444;
    font-weight: bold;
}

.log-success {
    color: #10b981;
}

.log-warning {
    color: #f59e0b;
}

/* --- ADJUNTOS EN CHAT --- */
.chat-image-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 12px;
    margin-top: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: block;
    object-fit: cover;
    transition: transform 0.2s;
    cursor: pointer;
}

.chat-image-preview:hover {
    transform: scale(1.02);
}

.attachment-preview-bar {
    padding: 10px 20px;
    background-color: var(--bg-surface);
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview-content {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-white);
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    width: fit-content;
    max-width: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.preview-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-subtle);
    flex-shrink: 0;
}

.preview-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-icon i {
    font-size: 1.5rem;
    color: #64748b;
}

.preview-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.preview-size {
    font-size: 0.75rem;
    color: #94a3b8;
}

.btn-remove-attachment {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    transition: color 0.2s;
    margin-left: 10px;
}

.btn-remove-attachment:hover {
    color: #ef4444;
}

.file-attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-subtle);
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    margin-top: 8px;
    font-size: 0.9rem;
    color: #334155;
    font-weight: 500;
    max-width: 100%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.file-attachment-chip i {
    font-size: 1.2rem;
}

.file-attachment-chip .fa-file-pdf {
    color: #ef4444;
}

.file-attachment-chip .fa-paperclip {
    color: #64748b;
}

.chat-message.user .file-attachment-chip {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.chat-message.user .file-attachment-chip .fa-file-pdf,
.chat-message.user .file-attachment-chip .fa-paperclip {
    color: white;
}

/* --- PROJECT SWITCHER --- */
.office-project-switcher {
    position: relative;
    display: inline-block;
    z-index: 1002;
}

.office-title-clickable.btn-style {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-main);
    font-size: .9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    user-select: none;
    margin: 0;
}

.office-title-clickable.btn-style:hover {
    background-color: #e2e8f0;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.office-title-clickable.open {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

.office-title-clickable i {
    font-size: 0.8em;
    opacity: 0.6;
    transition: transform 0.3s ease;
}

.office-title-clickable.btn-style:hover i {
    opacity: 1;
}

.office-title-clickable.open i {
    transform: rotate(180deg);
    opacity: 1;
    color: white;
}

.project-dropdown-menu {
    top: calc(100% + 8px);
    left: 0;
    min-width: 300px;
    max-width: 350px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    animation: dropdownFadeIn 0.2s ease-out;
}

.project-dropdown-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: all 0.2s;
    text-align: left;
}

.project-dropdown-item:hover {
    background-color: var(--bg-surface);
}

.project-dropdown-item.active {
    background-color: #eff6ff;
    color: var(--primary-color);
    font-weight: 600;
}

.project-dropdown-icon {
    color: var(--text-muted);
    font-size: 1rem;
}

.project-dropdown-item.active .project-dropdown-icon {
    color: var(--primary-color);
}

.project-dropdown-scroll {
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* ================================================================
   FIX: SELECTOR DE PROYECTOS (CORRECCIÓN PANTALLAS GRANDES)
   ================================================================ */

/* 1. Header de la Office: Permitir que el menú sobresalga hacia abajo */
.office-header {
    overflow: visible !important;
    /* CRÍTICO: Permite ver lo que cuelga */
    z-index: 50 !important;
    /* Asegura estar por encima del chat */
    position: relative !important;
}

/* 2. Contenedor del Título + Menú */
.office-project-switcher {
    position: relative !important;
    /* Referencia para el menú absoluto */
    z-index: 1002 !important;
    /* Más alto que el resto del header */
    display: flex !important;
    align-items: center;
    height: 100%;
}

/* 3. El Título (Botón) */
#officeProjectTitle {
    position: relative;
    z-index: 1003;
    /* El botón siempre visible */
    margin-bottom: 0 !important;
}

/* 4. El Menú Desplegable: Posición forzada abajo */
.project-dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    /* Empieza justo donde acaba el título */
    margin-top: 15px !important;
    /* Un poco de aire para que no tape el botón */
    left: 0 !important;
    z-index: 1001 !important;
    /* Flotando sobre todo */
    min-width: 320px;
    /* Ancho mínimo para que se lea bien */
}


/* =========================================
   FIX INPUT CHAT (ANCHO COMPLETO Y FLUIDO)
   ========================================= */

/* 1. EL CONTENEDOR: Flexbox en fila */
.chat-input-area,
.office-input-area,
.mini-chat-input-area {
    display: flex !important;
    /* Activar Flexbox */
    flex-direction: row !important;
    /* Elementos en una sola línea horizontal */
    align-items: flex-end !important;
    /* Alinear abajo (mejor si el texto crece) */
    width: 100% !important;
    /* Forzar ancho total */
    max-width: 100% !important;
    box-sizing: border-box;
    /* El padding no suma al ancho total */
    gap: 10px;
    /* Espacio limpio entre elementos */
    padding: 1rem 1.5rem;
    /* Tu padding original */
}

/* 2. EL INPUT (TEXTAREA): El elemento elástico */
textarea.chat-input,
textarea.office-chat-input,
textarea.mini-chat-input {
    flex-grow: 1 !important;
    flex-shrink: 1 !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    min-height: 40px;
    border-radius: 5px;
    padding: 5px;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

/* 3. LOS BOTONES (Clip y Enviar): Rígidos */
.chat-input-area .btn,
.office-input-area .btn,
#attachFileButton,
#sendMessageButton {
    flex-shrink: 0 !important;
    /* CLAVE: Prohibido encogerse/aplastarse */
    flex-grow: 0 !important;
    /* No crecer más de lo necesario */
    white-space: nowrap !important;
    /* El texto "Enviar" nunca baja de línea */
    margin: 0 !important;
    height: 42px;
    /* Altura fija para alineación */
}

/* =================================================================
   FIX FINAL: LAYOUT FIJO (APP MODE) & Z-INDEX
   ================================================================= */

/* 1. ANCLAR EL LAYOUT DEL CHAT */
/* Esto obliga al chat a quedarse quieto debajo del header principal.
   Elimina el scroll del cuerpo y evita que se esconda detrás del menú. */
.meeting-room-layout,
.office-layout,
.entrevista-layout {
    position: fixed !important;
    /* Fijar en pantalla */
    top: var(--header-height) !important;
    /* Empezar justo debajo del header (70px) */
    left: 0;
    right: 0;
    bottom: 0;
    /* Llegar hasta abajo del todo */
    height: auto !important;
    /* La altura la definen top y bottom */
    width: 100%;
    z-index: 1;
    margin: 0 !important;
    overflow: hidden;
    /* El scroll será interno, no de la página */
}

/* 2. OCULTAR EL FOOTER EN MODO APP */
/* Si estamos en una sala de chat, el footer sobra. Ganamos espacio vertical. */
body:has(.office-layout) .footer-content,
body:has(.meeting-room-layout) .footer-content,
body:has(.entrevista-layout) .footer-content {
    display: none !important;
}

/* 3. CAPAS SUPERIORES (SOLUCIONA EL DESPLEGABLE CORTADO) */
/* Aseguramos que el menú de proyectos flote POR ENCIMA del Header de la Web (z-1000) */
.office-project-switcher,
.project-dropdown-menu {
    z-index: 1100 !important;
    /* Tiene que ser > 1000 (Header Web) */
}

/* =========================================
   FIX SCROLL SIDEBAR ENTREVISTA
   ========================================= */
#all-profiles-list {
    flex: 1;
    /* Ocupar todo el espacio vertical disponible */
    overflow-y: auto;
    /* Activar scroll vertical automático */
    min-height: 0;
    /* Truco para que el scroll funcione en Flexbox */
    padding: 10px;
    /* Un poco de aire */
    display: flex;
    flex-direction: column;
    gap: 5px;
    /* Separación entre perfiles */
}

/* Opcional: Estilizar la barra de scroll para que sea sutil */
#all-profiles-list::-webkit-scrollbar {
    width: 6px;
}

#all-profiles-list::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

/* =========================================================
   BLOQUE: PÁGINAS LEGALES & CONTACTO (Refactorizado)
   ========================================================= */

/* --- Contenedores Específicos --- */
.container.legal-width {
    max-width: 900px;
}

.container.contact-width {
    max-width: 800px;
}

/* --- Cabeceras de Páginas Legales --- */
.legal-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.legal-header h2 {
    font-size: 1.8rem;
    color: var(--text-main);
    margin: 0 0 0.5rem 0;
}

/* --- Cuerpo de Texto Legal --- */
.legal-body {
    margin-bottom: 3rem;
}

.legal-subtitle {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

/* --- Página de Contacto: Estilos Específicos --- */
.contact-card {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.contact-subtitle {
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.contact-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: left;
}

/* Modificadores para enlaces de contacto (emails) */
.contact-link {
    font-size: 1.2rem;
    text-decoration: none;
    color: inherit;
}

/* Modificadores de color para los iconos de contacto */
.opt-check.icon-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.opt-check.icon-warning {
    background: var(--warning-color);
    border-color: var(--warning-color);
}

.opt-check.icon-dark {
    background: var(--text-main);
    border-color: var(--text-main);
}

/* ************************************************** */
/* ****** BLOQUE: 19. RESPONSIVE COMPLETO (ADDON) *** */
/* ************************************************** */

/* --- TABLETS Y PANTALLAS PEQUEÑAS (Max 1024px) --- */
@media (max-width: 1024px) {

    .chat-window,
    .mini-chat-window,
    .office-chat-window {
        padding: .4rem;
    }

    .chat-message.david .message-content,
    .chat-message.david .message-bubble {
        padding: .2rem;
    }

    .container,
    .container:has(#profiles-list-view) {
        padding: .2rem;
        max-width: 100%;
    }

    .meeting-header,
    .entrevista-header {
        flex-direction: column !important;
        height: auto !important;
        padding: 12px 15px !important;
        gap: 12px;
        /* Espacio entre el perfil y los botones */
        position: relative;
        /* Necesario para la X de cerrar */
        align-items: flex-start !important;
    }

    .dashboard-grid {
        gap: 1.5rem;
    }

    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary-section {
        position: static;
        margin-top: 2rem;
    }

    .welcome-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2rem;
        min-height: auto;
        margin-top: .5rem;
    }

    .video-chat-wrapper {
        max-height: 100%;
    }

    .team-card-dashboard {
        flex-direction: column;
    }

    .team-image-column {
        height: 150px;
        width: 100%;
    }

    .team-members-sidebar {
        width: 100%;
    }

    .profile-card-inner {
        padding: 7.5rem 1.5rem 1.5rem 1.5rem;
    }

    .card-content {
        text-align: center;
    }

    .filters {
        height: 0;
        visibility: hidden;
    }

    .filters {
        flex-direction: column;
    }

    .profiles-grid {
        margin-top: 20px;
    }

    #profiles-list-view .page-header {
        padding-bottom: 0px;
        display: none;
    }

    .mini-chat-container {
        height: 100%;
        min-height: 640px;
    }

    .office-project-switcher {
        /* Aseguramos que en escritorio no se colapse */
        min-width: 200px;
    }
}

/* ==========================================================================
   MEDIA QUERY MÓVIL (MAX-WIDTH: 768px) - VERSIÓN FINAL COMPLETA
   ========================================================================== */
@media (max-width: 768px) {

    /* ---------------------------------------------------------
       1. AJUSTES GENERALES Y NAVEGACIÓN
       --------------------------------------------------------- */
    html {
        font-size: 14px;
    }

    body {
        padding-top: 60px;
    }

    /* Header Web más pequeño */

    .header-container {
        padding: 0 1rem;
        height: 60px;
    }

    .logo-img {
        height: 30px;
    }

    /* Menú superior simplificado */
    .nav-button {
        padding: 0.5rem;
        min-width: auto;
    }

    .nav-button .button-text {
        display: none;
    }

    .lang-selector {
        display: block;
    }

    /* ---------------------------------------------------------
       2. LAYOUT APP MODE (FIJO SIN SCROLL EN BODY)
       --------------------------------------------------------- */
    .meeting-room-layout,
    .office-layout,
    .entrevista-layout {
        position: fixed !important;
        top: 60px !important;
        left: 0;
        right: 0;
        bottom: 0;
        height: auto !important;
        width: 100%;
        margin: 0 !important;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        z-index: 1;
        background: var(--bg-subtle);
    }

    /* ---------------------------------------------------------
       3. SIDEBARS (GESTIÓN DIFERENCIADA)
       --------------------------------------------------------- */

    /* EN MEETING ROOM: Tira horizontal de perfiles */
    .meeting-room-layout .contracted-profiles-sidebar,
    .entrevista-layout .all-profiles-sidebar {
        width: 100%;
        height: 65px;
        background: var(--bg-white);
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 5px 10px;
        gap: 10px;
        flex-shrink: 0;
        order: 1;
        /* Va primero */
        scrollbar-width: none;
    }

    /* Ocultar elementos sobrantes en la tira */
    #projects-separator,
    .sidebar-separator,
    .sidebar-title {
        display: none !important;
    }

    /* Listas horizontales */
    #profiles-scroll-area,
    #projects-scroll-area,
    .profiles-list {
        display: flex;
        flex-direction: row !important;
        gap: 10px;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        flex-shrink: 0;
        height: 100%;
        align-items: center;
        background: transparent;
    }

    /* Mini tarjetas de perfil */
    .profile-list-item {
        min-width: 160px;
        max-width: 160px;
        height: 45px;
        flex-shrink: 0;
        background: var(--bg-white);
        border: 1px solid var(--border-light);
        display: flex;
        align-items: center;
        padding: 0 8px;
        border-radius: 8px;
        margin: 0 !important;
    }

    .profile-list-profession {
        display: none;
    }

    /* EN OFFICE: Ocultamos sidebar (usaremos el Dropdown) */
    .office-layout .all-profiles-sidebar,
    .office-layout .contracted-profiles-sidebar {
        display: none !important;
    }

    /* El contenedor del chat va debajo de la tira (si la hay) */
    .office-container,
    .meeting-room-container,
    .entrevista-container {
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow: hidden;
        order: 2;
    }

    /* ---------------------------------------------------------
       4. CABECERA: MEETING ROOM (FICHA COMPLETA)
       --------------------------------------------------------- */
    .meeting-header,
    .entrevista-header {
        flex-direction: column !important;
        height: auto !important;
        padding: 10px 15px !important;
        gap: 10px;
        background: var(--bg-white);
        border-bottom: 1px solid #e2e8f0;
        z-index: 50;
        flex-shrink: 0;
        align-items: flex-start !important;
    }

    /* Ficha del Perfil (Meeting) */
    .meeting-header .advisor-info,
    .entrevista-header .advisor-info {
        width: 100%;
        flex-direction: row !important;
        /* Avatar izq, Texto der */
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 12px;
        border-bottom: none !important;
        padding: 0 !important;
    }

    .meeting-header .advisor-avatar,
    .entrevista-header .advisor-avatar {
        width: 45px !important;
        height: 45px !important;
        border-radius: 50%;
        border: 2px solid #e2e8f0;
    }

    .meeting-header .advisor-details {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    /* Nombre y Rol Visibles */
    .meeting-header .chat-title,
    .meeting-header .advisor-name {
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        color: var(--text-main);
        line-height: 1.2;
        margin: 0;
    }

    .meeting-header .advisor-profession,
    .entrevista-header .advisor-profession {
        display: block !important;
        /* FORZAMOS VISIBILIDAD */
        font-size: 0.85rem !important;
        color: var(--primary-color) !important;
        font-weight: 500;
        margin-top: 2px;
    }

    /* Botón cerrar Meeting (Flotante) */
    #closeMeetingButton,
    #closeEntrevistaButton {
        position: absolute;
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        background: #fee2e2;
        color: #ef4444;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Herramientas Meeting (Debajo) */
    .meeting-header .chat-header-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
        padding-top: 8px;
        border-top: 1px solid #f1f5f9;
    }

    /* ---------------------------------------------------------
       5. CABECERA: OFFICE (JERARQUÍA COMPLETA)
       --------------------------------------------------------- */
    .office-header {
        display: flex;
        flex-direction: column;
        height: auto;
        padding: 6px 15px;
        gap: 5px;
        background: var(--bg-white);
        border-bottom: 1px solid #e2e8f0;
        z-index: 50;
        flex-shrink: 0;
    }

    /* ZONA 1 (ARRIBA): SELECTOR DE INTERLOCUTOR (AGENTE) */
    .office-agent-switcher {
        display: block !important;
        width: 100%;
        order: 1;
        margin-bottom: 0;
    }

    /* Estilo Botón Agente Desplegable */
    #officeAgentBtn {
        width: 100%;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: var(--bg-white);
        border: 1px solid var(--primary-color);
        padding: 0 12px;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(59, 130, 246, 0.1);
        cursor: pointer;
    }

    #officeAgentBtn img {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        object-fit: cover;
        margin-right: 10px;
        border: 1px solid var(--border-light);
    }

    #officeAgentBtn div {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        flex: 1;
    }

    /* Texto del Agente */
    #officeAgentBtn span:nth-child(1) {
        display: none;
    }

    /* Ocultar "Hablando con" */
    #officeAgentBtn span:last-child {
        font-size: 1rem !important;
        font-weight: 700;
        color: var(--text-main);
    }

    #officeAgentBtn i.fa-chevron-down {
        display: block !important;
        color: var(--primary-color);
    }

    /* ZONA 2 (MEDIO): PROYECTO + CERRAR */
    .office-header .advisor-info {
        width: 100%;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        order: 2;
    }

    .office-project-switcher {
        flex: 1;
        margin-right: 10px;
    }

    #officeProjectTitle.btn-style {
        background: var(--bg-surface) !important;
        border: 1px solid #cbd5e1 !important;
        padding: 0 12px !important;
        height: 38px !important;
        border-radius: 6px !important;
        width: 100%;
        justify-content: space-between !important;
        display: flex;
        align-items: center;
        font-size: 0.9rem !important;
        color: var(--text-muted) !important;
        font-weight: 600;
    }

    #closeOfficeButton {
        position: static !important;
        width: 38px !important;
        height: 38px !important;
        background-color: #fee2e2 !important;
        color: #ef4444 !important;
        border-radius: 6px !important;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    /* Ocultar sobras */
    .office-header .advisor-info>div[style*="width: 1px"] {
        display: none !important;
    }

    /* ZONA 3 (ABAJO): HERRAMIENTAS */
    .chat-header-actions,
    .office-header .chat-header-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 4px;
        border-top: 1px solid #f1f5f9;
        margin-top: 0;
        order: 3;
    }

    /* Toggle Thinking */
    .model-toggle-wrapper {
        flex: 1;
        border: none !important;
        padding: 0 !important;
    }

    .model-toggle-btn {
        background: transparent;
        padding: 0;
        color: var(--text-muted);
        font-weight: 600;
        font-size: 0.8rem;
    }

    #meetingModelText,
    #officeModelText {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100px;
        display: inline-block;
        vertical-align: middle;
    }

    /* Botones Herramientas */
    .chat-header-actions .btn,
    .fs-btn {
        width: 32px !important;
        height: 32px !important;
        padding: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        border: 1px solid var(--border-light);
        border-radius: 6px;
        margin-left: 4px;
        color: var(--text-muted);
    }

    .chat-header-actions .btn span {
        display: none !important;
    }

    #clearChatHistory,
    #officeClearHistory {
        color: #ef4444 !important;
        border-color: #fee2e2 !important;
        display: flex !important;
    }

    .font-size-controls {
        border: none !important;
        padding: 0 !important;
        gap: 4px;
    }

    /* ---------------------------------------------------------
       6. ÁREA DE CHAT E INPUTS
       --------------------------------------------------------- */
    .chat-window,
    .office-chat-window,
    .mini-chat-window {
        padding: 1rem;
        flex: 1;
        overflow-y: auto;
    }

    .chat-message {
        max-width: 100%;
    }

    .chat-input-area,
    .office-input-area,
    .mini-chat-input-area {
        padding: .5rem 1rem;
        flex-shrink: 0;
        background: var(--bg-white);
        z-index: 20;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
        border-top: 1px solid #e2e8f0;
        gap: 8px;
    }

    textarea.chat-input,
    textarea.office-chat-input {
        font-size: 13px;
        max-height: 65px;
    }

    /* Evita zoom iOS */

    /* ---------------------------------------------------------
       7. DASHBOARD (RESTAURADO)
       --------------------------------------------------------- */
    .dashboard-grid {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        padding-bottom: 3rem;
        margin-top: 1rem;
    }

    /* Ficha David Vertical */
    .advisor-horizontal-layout {
        flex-direction: column;
        text-align: center;
        padding-top: 2rem;
    }

    .advisor-avatar-section img {
        position: static;
        transform: none;
        margin-bottom: 1rem;
        width: 100px;
        height: 100px;
        border-radius: 50%;
    }

    .advisor-info-section {
        padding: 0;
        margin-bottom: 1rem;
    }

    .advisor-actions-section,
    .advisor-actions-section .btn {
        width: 100%;
    }

    /* Tarjetas Equipos Verticales */
    .team-card-dashboard {
        flex-direction: column;
        height: auto;
        min-height: auto;
    }

    .team-image-column {
        width: 100%;
        height: 150px;
    }

    .team-info-column {
        border-right: none;
        padding: 1.5rem;
    }

    .team-members-sidebar {
        width: 100%;
        border-top: 1px solid #e2e8f0;
    }

    /* Welcome Video Vertical */
    .video-chat-wrapper {
        grid-template-columns: 1fr;
        height: auto;
        gap: 1.5rem;
    }

    .youtube-video-container {
        min-height: 220px;
        border-radius: 12px;
    }

    #minichat-placeholder {
        min-height: 500px;
        border-radius: 12px;
    }

    .welcome-grid {
        grid-template-columns: 1fr;
        margin-top: 1rem;
    }

    .welcome-title {
        font-size: 1.8rem;
    }

    /* ---------------------------------------------------------
       8. FACTURAS (RESTAURADO)
       --------------------------------------------------------- */
    .invoice-paper {
        padding: 1rem;
        width: 100%;
        border: none;
        box-shadow: none;
    }

    .invoice-top-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .invoice-meta-group {
        text-align: left;
    }

    .invoice-parties {
        flex-direction: column;
        gap: 1.5rem;
    }

    .party-col.receiver {
        margin-top: 0 !important;
    }

    /* Tabla Responsive */
    .invoice-table th,
    .invoice-table td {
        padding: 0.8rem 0.5rem;
        font-size: 0.85rem;
    }

    .invoice-table th:nth-child(2),
    .invoice-table td:nth-child(2),
    .invoice-table th:nth-child(4),
    .invoice-table td:nth-child(4) {
        display: none;
    }

    /* Ocultar col. extra */

    .invoice-footer {
        flex-direction: column-reverse;
        gap: 1.5rem;
    }

    .invoice-totals {
        width: 100%;
    }

    .invoice-notes {
        max-width: 100%;
    }

    /* ---------------------------------------------------------
       9. OTROS (ADMIN, AUTH, CARRITO, MODALES)
       --------------------------------------------------------- */
    /* Auth */
    .auth-container {
        padding: 10px;
        width: 100%;
    }

    .auth-form {
        padding: 1.5rem;
    }

    /* Admin Scrollable */
    .admin-sub-header {
        overflow-x: auto;
        white-space: nowrap;
        padding: 0.5rem 0;
        -webkit-overflow-scrolling: touch;
    }

    .admin-sub-nav {
        justify-content: flex-start;
        padding: 0 1rem;
        gap: 8px;
    }

    /* Carrito */
    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-card-image {
        width: 100%;
        height: 120px;
    }

    .cart-header-row {
        width: 100%;
    }

    .cart-summary-section {
        position: static;
        margin-top: 2rem;
    }

    /* Modales */
    .modal-content,
    .hire-modal-compact {
        width: 95%;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
        padding: 1.5rem;
    }

    .modal-close-btn.compact-close {
        top: 10px;
        right: 10px;
    }

    /* Mini Chat */
    .mini-chat-container {
        height: 100%;
        min-height: 500px;
        display: flex;
        flex-direction: column;
    }

    /* Filtros */
    .filters {
        flex-direction: column;
        height: auto;
        border-radius: 12px;
    }

    #nameFilter {
        width: 100%;
        border-bottom: 1px solid #e2e8f0 !important;
        margin-bottom: 10px !important;
    }

    #profileTypeFilter {
        width: 100%;
        border-left: none !important;
        padding-left: 0;
    }

    #applyFiltersBtn {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
    }

    /* =========================================================
       FIX: BOTÓN MODO PENSAMIENTO (SOLO ICONO + TOOLTIP)
       ========================================================= */

    /* 1. Contenedor: Ocupa solo lo necesario */
    .model-toggle-wrapper {
        flex: 0 0 auto !important;
        /* No estirar */
        width: auto !important;
        margin-right: auto !important;
        /* Empujar el resto de botones a la derecha */
        border: none !important;
        padding: 0 !important;
        position: relative !important;
        /* Referencia para el tooltip */
    }

    /* 2. Botón: Cuadrado y limpio */
    .model-toggle-btn {
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 6px !important;
        border: 1px solid #cbd5e1 !important;
        /* Borde gris suave */
        background: var(--bg-white) !important;
        color: #64748b !important;
        /* Icono Gris (Inactivo) */
        transition: all 0.2s ease !important;
        gap: 0 !important;
        /* Sin espacio extra */
    }

    /* 3. Estado ACTIVO (Morado) */
    /* Cuando el JS le pone la clase .active */
    .model-toggle-btn.active {
        border-color: #8b5cf6 !important;
        /* Borde Morado */
        color: #8b5cf6 !important;
        /* Icono Morado */
        background-color: #f5f3ff !important;
        /* Fondo lila muy suave */
        box-shadow: 0 2px 4px rgba(139, 92, 246, 0.2) !important;
    }

    /* 4. El Icono (Rayo) */
    .model-toggle-btn i {
        font-size: 1.1rem !important;
        /* Tamaño legible */
        margin: 0 !important;
    }

    /* 5. OCULTAR EL TEXTO ("Rápido v2.0") */
    #meetingModelText,
    #officeModelText {
        display: none !important;
    }

    /* 6. TOOLTIP (La explicación) */
    /* Se abre hacia la derecha para no cortarse */
    .model-tooltip {
        visibility: hidden;
        /* Oculto por defecto */
        opacity: 0;

        position: absolute !important;
        top: 100% !important;
        /* Justo debajo del botón */
        left: 0 !important;
        /* Alineado a la izquierda del botón */
        right: auto !important;
        /* NO a la derecha */
        margin-top: 10px !important;

        width: 250px !important;
        /* Ancho fijo cómodo */
        max-width: 80vw !important;
        /* Que no se salga en pantallas muy peques */

        background: var(--bg-white) !important;
        border: 1px solid var(--border-light) !important;
        border-radius: 8px !important;
        box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.15) !important;
        padding: 12px !important;
        z-index: 1000 !important;
        text-align: left !important;

        transition: opacity 0.2s ease !important;
    }

    /* Mostrar Tooltip al pasar el dedo/mouse */
    .model-toggle-wrapper:hover .model-tooltip,
    .model-toggle-wrapper:active .model-tooltip,
    .model-toggle-wrapper:focus-within .model-tooltip {
        visibility: visible !important;
        opacity: 1 !important;
        display: block !important;
    }

    /* Flechita del Tooltip (Ajustada a la izquierda) */
    .model-tooltip::before {
        content: '';
        position: absolute;
        top: -6px;
        left: 14px;
        /* Centrada con el botón de 38px */
        right: auto;
        width: 10px;
        height: 10px;
        background: var(--bg-white);
        border-left: 1px solid #e2e8f0;
        border-top: 1px solid #e2e8f0;
        transform: rotate(45deg);
    }
}


/* --- MÓVILES PEQUEÑOS (Max 480px) --- */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .nav-group {
        gap: 0.2rem;
    }

    .btn {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }

    .meeting-header,
    .office-header {
        padding: 0.5rem;
        height: auto;
    }

    .advisor-info {
        gap: 0.5rem;
    }

    .advisor-avatar {
        width: 35px;
        height: 35px;
    }

    .chat-title,
    .advisor-name {
        font-size: 0.95rem;
    }

    .advisor-profession {
        display: none;
    }

    .chat-input-area,
    .office-input-area {
        padding: 0.8rem;
    }

    .chat-input,
    .office-chat-input {
        font-size: 16px;
    }

    .admin-sub-header {
        overflow-x: auto;
        white-space: nowrap;
    }

    .admin-sub-nav {
        justify-content: flex-start;
        padding: 0 1rem;
    }

    .team-image-column {
        height: 150px;
    }

    .team-card-dashboard {
        border-radius: var(--radius-md);
    }

    .modal-content {
        padding: 1.5rem;
        width: 95%;
        margin: 10px;
    }
}

/* =========================================
   FORMATO CHAT PERSONALIZADO (TAGS)
   ========================================= */

/* Títulos */
.fmt-title {
    font-size: 120%;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 10px;
    margin-bottom: 5px;
    display: block;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 3px;
}

.fmt-subtitle {
    font-size: 110%;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 8px;
    margin-bottom: 3px;
    display: block;
}

/* Listados */
.fmt-list-item {
    /* display: flex;*/
    /* align-items: flex-start; */
    margin-bottom: 4px;
    padding: 5px;
    flex-direction: column;
    /* gap: 5px; */
    border: 1px solid rgba(55, 55, 55, .3);
    background-color: rgba(55, 55, 55, .1);
}

.fmt-list-item::before {
    /* content: "•";
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 15px;*/
}

/* Bloque TXT (Estilo nota/código) */
.fmt-txt-block {
    background-color: #fffbeb55;
    border: 1px solid var(--border-light);
    border-left: 4px solid #f59e0b;
    color: #4b5563;
    font-family: "Google Sans Code", monospace;
    font-size: .7rem;
    padding: 5px 10px;
    margin: 10px 0;
    border-radius: 4px;
    white-space: pre-wrap;
    line-height: 1.3;
}

/* Estilos inline */
.fmt-bold {
    font-weight: 600;
}

.fmt-italic {
    font-style: italic;
}

.fmt-underline {
    text-decoration: underline;
    text-decoration-color: var(--primary-color);
}

/* --- ESTILOS DE FAVORITOS EN SIDEBAR --- */
.profile-list-item {
    position: relative;
    /* Para posicionar la estrella */
    padding-right: 35px;
    /* Espacio para que el texto no tape la estrella */
}

.profile-star {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.1rem;
    color: #cbd5e1;
    /* Gris desactivado */
    transition: all 0.2s ease;
    z-index: 10;
    /* Por encima del clic del perfil */
    padding: 5px;
}

.profile-star:hover {
    color: #fbbf24;
    /* Amarillo al pasar el mouse */
    transform: translateY(-50%) scale(1.2);
}

.profile-star.active {
    color: #f59e0b;
    /* Dorado activado */
    font-weight: 900;
    /* Asegura que se vea rellena si usas FontAwesome */
}

/* Ajuste para móvil si es necesario */
@media (max-width: 768px) {
    .profile-star {
        right: 5px;
        font-size: 1rem;
    }
}

/* --- HEADER: SALDO DISCRETO --- */
.nav-balance {
    display: flex;
    align-items: center;
    margin-left: 10px;
    margin-right: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    background: transparent;
    /* Sin fondo llamativo */
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    color: var(--text-muted);
    /* Color gris suave */
}

.nav-balance:hover {
    background-color: var(--bg-subtle);
    /* Fondo muy sutil al pasar el ratón */
}

.nav-balance i.fa-coins {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-right: 6px;
}

#headerPiaBalance {
    font-weight: 200;
    color: var(--text-muted);
    background-color: rgba(0, 0, 0, 0);
    font-size: 0.8rem;
}

#headerPiaBalance:hover {
    font-weight: 500;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    font-size: 0.8rem;
}



.nav-balance span:nth-of-type(2) {
    /* El texto "PIAs" */
    font-size: 0.7rem;
    color: #94a3b8;
    margin-left: 3px;
    /* text-transform: uppercase;*/
}

/* Botón pequeño de recarga (+) */
.add-credits-btn-small {
    background: transparent;
    border: 1px solid var(--border-light);
    color: #94a3b8;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    margin-left: 8px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.nav-balance:hover .add-credits-btn-small {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-white);
}

/* =========================================
   200. ESTILOS UNIFICADOS (CÓDIGO Y DIAGRAMAS)
   ========================================= */

/* --- CONTENEDOR GENERAL (Gris Claro Técnico) --- */
.chat-code-block,
.chat-mermaid-container {
    background: rgba(240, 240, 243, 0.9);
    /* Gris claro, ligeramente transparente */
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    margin: 12px 0;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    backdrop-filter: blur(5px);
}

/* --- HEADER COMPARTIDO --- */
.chat-code-header,
.mermaid-header {
    background: rgba(230, 230, 233, 0.60);
    /* Un pelín más oscuro que el cuerpo */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* --- TÍTULOS --- */
.chat-code-lang,
.mermaid-title {
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.65rem;
    color: #666;
    /* Gris medio para el título */
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* --- BOTONES MINI (ICONOS) --- */
.chat-action-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #888;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
}

.chat-action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.chat-action-btn.active {
    color: #2563eb;
    /* Azul activo */
    background: rgba(37, 99, 235, 0.1);
}

/* --- CUERPO DEL CONTENIDO (Letras Negras Finas) --- */
.chat-code-body,
.mermaid-content-visual,
.mermaid-content-code {
    padding: 15px;
    margin: 0;
    overflow-x: auto;

    background: transparent;
    color: #1a1a1a;
    /* Negro casi puro */
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.7rem;
    font-weight: 300;
    /* Letra fina pero legible */
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Ajuste específico para el visualizador de Mermaid */
.mermaid-content-visual {
    text-align: center;
    /*background: rgba(255, 255, 255, 0.5); /* Un poco más blanco para resaltar el gráfico */
}

/* Error amigable Mermaid */
.mermaid-error-box {
    background: #fff8f0;
    border: 1px solid #f97316;
    border-radius: 8px;
    padding: 12px 14px;
    color: #9a3412;
    font-size: 0.85rem;
    text-align: left;
}
.mermaid-error-box pre {
    margin-top: 8px;
    font-size: 0.75rem;
    background: var(--bg-white);
    padding: 8px;
    border-radius: 4px;
    overflow: auto;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 150px;
}

/* =========================================
   200b. ESTILOS MENSAJES BANANA / PLUGINS
   ========================================= */
.message-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 0;
}
.message-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}
.message-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    background: var(--bg-white);
    display: block;
}
.message-bubble {
    width: 100%;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 0;
    box-sizing: border-box;
}
.message-sender {
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 5px;
}

/* =========================================
   201. ESTILOS FIL-MANAGER
   ========================================= */








/* css/file-manager.css */

/* Fondo oscuro (Overlay) */
/* ************************************************** */
/* ****** BLOQUE: 21. FILE MANAGER (Página) ******** */
/* ************************************************** */

/* Layout Principal de File Manager */
.fm-layout {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 250px);
    background: var(--bg-subtle);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

/* Sidebar Lateral */
.fm-sidebar {
    width: 260px;
    background: var(--bg-white);
    border-right: 1px solid #e2e8f0;
    padding: 24px 16px;
    overflow-y: auto;
    flex-shrink: 0;
}

.fm-filter-group {
    margin-bottom: 32px;
}

.fm-filter-group label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding-left: 12px;
}

/* Botones de Filtro */
.fm-filter,
.fm-type-filter {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    color: #475569;
    cursor: pointer;
    margin-bottom: 4px;
    font-size: 0.9rem;
    transition: all 0.2s;
    font-weight: 500;
}

.fm-filter i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
    color: #94a3b8;
    transition: color 0.2s;
}

.fm-filter:hover,
.fm-type-filter:hover {
    background: var(--bg-surface);
    color: #1e293b;
}

.fm-filter.active,
.fm-type-filter.active {
    background: #eff6ff;
    color: #2563eb;
}

.fm-filter.active i {
    color: #3b82f6;
}

/* Área de Contenido (Grid) */
.fm-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    position: relative;
    background: var(--bg-subtle);
}

.fm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

/* Tarjeta de Archivo */
.fm-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.fm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

/* Previsualización */
.fm-preview {
    height: 140px;
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
}

.fm-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.fm-card:hover .fm-preview img {
    transform: scale(1.05);
}

.fm-preview i {
    font-size: 3.5rem;
    color: #cbd5e1;
}

/* Colores específicos por tipo */
.fm-preview .fa-file-pdf {
    color: #ef4444;
}

.fm-preview .fa-file-word {
    color: #3b82f6;
}

.fm-preview .fa-file-excel {
    color: #10b981;
}

.fm-preview .fa-file-powerpoint {
    color: #f97316;
}

.fm-preview .fa-file-archive {
    color: #8b5cf6;
}

/* Info del Archivo */
.fm-info {
    padding: 16px;
}

.fm-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.fm-meta {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
}

/* Badges (Etiquetas) */
.fm-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-general {
    background: var(--bg-surface);
    color: #64748b;
}

.badge-project {
    background: #e0f2fe;
    color: #0284c7;
}

/* Botón Descarga */
.fm-download-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--bg-white);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.2s;
    z-index: 10;
}

.fm-card:hover .fm-download-btn {
    opacity: 1;
    transform: scale(1);
}

.fm-download-btn:hover {
    color: #2563eb;
    transform: scale(1.1);
}

/* Estados Vacío y Carga */
.fm-empty,
.fm-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
    min-height: 300px;
}

.fm-empty i {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.fm-empty p {
    font-size: 1rem;
}

.fm-loader {
    color: #3b82f6;
}

.fm-loader i {
    font-size: 2rem;
    margin-bottom: 16px;
}

/* Scrollbar personalizado */
.fm-sidebar::-webkit-scrollbar,
.fm-content::-webkit-scrollbar {
    width: 6px;
}

.fm-sidebar::-webkit-scrollbar-thumb,
.fm-content::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    .fm-layout {
        flex-direction: column;
    }

    .fm-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        height: auto;
        max-height: 180px;
    }

    .fm-content {
        padding: 16px;
    }

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


/* ************************************************** */
/* ****** BLOQUE: 22. IDENTIDAD & BRANDING ********** */
/* ************************************************** */

.identity-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.identity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* Tarjetas de Identidad */
.identity-grid .card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Vista Previa del Branding */
.preview-box {
    width: 100%;
    min-height: 200px;
    border-radius: var(--radius-sm);
    border: 2px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: all 0.3s ease;
    background: var(--bg-white);
}

.preview-logo {
    max-width: 180px;
    max-height: 80px;
    object-fit: contain;
    margin-bottom: 20px;
}

/* Paleta de Colores Extraídos */
.color-palette {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--border-color);
    cursor: pointer;
    transition: transform 0.2s;
}

.color-dot:hover {
    transform: scale(1.2);
}

/* Adaptación Visual de Temas en la Previsualización */
.preview-box.theme-pro {
    border-left: 12px solid #0f172a;
    border-right: 1px solid #0f172a;
    border-top: 1px solid #0f172a;
    border-bottom: 1px solid #0f172a;
    border-radius: 4px;
}

.preview-box.theme-fun {
    background: #f5f3ff;
    border: 2px solid #8b5cf6;
    border-radius: 32px;
}

.preview-box.theme-strict {
    border: 2px solid #000;
    box-shadow: 6px 6px 0 #000;
    border-radius: 0;
}

.preview-box.theme-classic {
    background: #fdfbf7;
    border: 1px solid #dcd6cc;
    font-family: serif;
}

.preview-box.theme-admin {
    border-top: 5px solid #000;
    border-bottom: 1px solid #000;
    border-radius: 0;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 10px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 10px;
    font-weight: 700;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
}

.status-badge.info {
    background: #eff6ff;
    color: #1e40af;
}

/* Grid de imágenes para extracción de PDF */
.image-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 15px;
    padding: 10px;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
}

.extracted-img-item {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all 0.2s;
}

.extracted-img-item:hover {
    border-color: var(--primary-color);
    transform: scale(1.03);
}

.extracted-img-item img {
    width: 100%;
    height: auto;
    display: block;
}

.theme-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.theme-option {
    cursor: pointer;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 5px;
    text-align: center;
    transition: all 0.2s;
}

.theme-option img {
    width: 100%;
    border-radius: 4px;
    margin-bottom: 5px;
}

.theme-option span {
    font-size: 0.8rem;
    font-weight: 600;
}

.theme-option.active {
    border-color: var(--primary-color);
    background: rgba(99, 150, 233, 0.05);
}

/* ************************************************** */
/* ****** BLOQUE: 23. WELCOME PAGES (REDESIGN) ****** */
/* ************************************************** */
/* Welcome Hero Section */
.welcome-hero {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a2a6c 0%, #0d1128 100%);
    padding: 80px 40px 60px 40px;
    position: relative;
    overflow: hidden;
}

.welcome-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(79, 172, 254, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.offer-badge {
    position: absolute;
    top: 5px;
    right: 20px;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    z-index: 10;
}

.hero-left {
    color: white;
}

.hero-headline {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    background: linear-gradient(90deg, #fff 0%, #4facfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subheadline {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    line-height: 1.6;
}

.avatars-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 40px 0 20px 0;
}

.avatar-item {
    text-align: center;
    animation: breathing 3s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.3s;
}

.avatar-item:hover {
    transform: scale(1.1);
}

.avatar-item:nth-child(2) {
    animation-delay: 0.5s;
}

.avatar-item:nth-child(3) {
    animation-delay: 1s;
}

.avatar-item:nth-child(4) {
    animation-delay: 1.5s;
}

.avatar-item:nth-child(5) {
    animation-delay: 2s;
}

.avatar-item:nth-child(6) {
    animation-delay: 2.5s;
}

@keyframes breathing {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(79, 172, 254, 0.5);
    margin-bottom: 8px;
    background: var(--bg-white);
}

.avatar-name {
    display: block;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.team-note {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

/* Formulario de Registro */
.register-card {
    background: rgba(255, 255, 255, 0.98);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
}

.register-card h2 {
    color: #1e293b;
    margin: 0 0 8px 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.form-subtitle {
    color: #64748b;
    margin-bottom: 30px;
}

.quick-register-form .form-group {
    margin-bottom: 20px;
}

.quick-register-form label {
    display: block;
    margin-bottom: 8px;
    color: #475569;
    font-weight: 600;
    font-size: 0.9rem;
}

.quick-register-form .form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
}

.quick-register-form .form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-cta {
    width: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 18px 24px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 24px 0;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.4);
}

.form-checkmarks {
    margin: 20px 0;
}

.checkmark-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #475569;
    font-size: 0.95rem;
}

.checkmark-item i {
    color: #10b981;
    font-size: 1.1rem;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: #64748b;
    font-size: 0.95rem;
}

.auth-switch a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
}

/* Diferenciadores */
.differentiators {
    padding: 80px 40px;
    background: var(--bg-subtle);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 50px;
    color: #1e293b;
}

.diff-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
}

.diff-card {
    background: var(--bg-white);
    padding: 40px 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.diff-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.diff-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.diff-card h3 {
    color: #1e293b;
    margin-bottom: 16px;
    font-size: 1.3rem;
}

.diff-card p {
    color: #64748b;
    line-height: 1.7;
}

/* Social Proof */
.social-proof {
    padding: 60px 40px;
    background: linear-gradient(135deg, #1a2a6c 0%, #0d1128 100%);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
    max-width: 900px;
    margin: 0 auto;
}

.stat-item {
    text-align: center;
    color: white;
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Final CTA */
.final-cta {
    padding: 80px 40px;
    text-align: center;
    background: var(--bg-white);
}

.final-cta h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: #1e293b;
}

.final-cta p {
    color: #64748b;
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.btn-cta-large {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 20px 50px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.3);
    transition: transform 0.2s;
}

.btn-cta-large:hover {
    transform: translateY(-3px);
}

.cta-note {
    margin-top: 16px;
    color: #94a3b8;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 968px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .offer-badge {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: 20px;
        display: inline-block;
    }

    .hero-headline {
        font-size: 2.5rem;
    }

    .diff-grid,
    .stats-row {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 30px rgba(16, 185, 129, 0.6);
    }
}

.mobile-welcome-v2 {
    min-height: 100vh;
    background: #0d1128;
}

/* Hero Section */
.mobile-hero {
    min-height: 100vh;
    background: linear-gradient(180deg, #1a2a6c 0%, #0d1128 100%);
    color: white;
    padding: 40px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.mobile-hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.mobile-logo {
    font-size: 2rem;
    font-weight: 900;
    color: #4facfe;
    margin-bottom: 30px;
}

.mobile-badge {
    display: inline-block;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.mobile-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.mobile-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
    line-height: 1.6;
}

.btn-mobile-cta {
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    color: #0d1128;
    border: none;
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 800;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 6px 25px rgba(79, 172, 254, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 30px auto;
    transition: transform 0.2s;
}

.btn-mobile-cta:active {
    transform: scale(0.98);
}

.mobile-checkmarks {
    margin-top: 20px;
}

.check-item {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    font-size: 1rem;
}

.scroll-indicator {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    animation: bounce 2s infinite;
}

.scroll-indicator i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(10px);
    }
}

/* Mobile Section */
.mobile-section {
    padding: 60px 20px;
    background: var(--bg-white);
}

.mobile-section.dark {
    background: #1a2a6c;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: #1e293b;
}

.section-title.light {
    color: white;
}

.mobile-features {
    display: grid;
    gap: 30px;
    margin-bottom: 30px;
}

.feature-item {
    text-align: center;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.feature-item h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #1e293b;
}

.feature-item p {
    color: #64748b;
    font-size: 1rem;
}

.mobile-tagline {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    color: #1e293b;
    font-style: italic;
}

/* Carrusel */
.profiles-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding: 20px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.profiles-carousel::-webkit-scrollbar {
    display: none;
}

.carousel-card {
    min-width: 80%;
    scroll-snap-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    color: white;
}

.profile-avatar {
    width: 130px;
    height: 130px;
    margin: 0 auto 20px auto;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(79, 172, 254, 0.5);
    object-fit: cover;
}

/* ************************************************** */
/* ****** BLOQUE: 24. PIA PACKAGES (BUY CREDITS) *** */
/* ************************************************** */

.pricing-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #e2e8f0 20%, #e2e8f0 80%, transparent);
    margin: 60px 0;
}

.pricing-header {
    text-align: center;
    margin-bottom: 40px;
}

.pricing-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.pricing-header p {
    color: #64748b;
    font-size: 1.1rem;
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.package-card {
    background: var(--bg-white);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.package-card:hover {
    transform: translateY(-4px);
    border-color: #3b82f6;
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.15);
}

.package-icon {
    font-size: 2.5rem;
    color: #3b82f6;
    margin-bottom: 16px;
}

.package-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.package-pias {
    font-size: 1.8rem;
    font-weight: 800;
    color: #3b82f6;
    margin-bottom: 16px;
}

.package-price {
    margin-bottom: 24px;
}

.price-amount {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
}

.price-label {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 4px;
}

.package-footer .btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    border-radius: 10px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
}

.btn-outline:hover {
    background: rgba(59, 130, 246, 0.7);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

@media (max-width: 768px) {
    .packages-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 16px;
    }

    .package-card {
        padding: 24px 16px;
    }
}
 .promo-redeem-container {
        margin: 20px 0;
    }

    .promo-input-group {
        display: flex;
        gap: 12px;
        margin-bottom: 16px;
    }

    .promo-code-input {
        flex: 1;
        font-family: 'Courier New', monospace;
        font-size: 1rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        padding: 12px 16px;
    }

    #redeemPromoBtn {
        white-space: nowrap;
        min-width: 120px;
		height: 45px;
    }

    .promo-message {
        padding: 12px 16px;
        border-radius: 8px;
        font-size: 0.95rem;
        display: none;
    }

    .promo-message.success {
        display: block;
        background: #d1fae5;
        color: #065f46;
        border-left: 4px solid #10b981;
    }

    .promo-message.error {
        display: block;
        background: #fee2e2;
        color: #991b1b;
        border-left: 4px solid #ef4444;
    }

    .promo-message i {
        margin-right: 8px;
    }

    .promo-info-box {
        background: var(--bg-subtle);
        border: 1px solid var(--border-light);
        border-radius: 8px;
        padding: 16px;
        display: flex;
        gap: 12px;
        margin-top: 20px;
    }

    .promo-info-box i {
        color: #3b82f6;
        font-size: 1.2rem;
        flex-shrink: 0;
        margin-top: 2px;
    }

    .promo-info-box strong {
        display: block;
        margin-bottom: 4px;
        color: #1e293b;
    }

    .promo-info-box p {
        margin: 0;
        color: #64748b;
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .section-description {
        color: #64748b;
        margin-bottom: 20px;
        font-size: 0.95rem;
    }
/* === ESTILOS MODAL STATUS PROYECTO === */

/* Ajuste tamaño modal */
.status-modal-size {
    max-width: 900px !important;
    width: 95% !important;
    background: var(--bg-subtle) !important; /* Fondo gris muy suave */
}

/* Loader */
.status-loader {
    text-align: center;
    padding: 40px;
    color: #64748b;
}
.status-loader i { font-size: 2.5rem; color: #2563eb; margin-bottom: 15px; }

/* Cabecera Progreso */
.status-header-card {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
}

.phase-info { display: flex; flex-direction: column; }
.phase-info .label { font-size: 0.8rem; text-transform: uppercase; color: #64748b; font-weight: bold; }
.phase-info .value-phase { font-size: 1.2rem; font-weight: 800; color: #1e293b; }

.progress-container { flex: 1; min-width: 250px; }
.progress-info { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 0.9rem; font-weight: 600; }
.progress-bar-bg { height: 10px; background: #e2e8f0; border-radius: 5px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, #2563eb, #0ea5e9); transition: width 1s ease; }

/* Secciones */
.status-section { margin-bottom: 25px; }
.status-section h4, .status-col h4 { 
    color: #334155; border-bottom: 2px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 15px; font-size: 1rem;
}
.st-text-content { background: var(--bg-white); padding: 15px; border-radius: 8px; border-left: 4px solid #3b82f6; color: #475569; }

/* Columnas */
.status-columns { display: flex; gap: 20px; }
.status-col { flex: 1; background: var(--bg-white); padding: 15px; border-radius: 12px; border: 1px solid var(--border-light); }

/* Lista de Tareas */
.st-task-list { list-style: none; padding: 0; margin: 0; max-height: 300px; overflow-y: auto; }
.st-task-item { 
    display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; align-items: flex-start; 
}
.st-task-item:last-child { border-bottom: none; }
.st-task-icon { flex-shrink: 0; margin-top: 2px; }
.st-task-done .st-task-icon { color: #16a34a; } /* Verde */
.st-task-pending .st-task-icon { color: #cbd5e1; } /* Gris */
.st-task-desc { font-size: 0.95rem; color: #334155; }
.st-task-done .st-task-desc { text-decoration: line-through; color: #94a3b8; }
.st-task-who { font-size: 0.75rem; background: var(--bg-surface); padding: 2px 6px; border-radius: 4px; margin-left: auto; white-space: nowrap; }

/* Grid Datos Técnicos */
.st-tech-grid { 
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; 
}
.st-tech-item { background: var(--bg-subtle); padding: 10px; border-radius: 6px; border: 1px solid var(--border-light); word-break: break-word; }
.st-tech-key { display: block; font-size: 0.7rem; color: #64748b; text-transform: uppercase; font-weight: bold; margin-bottom: 3px; }
.st-tech-val { display: block; font-size: 0.9rem; color: #0f172a; font-weight: 600; font-family: monospace; }

/* Responsive */
@media (max-width: 768px) {
    .status-columns { flex-direction: column; }
}
/* Animación de Pensamiento */
.brain-pulse {
    width: 60px; height: 60px;
    background: #eff6ff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto;
    color: #3b82f6;
    font-size: 1.8rem;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}
/* === ESTILOS NUEVO DASHBOARD PROYECTOS (SPA) === */

.dashboard-wrapper-spa {
    display: flex;
    height: calc(100vh - 70px); /* Restamos altura del header principal */
    background: var(--bg-subtle);
    overflow: hidden;
}

/* Sidebar */
.dash-sidebar {
    width: 280px;
    background: var(--bg-white);
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.dash-header-title {
    padding: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    background: var(--bg-subtle);
}

.project-list { flex: 1; overflow-y: auto; padding: 15px; }

.project-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    color: #475569;
    font-size: 0.95rem;
    display: flex; justify-content: space-between; align-items: center;
}
.project-item:hover { background: var(--bg-surface); color: #1e293b; }
.project-item.active { 
    background: #eff6ff; 
    border-color: #bfdbfe; 
    color: #2563eb; 
    font-weight: 600; 
}

/* Main Area */
.dash-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }

.dash-toolbar {
    background: var(--bg-white);
    padding: 15px 30px;
    border-bottom: 1px solid #e2e8f0;
    display: flex; justify-content: space-between; align-items: center;
    height: 70px;
    box-sizing: border-box;
}
.toolbar-info h2 { margin: 0; font-size: 1.3rem; color: #1e293b; }
.last-update-badge { font-size: 0.75rem; color: #64748b; background: var(--bg-surface); padding: 2px 8px; border-radius: 4px; margin-left: 10px;}

.dash-content { padding: 30px; overflow-y: auto; flex: 1; }

/* Grid y Cards */
.dash-report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    padding-bottom: 40px;
}
.full-width { grid-column: 1 / -1; }

.dash-card { 
    background: var(--bg-white); 
    border-radius: 12px; 
    padding: 25px; 
    border: 1px solid var(--border-light); 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02); 
}

.card-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid #f1f5f9; padding-bottom: 10px; }
.card-title { margin: 0; color: #334155; font-size: 1.1rem; }

/* Elementos Visuales */
.phase-badge { background: #dcfce7; color: #166534; padding: 4px 12px; border-radius: 20px; font-weight: 700; font-size: 0.8rem; }
.summary-text { font-size: 1rem; color: #475569; line-height: 1.6; margin-bottom: 20px; }

.progress-track { height: 10px; background: var(--bg-surface); border-radius: 5px; margin-top: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #6366f1); transition: width 1s ease; }

.dash-task-list { list-style: none; padding: 0; margin: 0; }
.dash-task-item { padding: 12px 0; border-bottom: 1px solid #f1f5f9; display: flex; gap: 12px; align-items: start; }
.dash-task-done { text-decoration: line-through; color: #94a3b8; }
.dash-task-done i { color: #22c55e; }
.dash-task-pending i { color: #cbd5e1; }

.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tech-item { background: var(--bg-subtle); padding: 10px; border-radius: 6px; border: 1px solid var(--border-light); font-size: 0.9em; word-break: break-all; }
.tech-label { display: block; font-size: 0.7rem; color: #64748b; font-weight: bold; text-transform: uppercase; margin-bottom: 4px; }
.tech-val { font-weight: 600; color: #0f172a; }

/* Loader & Empty */
.empty-state { text-align: center; padding: 80px 20px; color: #94a3b8; }
.empty-state i { font-size: 4rem; margin-bottom: 20px; opacity: 0.3; }
.dash-loader { text-align: center; padding: 60px; }
.brain-pulse-large { font-size: 3rem; color: #3b82f6; margin-bottom: 20px; animation: pulse-ring 2s infinite; display: inline-block; }

/* Responsive */
@media (max-width: 900px) {
    .dashboard-wrapper-spa { flex-direction: column; height: auto; }
    .dash-sidebar { width: 100%; height: auto; max-height: 200px; }
    .dash-report-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   OFFICE MOBILE: BARRA HORIZONTAL DE PROYECTOS
   ========================================================== */

/* ==========================================================
   FIX HEADER MOBILE (HAMBURGUESA) Y INPUT TECLADO
   ========================================================== */

/* 1. Estilos Base del Botón Hamburguesa (Oculto en Desktop) */
.hamburger-btn {
    display: none;
    font-size: 1.5rem;
    color: var(--text-main);
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 1100;
}

/* Ocultar textos en escritorio (solo iconos) */
.desktop-hidden-text {
    display: none; 
}
#mobileMenuBtn {
	display: none; 
}
/* ==========================================================================
   MEDIA QUERY MÓVIL (MAX-WIDTH: 768px) - VERSIÓN FINAL UNIFICADA
   ========================================================================== */
@media (max-width: 768px) {

	#mobileMenuBtn {
		display: block; 
	}
    /* --- 1. AJUSTES GENERALES --- */
    html { font-size: 14px; }
    body { padding-top: 50px; }

    /* Header Compacto */
    .header-container { padding: 0 15px; height: 50px; justify-content: space-between; }
    .logo-img { height: 28px; }
    .hamburger-btn { display: block; }

    /* --- 2. MENÚ DESPLEGABLE (UNIFICADO) --- */
    .main-nav {
        position: fixed;
        top: 50px; left: 0; width: 100%;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        display: none;
        flex-direction: column;
        padding: 20px;
        gap: 10px;
        height: calc(100dvh - 50px); /* 100dvh para evitar problemas con barra navegador */
        overflow-y: auto;
        z-index: 1050;
    }

    .main-nav.active { display: flex; }

    /* Contenedores Flex Verticales */
    .nav-group, .nav-icons-group, .nav-profile-group {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    /* --- 3. ESTILO MAESTRO DE BOTONES (Oficinas, Reunión, Estado, Archivos, PIAs) --- */
    /* Aplicamos exactamente el mismo estilo a todos para que sean idénticos */
    .nav-button,
    .nav-balance {
        width: 100%;
        display: flex !important;
        justify-content: flex-start !important; /* Todo a la izquierda */
        align-items: center !important;
        padding: 15px !important;
        border-radius: 12px !important;
        background-color: var(--bg-subtle) !important; /* Gris muy suave uniforme */
        border: 1px solid var(--border-light) !important;
        font-size: 1.1rem !important;
        color: var(--text-main) !important;
        margin: 0 !important;
        box-shadow: none !important;
        min-height: 54px; /* Altura mínima uniforme */
    }

    /* Iconos alineados uniformemente */
    .nav-button i,
    .nav-balance i {
        width: 30px !important; /* Ancho fijo para alinear textos verticalmente */
        text-align: center !important;
        font-size: 1.2rem !important;
        color: var(--primary-color) !important;
        margin-right: 12px !important;
        flex-shrink: 0;
    }

    /* Textos (Forzar visibilidad y estilo) */
    .nav-button span, 
    .nav-button .button-text,
    .desktop-hidden-text,
    .nav-balance span {
        display: inline-block !important;
        font-weight: 500 !important;
        font-size: 1rem !important;
        color: var(--text-main) !important;
    }

    /* Ajuste específico para PIAs (número + texto) */
    .nav-balance div {
        display: flex;
        gap: 5px;
        align-items: center;
    }
    #headerPiaBalance {
        font-weight: 700 !important; /* Número en negrita */
    }

    /* --- 4. ESTILO ÚNICO PARA SALIR (ROJO) --- */
    .nav-button.danger {
        background-color: #fef2f2 !important;
        border-color: #fee2e2 !important;
        color: #ef4444 !important;
        margin-top: 10px !important;
    }
    .nav-button.danger i,
    .nav-button.danger span { 
        color: #ef4444 !important; 
    }

    /* --- 5. IDIOMAS (AL FINAL) --- */
    .lang-selector {
        margin-top: auto; /* Empujar al fondo */
        padding-top: 20px;
        border-top: 1px solid #e2e8f0;
        display: flex;
        justify-content: center;
        gap: 20px;
        padding-bottom: 30px;
    }

    /* --- 6. AJUSTES DE CHAT Y LAYOUT --- */
    .meeting-room-layout, 
    .office-layout {
        position: fixed !important;
        top: 50px !important;
        left: 0; right: 0; bottom: 0;
        height: calc(100dvh - 50px) !important;
        width: 100%;
        margin: 0 !important;
        overflow: hidden;
        z-index: 1;
    }

    /* Tira horizontal de proyectos (Office Mobile) */
    .office-layout .contracted-profiles-sidebar {
        display: flex !important;
        width: 100%;
        height: 60px;
        background: var(--bg-white);
        border-bottom: 1px solid #e2e8f0;
        align-items: center;
        overflow-x: auto;
        padding: 5px 10px;
        order: 1;
        gap: 10px;
        scrollbar-width: none;
    }
    
    .office-layout .contracted-profiles-sidebar::-webkit-scrollbar { display: none; }

    .office-container, .meeting-room-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        order: 2;
    }

    /* Input Chat siempre visible */
    .chat-input-area, .office-input-area {
        position: sticky;
        bottom: 0;
        background: var(--bg-white);
        z-index: 20;
    }
}

/* ============================================================
   #meetingRoom — Sala de Reunions (scoped, no afecta /office)
   ============================================================ */

/* Estructura flex perquè el chat-window pugui fer scroll */
#meetingRoom {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

@media (max-width: 768px) {
    .office-project-switcher {
        min-width: 160px;
    }
}

/* Project switcher: amplada mínima en tablet/mòbil */

/* === SECCIÓ 202: MÒBIL HORITZONTAL — Meeting Room / Office === */
@media (orientation: landscape) and (max-height: 500px) {

    /* ── Header principal més compacte ── */
    :root { --header-height: 38px; }
    .header-container { height: 38px !important; padding: 0 0.75rem !important; }
    .logo-img { height: 26px !important; }

    /* ── Office-header: UNA sola fila, flux normal ── */
    .office-header {
        flex-direction: row !important;
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
        padding: 0 8px !important;
        align-items: center !important;
        gap: 6px !important;
        overflow: hidden !important;
        box-shadow: none !important;
    }

    /* ── Advisor-info: fila horitzontal, ocupa l'espai disponible ── */
    .office-header .advisor-info {
        display: flex !important;
        flex-direction: row !important;
        width: auto !important;
        flex: 1 !important;
        order: unset !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        min-width: 0 !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 6px !important;
        overflow: hidden !important;
    }

    /* Separador vertical — amagar */
    .office-header .advisor-info > div[style*="width: 1px"],
    .office-header .advisor-info > div[style*="width:1px"] {
        display: none !important;
    }

    /* ── Selector de projecte ── */
    .office-project-switcher {
        flex: 1 !important;
        margin: 0 !important;
        margin-right: 0 !important;
        min-width: 0 !important;
        max-width: 150px !important;
    }

    #officeProjectTitle.btn-style {
        height: 28px !important;
        width: 100% !important;
        font-size: 0.7rem !important;
        padding: 0 6px !important;
        justify-content: space-between !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* ── Selector d'agent: reset del width:100% del portrait ── */
    .office-agent-switcher {
        display: flex !important;
        width: auto !important;
        order: unset !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
        margin-bottom: 0 !important;
    }

    #officeAgentBtn {
        width: auto !important;
        height: 28px !important;
        padding: 0 6px !important;
        justify-content: flex-start !important;
        box-shadow: none !important;
        border: 1px solid var(--border-light) !important;
        border-radius: 6px !important;
        display: flex !important;
        align-items: center !important;
    }

    #officeAgentBtn img {
        width: 20px !important;
        height: 20px !important;
        border-radius: 50% !important;
        margin-right: 4px !important;
    }

    #officeAgentBtn div { flex-direction: row !important; }
    #officeAgentBtn span:last-child { font-size: 0.7rem !important; font-weight: 600 !important; }
    #officeAgentBtn i.fa-chevron-down { display: none !important; }

    /* ── Botons d'acció: reset width:100% del portrait, icones compactes ── */
    .office-header .chat-header-actions {
        display: flex !important;
        width: auto !important;
        flex-shrink: 0 !important;
        order: unset !important;
        gap: 2px !important;
        align-items: center !important;
        padding-top: 0 !important;
        border-top: none !important;
        margin-top: 0 !important;
    }

    .office-header .chat-header-actions .button-text,
    .office-header .chat-header-actions .desktop-hidden-text {
        display: none !important;
    }

    .office-header .chat-header-actions .nav-button,
    .office-header .chat-header-actions button,
    .office-header .chat-header-actions .btn {
        height: 28px !important;
        width: 28px !important;
        min-width: 28px !important;
        padding: 0 !important;
        font-size: 0.78rem !important;
        border-radius: 5px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Amagar PIAs (massa ample) */
    .office-header #piaBalanceContainer { display: none !important; }
}

/* ================================================== */
/* === SECCIÓ 203: SISTEMA DE TEMES (DARK / LIGHT) == */
/* ================================================== */

/* -------------------------------------------------------
   TRANSICIONS GLOBALS — evitem el flash en canviar tema
------------------------------------------------------- */
*, *::before, *::after {
    transition:
        background-color 0.25s ease,
        border-color     0.25s ease,
        color            0.15s ease,
        box-shadow       0.25s ease;
}

/* Override: elements que NO han de transicionar (animacions pròpies) */
.chat-message, .typing-indicator, .mermaid-wrapper, .progress-bar-inner {
    transition: none !important;
}

/* -------------------------------------------------------
   TEMA FOSC — [data-theme="dark"] aplicat al <html>
------------------------------------------------------- */
[data-theme="dark"] {

    /* ── Variables de color principals ── */
    --primary-color:    #7aa8f0;
    --primary-hover:    #5b8de0;
    --secondary-color:  #1e2d45;
    --text-main:        #e2e8f0;
    --text-muted:       #94a3b8;
    --bg-body:          #0f172a;
    --bg-white:         #1e293b;
    --border-color:     #2d3f56;

    /* ── Sombres (menys intenses al fosc) ── */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --bg-subtle:        #162032;    /* Off-white → blau molt fosc */
    --bg-surface:       #1a2840;    /* Surface → blau fosc mig */
    --bg-input:         #0f1d2e;    /* Inputs → blau molt fosc */
    --text-secondary:   #94a3b8;    /* Text secundari → gris clar */
    --border-light:     #2d3f56;    /* Divisors → blau gris */
}

/* ── Body i fons global ── */
[data-theme="dark"] body {
    background-color: var(--bg-body);
    color: var(--text-main);
}

/* ── Header ── */
[data-theme="dark"] .header-container {
    background-color: rgba(15, 23, 42, 0.95);
    border-bottom-color: var(--border-color);
}

/* ── Cards i seccions blanques ── */
[data-theme="dark"] .profile-section,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .plan-card,
[data-theme="dark"] .chat-container,
[data-theme="dark"] .office-panel,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .sidebar-content,
[data-theme="dark"] .meeting-sidebar,
[data-theme="dark"] .debug-panel,
[data-theme="dark"] .invoice-detail-container,
[data-theme="dark"] .billing-history-container {
    background-color: var(--bg-white);
    border-color: var(--border-color);
}

/* ── Inputs i selects ── */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .form-input {
    background-color: #0f1d2e;
    border-color: var(--border-color);
    color: var(--text-main);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] .form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(122, 168, 240, 0.15);
}

[data-theme="dark"] .form-input.compact:read-only {
    background-color: #0a1525;
    color: var(--text-muted);
}

/* ── Botons ── */
[data-theme="dark"] .btn-outline,
[data-theme="dark"] .nav-button {
    color: var(--text-main);
    border-color: var(--border-color);
}

[data-theme="dark"] .nav-button:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

[data-theme="dark"] .btn-outline {
    background-color: transparent;
}

[data-theme="dark"] .btn-outline:hover {
    background-color: var(--secondary-color);
    border-color: var(--primary-color);
}

/* ── Chat ── */
[data-theme="dark"] .chat-messages-container {
    background-color: var(--bg-body);
}

[data-theme="dark"] .message-user .message-bubble {
    background-color: #1e3a5f;
    color: #e2e8f0;
}

[data-theme="dark"] .message-agent .message-bubble {
    background-color: var(--bg-white);
    color: var(--text-main);
}

[data-theme="dark"] .chat-input-area,
[data-theme="dark"] .chat-input-wrapper {
    background-color: var(--bg-white);
    border-top-color: var(--border-color);
}

[data-theme="dark"] #chatInput,
[data-theme="dark"] .chat-textarea {
    background-color: #0f1d2e;
    color: var(--text-main);
    border-color: var(--border-color);
}

/* ── Office / Meeting headers ── */
[data-theme="dark"] .office-header,
[data-theme="dark"] .meeting-header {
    background-color: var(--bg-white);
    border-bottom-color: var(--border-color);
}

/* ── Taules i llistes ── */
[data-theme="dark"] .invoice-item-mini,
[data-theme="dark"] .invoice-item {
    background-color: var(--bg-white);
    border-color: var(--border-color);
}

[data-theme="dark"] .invoice-item-mini:hover,
[data-theme="dark"] .invoice-item:hover {
    background-color: var(--secondary-color);
}

/* ── Divisors i separadors ── */
[data-theme="dark"] .profile-section h2,
[data-theme="dark"] hr,
[data-theme="dark"] .form-section-divider {
    border-color: var(--border-color);
}

/* ── Textos de suport ── */
[data-theme="dark"] .stat-content h3,
[data-theme="dark"] .stat-details,
[data-theme="dark"] .detail-item,
[data-theme="dark"] .subtitle {
    color: var(--text-muted);
}

[data-theme="dark"] .stat-value,
[data-theme="dark"] .page-header h1,
[data-theme="dark"] .plan-header h3,
[data-theme="dark"] .plan-price {
    color: var(--text-main);
}

/* ── Plan cards ── */
[data-theme="dark"] .plan-header {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .plan-features li {
    color: var(--text-muted);
}

[data-theme="dark"] .current-plan {
    background-color: #1a2840;
}

/* ── Mermaid i blocs de codi ── */
[data-theme="dark"] .mermaid-wrapper {
    background-color: #1a2840;
    border-color: var(--border-color);
}

[data-theme="dark"] pre,
[data-theme="dark"] code {
    background-color: #0a1525 !important;
    color: #a9c5e8 !important;
    border-color: var(--border-color) !important;
}

/* ── Skills marketplace ── */
[data-theme="dark"] .skill-card {
    background-color: var(--bg-white);
    border-color: var(--border-color);
}

/* ── Badges d'estat ── */
[data-theme="dark"] .pias-icon  { background: #1a2e4a; color: #7aa8f0; }
[data-theme="dark"] .plan-icon  { background: #0d2a1e; color: #4ade80; }

/* ── Scrollbars (Webkit) ── */
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #0f172a;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #2d3f56;
    border-radius: 4px;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #3d5068;
}

/* ── Theme Toggle Button ── */
#themeToggleBtn {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.2s ease !important;
}

#themeToggleBtn:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    transform: rotate(20deg);
}

/* ── Theme Selector UI (client-profile) ── */
.theme-selector {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.theme-option {
    flex: 1;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    background-color: var(--bg-white);
}

.theme-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.theme-option.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(122, 168, 240, 0.2);
}

.theme-option-preview {
    width: 100%;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
}

/* Preview Tema Clar */
.theme-option[data-theme-value="light"] .theme-option-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.theme-option[data-theme-value="light"] .preview-header {
    height: 10px;
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}
.theme-option[data-theme-value="light"] .preview-body {
    height: 30px;
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

/* Preview Tema Fosc */
.theme-option[data-theme-value="dark"] .theme-option-preview {
    background: #0f172a;
    border: 1px solid #2d3f56;
}
.theme-option[data-theme-value="dark"] .preview-header {
    height: 10px;
    background: #1e293b;
    border-radius: 4px;
}
.theme-option[data-theme-value="dark"] .preview-body {
    height: 30px;
    background: #1e293b;
    border-radius: 4px;
}

.theme-option-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.theme-option.active .theme-option-label {
    color: var(--primary-color);
}

.theme-active-badge {
    display: none;
    font-size: 0.75rem;
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
}

.theme-option.active .theme-active-badge {
    display: inline-flex;
}

@media (max-width: 480px) {
    .theme-selector { flex-direction: column; }
    .theme-option { flex-direction: row; align-items: center; padding: 0.8rem; }
    .theme-option-preview { width: 80px; height: 44px; flex-shrink: 0; }
}


/* ================================================== */
/* === SECCIÓ 203b: DARK THEME — OFFICE / MEETING  == */
/* ===   File Manager, Dashboard, Agent Colors     === */
/* ================================================== */

/* ── Office: finestra de xat i layout ── */
[data-theme="dark"] .office-chat-window,
[data-theme="dark"] .office-container {
    background-color: var(--bg-body) !important;
    background-image: none !important;
}

[data-theme="dark"] .office-layout,
[data-theme="dark"] .meeting-room-layout,
[data-theme="dark"] .meeting-room-container {
    background-color: var(--bg-body);
}

/* ── Office: sidebars i panells ── */
[data-theme="dark"] .all-profiles-sidebar,
[data-theme="dark"] .contracted-profiles-sidebar,
[data-theme="dark"] .office-layout .contracted-profiles-sidebar,
[data-theme="dark"] .profiles-list,
[data-theme="dark"] .team-members-sidebar,
[data-theme="dark"] #projects-scroll-area,
[data-theme="dark"] .sidebar-separator {
    background-color: var(--bg-white) !important;
    border-color: var(--border-color) !important;
}

/* ── Office: input area i mini-chat ── */
[data-theme="dark"] .office-input-area,
[data-theme="dark"] .office-chat-input,
[data-theme="dark"] .mini-chat-input-area,
[data-theme="dark"] #minichat-placeholder {
    background-color: var(--bg-white) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] textarea.mini-chat-input,
[data-theme="dark"] .office-chat-input textarea {
    background-color: #0f1d2e !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* ── Office: botó agent i títol projecte ── */
[data-theme="dark"] #officeAgentBtn,
[data-theme="dark"] #officeProjectTitle.btn-style,
[data-theme="dark"] .office-title-clickable.btn-style {
    background: var(--bg-white) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
}

[data-theme="dark"] #officeAgentBtn img {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .office-title-clickable.btn-style:hover {
    background-color: var(--secondary-color) !important;
}

/* ── Office: dropdown de projectes ── */
[data-theme="dark"] .project-dropdown-menu {
    background: var(--bg-white) !important;
    border-color: var(--border-color) !important;
    box-shadow: var(--shadow-lg) !important;
}

[data-theme="dark"] .project-dropdown-item:hover {
    background-color: var(--secondary-color) !important;
}

[data-theme="dark"] .project-dropdown-item.active {
    background-color: #1e3a5f !important;
    color: var(--primary-color) !important;
}

/* ── Office: botons d'acció vermells ── */
[data-theme="dark"] #closeOfficeButton,
[data-theme="dark"] #closeEntrevistaButton {
    background-color: rgba(239,68,68,0.15) !important;
    color: #f87171 !important;
    border-color: rgba(239,68,68,0.3) !important;
}

[data-theme="dark"] #officeClearHistory {
    color: #f87171 !important;
    border-color: rgba(239,68,68,0.3) !important;
}

/* ── Office: tags i badges ── */
[data-theme="dark"] .profile-team-tag {
    background-color: var(--secondary-color) !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .agent-invocation-box {
    background-color: rgba(30, 45, 69, 0.7) !important;
    border-left-color: var(--primary-color) !important;
}

[data-theme="dark"] .agent-invocation-box strong {
    color: var(--text-main) !important;
}

/* ── Entrevista / Meeting room ── */
[data-theme="dark"] .entrevista-layout,
[data-theme="dark"] .entrevista-container {
    background: var(--bg-body) !important;
}

[data-theme="dark"] .entrevista-layout .all-profiles-sidebar {
    background: var(--bg-white) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .entrevista-header {
    background: var(--bg-white) !important;
    border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] .entrevista-header .advisor-avatar {
    border-color: var(--border-color) !important;
}

/* ── Admin sub-header ── */
[data-theme="dark"] .admin-sub-header {
    background-color: var(--bg-white) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .admin-sub-button.active {
    background-color: #1e3a5f !important;
    color: var(--primary-color) !important;
}

/* ── File Manager ── */
[data-theme="dark"] .fm-layout,
[data-theme="dark"] .fm-content {
    background: var(--bg-body) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .fm-sidebar {
    background: var(--bg-white) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .fm-card {
    background: var(--bg-white) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .fm-card:hover {
    border-color: var(--primary-color) !important;
}

[data-theme="dark"] .fm-type-filter:hover {
    background: var(--secondary-color) !important;
}

[data-theme="dark"] .fm-type-filter.active {
    background: #1e3a5f !important;
    color: var(--primary-color) !important;
}

[data-theme="dark"] .fm-download-btn {
    background: var(--bg-white) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
}

[data-theme="dark"] .fm-preview {
    background: var(--bg-body) !important;
    border-color: var(--border-color) !important;
}

/* ── Project Dashboard ── */
[data-theme="dark"] .dash-sidebar {
    background: var(--bg-white) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .dash-header-title,
[data-theme="dark"] .dash-toolbar {
    background: var(--bg-white) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .dash-card,
[data-theme="dark"] .status-header-card {
    background: var(--bg-white) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .project-item:hover {
    background: var(--secondary-color) !important;
    color: var(--text-main) !important;
}

[data-theme="dark"] .project-item.active {
    background: #1e3a5f !important;
    color: var(--primary-color) !important;
}

/* ── Message bubble base ── */
[data-theme="dark"] .message-bubble {
    background: var(--bg-white) !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
}

/* ── Colors d'agent en mode fosc ──
   rgba(rgb, 0.1) queda massa feble sobre #1e293b.
   Augmentem a 0.18 i forcem color de text llegible.
── */
[data-theme="dark"] .chat-message.david .message-bubble,
[data-theme="dark"] .chat-message.adria .message-bubble,
[data-theme="dark"] .chat-message.carlota .message-bubble,
[data-theme="dark"] .chat-message.jana .message-bubble,
[data-theme="dark"] .chat-message.jordi .message-bubble,
[data-theme="dark"] .chat-message.julia .message-bubble,
[data-theme="dark"] .chat-message.mauri .message-bubble,
[data-theme="dark"] .chat-message.noa .message-bubble,
[data-theme="dark"] .chat-message.nora .message-bubble {
    background-color: rgba(var(--profile-rgb), 0.18) !important;
    color: #e2e8f0 !important;
    border-left-color: rgb(var(--profile-rgb)) !important;
    border-top-color: var(--border-color) !important;
    border-right-color: var(--border-color) !important;
    border-bottom-color: var(--border-color) !important;
}

/* Noms d'agent: mantenir el color del perfil però amb bona visibilitat */
[data-theme="dark"] .chat-message.david .sender-name,
[data-theme="dark"] .chat-message.adria .sender-name,
[data-theme="dark"] .chat-message.carlota .sender-name,
[data-theme="dark"] .chat-message.jana .sender-name,
[data-theme="dark"] .chat-message.jordi .sender-name,
[data-theme="dark"] .chat-message.julia .sender-name,
[data-theme="dark"] .chat-message.mauri .sender-name,
[data-theme="dark"] .chat-message.noa .sender-name,
[data-theme="dark"] .chat-message.nora .sender-name {
    color: rgb(var(--profile-rgb));
    filter: brightness(1.3);
}

/* ── Welcome / Landing ── */
[data-theme="dark"] .welcome-container,
[data-theme="dark"] .welcome-section,
[data-theme="dark"] .hero-section {
    background-color: var(--bg-body) !important;
}

[data-theme="dark"] .feature-card,
[data-theme="dark"] .pricing-card,
[data-theme="dark"] .testimonial-card,
[data-theme="dark"] .step-card {
    background-color: var(--bg-white) !important;
    border-color: var(--border-color) !important;
}

/* ── Chat window & profile list dark overrides ── */
[data-theme="dark"] .chat-window,
[data-theme="dark"] .mini-chat-window,
[data-theme="dark"] .office-chat-window {
    background-color: var(--bg-body);
    background-image: radial-gradient(var(--bg-subtle) 1px, transparent 1px);
}

[data-theme="dark"] .profile-list-item:hover {
    background-color: var(--bg-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .profile-list-item.active {
    background-color: #1e3a5f;
    border-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(59, 130, 246, 0.25);
}


/* === SECCIÓN 204: Payment Methods Badges (Buy Credits) === */

.payment-methods-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    padding: 2rem 0 1rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.payment-methods-label {
    font-size: .8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: .4rem;
}

.payment-methods-label i {
    color: var(--primary-color);
}

.payment-methods-badges {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.payment-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .35rem .65rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    transition: border-color .2s;
}

.payment-badge:hover {
    border-color: var(--primary-color);
}

.payment-badge svg {
    display: block;
}

.payment-badge.card-badge {
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding: .35rem .75rem;
}

.payment-badge.gpay-badge {
    padding: .4rem .6rem;
}

.payment-badge.apay-badge {
    padding: .35rem .6rem;
}

.payment-badge.stripe-secure-badge {
    padding: .4rem .6rem;
}

/* Dark mode */
[data-theme="dark"] .payment-badge {
    background: var(--bg-surface);
    border-color: var(--border-color);
}

[data-theme="dark"] .payment-badge.gpay-badge svg path:last-child {
    fill: var(--text-primary);
}

[data-theme="dark"] .payment-badge.apay-badge svg path {
    fill: var(--text-primary);
}

/* Payment Request Button (Google Pay / Apple Pay) */
.payment-request-btn-container {
    width: 100%;
    min-height: 44px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: .5rem;
}

.pr-or-divider {
    display: none;
    align-items: center;
    gap: .6rem;
    margin: .4rem 0 .6rem;
    color: var(--text-secondary);
    font-size: .75rem;
}

.pr-or-divider::before,
.pr-or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}
