/* ==========================================================================
   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;            
    --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-p11:     244, 67, 54;    /* ID 9 */
    --color-p16:     0, 188, 212;    /* ID 10 */
    --color-p17:     139, 195, 74;   /* ID 11 */
    --color-p18:     63, 81, 181;    /* ID 12 */
    --color-p19:     121, 85, 72;    /* ID 13 */
    --color-p20:     205, 220, 57;   /* ID 14 */
    --color-p21:     103, 58, 183;   /* ID 15 */
    --color-p22:     0, 94, 184;     /* ID 16 (David) */
    --color-p23:     255, 87, 34;    /* ID 17 */

    /* Estructura */
    --header-height: 70px;
    --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: 500;
    font-size: 0.9rem;
    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: 70%;
}

/* ************************************************** */
/* ****** BLOQUE: 3. UI GENERAL (BOTONES/INPUTS) **** */
/* ************************************************** */
.btn {
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    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: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn-outline:hover {
    border-color: var(--text-muted);
    background-color: #f8fafc;
}

.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: 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);
}

/* ************************************************** */
/* ****** 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: #fff;
    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 #e2e8f0;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
    background-color: #fff;
    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: 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: 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: 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: 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: 1.1rem; font-weight: 600; line-height: 1.2; }
.advisor-profession { 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: 36px; 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: #ffffff;
    background-image: radial-gradient(#f1f5f9 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;
}

/* ************************************************** */
/* ****** 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: #f1f5f9;
    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: 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 #e2e8f0; 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: 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: #f8fafc;
    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: 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: #f8fafc; 
    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: 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: 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: 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; justify-content: center; padding: 0 1rem; }
.filters {
    display: flex; align-items: center; background: 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: #f1f5f9;
    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: 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: 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: #f1f5f9; 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: #ffffff; 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: #f1f5f9; 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="1"]  { --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-p11); }
.chat-message[data-profile-id="16"] { --profile-rgb: var(--color-p16); }
.chat-message[data-profile-id="17"] { --profile-rgb: var(--color-p17); }
.chat-message[data-profile-id="18"] { --profile-rgb: var(--color-p18); }
.chat-message[data-profile-id="19"] { --profile-rgb: var(--color-p19); }
.chat-message[data-profile-id="20"] { --profile-rgb: var(--color-p20); }
.chat-message[data-profile-id="21"] { --profile-rgb: var(--color-p21); }
.chat-message[data-profile-id="22"] { --profile-rgb: var(--color-p22); }
.chat-message[data-profile-id="23"] { --profile-rgb: var(--color-p23); }

/* Estilo del botón "CONTRATAR" dentro del chat (Bloqueo) */
.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: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

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

/* Unificamos el estilo del sidebar izquierdo */
 .all-profiles-sidebar {
    width: 260px;
    background-color: #f8fafc;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
}
.contracted-profiles-sidebar {
    width: 260px;
    background-color: #f8fafc;
    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: #f8fafc;
    flex-shrink: 0;
}

/* Contenedor Inferior (Proyectos) */
#projects-scroll-area {
    flex-shrink: 0;     
    max-height: 20vh;   
    overflow-y: auto;   
    padding-bottom: 1rem;
    background-color: #f8fafc;
}
.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;
}

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

.profile-list-item.active {
    background-color: 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: 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: #f8fafc;
    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: 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: 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: #f8fafc;
    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: white;
    transition: background 0.2s;
}

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

.invoice-item-mini:hover {
    background-color: #f8fafc;
}

.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: 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: white;
    object-fit: cover;
}

.modal-close-btn.compact-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f1f5f9;
    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: white;
}

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

.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: #ffffff !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: #ffffff;
    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: #f8fafc;
}

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

.gallery-item {
    background: #fff;
    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: #fff;
    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: 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: #f1f5f9; 
    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: #f1f5f9;
    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: 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: #f8fafc;
    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: #f8fafc;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    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 16px;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 700;
    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: 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: #f1f5f9; }

.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: 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;
}

/* 4. AJUSTE RESPONSIVE MÓVIL */
/* En móvil el header es más pequeño (60px), ajustamos el top */
@media (max-width: 768px) {
}
/* ************************************************** */
/* ****** 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%;
    }

    .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;
    }
    .office-header {
        flex-direction: column;
        padding: 0.2rem;
        height: auto;
    }
    .office-header h2 {
        font-size: 100%;
    }
    .filters {
        height: 0;
        visibility: hidden;
    }
    .filters {
        flex-direction: column;
    }
    .profiles-grid {
        margin-top: 20px;
    }
    #profiles-list-view .page-header {
        padding-bottom: 0px;
    }
    .mini-chat-container {
    height: 100%;
    min-height: 640px;
    }
	.office-project-switcher {
	/* Aseguramos que en escritorio no se colapse */
	min-width: 200px; 
    }
}

/* --- MÓVILES (Max 768px) --- */
@media (max-width: 768px) {
    .invoice-paper { padding: 1.5rem; }
    .invoice-parties { flex-direction: column; gap: 1.5rem; }
    .party-col.receiver { margin-top: 0 !important; }
    .invoice-footer { flex-direction: column-reverse; gap: 2rem; }
    .invoice-totals { width: 100%; }
    .invoice-notes { max-width: 100%; }
    .invoice-table th:nth-child(2), .invoice-table td:nth-child(2), 
    .invoice-table th:nth-child(4), .invoice-table td:nth-child(4)  
    .mini-chat-input-area {
        padding: .3rem 1.5rem;
        margin-bottom: .3rem;
    }
	
    .meeting-room-layout, 
    .office-layout, 
    .entrevista-layout {
        top: 60px !important; 
    }
    .mini-chat-container {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 630px; 
    }

    .mini-chat-window {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }

    .mini-chat-input-area {
        flex-shrink: 0; 
        position: relative; 
        background: white;
        z-index: 20;
        padding-bottom: env(safe-area-inset-bottom); 
    }
    .chat-header-actions .btn span {
        display: none !important;
    }

    .meeting-header .advisor-profession {
        display: none !important;
    }

    .chat-header-actions .btn {
        padding: 0.5rem 0.8rem;
    }
    .header-container {
        padding: 0 1rem;
        height: 60px;
    }
    body {
        padding-top: 60px;
    }
    .logo-img {
        height: 30px;
    }
    .nav-button .button-text {
        display: none;
    }
    .nav-button {
        padding: 0.5rem;
        min-width: auto;
    }
    .lang-selector {
        display: none; 
    }

    /* 2. DASHBOARD Y CARDS */
    .advisor-horizontal-layout {
        flex-direction: column;
        text-align: center;
        padding-top: 2rem;
    }
    .advisor-avatar-section img {
        position: static;
        transform: none;
        margin-bottom: 1rem;
    }
    .advisor-info-section {
        padding: 0;
        margin-bottom: 1rem;
    }
    .advisor-actions-section {
        width: 100%;
    }
    .advisor-actions-section .btn {
        width: 100%;
    }

    /* 3. CHAT LAYOUTS */
    .meeting-room-layout, 
    .office-layout, 
    .entrevista-layout {
        flex-direction: column;
        height: calc(100vh - 60px); 
    }

    .all-profiles-sidebar {
        width: 100%;
        height: 90px; 
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        flex-direction: row;
        overflow-x: auto; 
        overflow-y: hidden;
        padding: 0.5rem;
    }

    .sidebar-title {
        display: none; 
    }

    .profiles-list {
        flex-direction: row; 
        gap: 10px;
        padding: 0;
    }

    .profile-list-item {
        min-width: 180px; 
        flex-shrink: 0;
        background: white;
        border: 1px solid var(--border-color);
    }

    .chat-window, 
    .office-chat-window {
        padding: 1rem;
    }
    
    .chat-message {
        max-width: 100%; 
    }

    /* 4. BIENVENIDA */
    .video-chat-wrapper {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
        gap: 1rem;
    }
    .youtube-video-container {
       /* height: 300px; */
    }
    #minichat-placeholder {
        min-height: 500px; 
    }
    
    /* 5. FORMULARIOS AUTH */
    .auth-container {
        padding: 10px;
    }
    .auth-form {
        padding: 20px;
    }
    .mini-chat-container {
    height: 100%;
    min-height: 640px;
    }
}

/* --- 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: 15px;
    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: #fffbeb; /* Fondo amarillento tipo nota o gris suave */
    border: 1px solid #e2e8f0;
    border-left: 4px solid #f59e0b; /* Borde naranja */
    color: #4b5563;
    font-family: 'Consolas', 'Monaco', monospace; /* Fuente monoespaciada */
    font-size: 80%rem;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    white-space: pre-wrap; /* Respeta saltos de línea */
    line-height: 1.4;
}

/* Estilos inline */
.fmt-bold { font-weight: 600; }
.fmt-italic { font-style: italic; }
.fmt-underline { text-decoration: underline; text-decoration-color: var(--primary-color); }