/* public/style.css */

/* === 0. Fuentes e Iconos (GLOBAL) === */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

/* === 1. Variables: "Breeze & Home" (Soft UI Palette) === */
:root {
    /* Principal: Índigo Vibrante (Moderno y confiable) */
    --primary: #6366f1;       
    --primary-dark: #4f46e5;  
    --primary-light: #e0e7ff; 
    --primary-hover: #818cf8; 

    /* Acento: Turquesa para acciones positivas */
    --accent: #0ea5e9;

    /* Base: Blanco con tinte azulado muy sutil */
    --bg-body: #f8fafc;       
    --bg-surface: rgba(255, 255, 255, 0.85); /* Translúcido para Glassmorphism */
    
    /* Textos: Gris azulado (menos duro que el negro) */
    --text-main: #1e293b;     
    --text-muted: #64748b;    
    --border: #e2e8f0;        

    /* Estados Semánticos (Pasteles fuertes) */
    --success: #10b981; --success-bg: #d1fae5;
    --danger: #ef4444;  --danger-bg: #fee2e2;
    --warning: #f59e0b; --warning-bg: #fef3c7;
    --info: #0ea5e9;    --info-bg: #e0f2fe;

    /* Dimensiones Sidebar */
    --sidebar-width-expanded: 260px;
    --sidebar-width-collapsed: 80px;
    --header-height: 70px;
    
    /* UI Estilizada (Soft & Round) */
    --radius: 24px; /* Bordes muy redondos y amigables */
    
    /* Sombras de colores (Glow Effect) */
    --shadow-sm: 0 2px 8px rgba(99, 102, 241, 0.08);
    --shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.12);
    --shadow-lg: 0 20px 40px -10px rgba(99, 102, 241, 0.15);
    
    /* Animaciones */
    --transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); /* Efecto "rebote" suave */
    
    /* Efecto Vidrio Premium */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: 1px solid rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    --glass-blur: blur(16px);
}

/* === 2. Reset & Base === */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; font-size: 16px; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-body);
    /* Fondo con orbes de luz difusos y movimiento sutil */
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(14, 165, 233, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    background-size: 100% 100%;
    color: var(--text-main);
    font-size: 0.95rem;
    height: 100%; 
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }

/* === 3. Animaciones === */
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.9); } 100% { opacity: 1; transform: scale(1); } }
.animate-pop { animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

/* Animación de Entrada "Waterfall" (Cascada) */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Aplicar animación al contenido principal */
#app-main > div {
    animation: fadeInUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Animación escalonada para grids y listas */
.grid-dashboard > div, 
.summary-grid > div,
.data-table tr {
    opacity: 0; /* Oculto inicial */
    animation: fadeInUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Retrasos para efecto cascada */
.grid-dashboard > div:nth-child(1) { animation-delay: 0.05s; }
.grid-dashboard > div:nth-child(2) { animation-delay: 0.1s; }
.grid-dashboard > div:nth-child(3) { animation-delay: 0.15s; }
.grid-dashboard > div:nth-child(4) { animation-delay: 0.2s; }

.summary-item:nth-child(1) { animation-delay: 0.1s; }
.summary-item:nth-child(2) { animation-delay: 0.15s; }
.summary-item:nth-child(3) { animation-delay: 0.2s; }
.summary-item:nth-child(4) { animation-delay: 0.25s; }

/* Skeleton Loading */
.table-loader { display: flex; flex-direction: column; gap: 12px; width: 100%; padding: 1rem; }
.skeleton-row { height: 40px; width: 100%; background: rgba(226, 232, 240, 0.6); border-radius: 12px; animation: pulse 1.5s infinite ease-in-out; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* === 4. Layout Principal === */
#app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width-collapsed) minmax(0, 1fr); 
    grid-template-rows: var(--header-height) minmax(0, 1fr); 
    grid-template-areas: "sidebar header" "sidebar main";
    height: 100dvh;
    width: 100%;
    transition: grid-template-columns 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* === 5. Sidebar Dinámico (Glass & Soft) === */
#app-sidebar {
    grid-area: sidebar;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.5);
    display: flex; flex-direction: column;
    padding: 1.5rem 0.8rem;
    z-index: 50;
    height: 100%;
    overflow: hidden; 
    white-space: nowrap;
    width: var(--sidebar-width-collapsed);
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    box-shadow: 2px 0 20px rgba(99, 102, 241, 0.05);
}

#app-sidebar:hover {
    width: var(--sidebar-width-expanded);
    padding-left: 1.2rem; padding-right: 1.2rem;
}

.sidebar-header {
    display: flex; align-items: center; justify-content: center;
    height: 60px; margin-bottom: 2rem; margin-top: -10px;
    transition: var(--transition);
}
.sidebar-logo { max-height: 50px; max-width: 100%; object-fit: contain; transition: all 0.3s; }

.sidebar-nav { 
    flex: 1; display: flex; flex-direction: column; gap: 0.8rem; 
    overflow-y: auto; overflow-x: hidden;
}
.sidebar-nav::-webkit-scrollbar { width: 0px; }

.sidebar-nav a {
    display: flex; align-items: center; gap: 16px; padding: 0.8rem;
    border-radius: 16px; color: var(--text-muted); font-weight: 500;
    transition: var(--transition); position: relative; justify-content: flex-start; height: 50px;
}
.sidebar-nav a .material-icons { font-size: 1.5rem; min-width: 24px; text-align: center; }

/* Texto oculto por defecto */
.sidebar-nav a span:last-child {
    opacity: 0; transform: translateX(-10px); transition: all 0.3s;
    white-space: nowrap; position: absolute; left: 50px;
}
#app-sidebar:hover .sidebar-nav a span:last-child {
    opacity: 1; transform: translateX(0); position: relative; left: auto;
}

.sidebar-nav a:hover { background-color: var(--primary-light); color: var(--primary); transform: translateX(4px); }
.sidebar-nav a.active { 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white; 
    font-weight: 600; 
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.sidebar-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); }
.btn-sidebar-footer {
    width: 100%; display: flex; align-items: center; gap: 16px; padding: 0.8rem;
    background: transparent; border: none; color: var(--text-muted); 
    font-weight: 500; cursor: pointer; border-radius: 16px; transition: var(--transition); justify-content: flex-start;
}
.btn-sidebar-footer:hover { background: var(--bg-body); color: var(--primary); }
.btn-sidebar-footer span:last-child {
    opacity: 0; transform: translateX(-10px); transition: all 0.3s; position: absolute; left: 50px;
}
#app-sidebar:hover .btn-sidebar-footer span:last-child {
    opacity: 1; transform: translateX(0); position: relative; left: auto;
}

/* === 6. Header (Glass) === */
#app-header {
    grid-area: header;
    background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    padding: 0 2rem;
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: center; z-index: 40; position: sticky; top: 0;
}
#sidebar-toggle { display: none; }
.header-center { grid-column: 2; display: flex; justify-content: center; align-items: center; }
.header-right { grid-column: 3; display: flex; align-items: center; gap: 1.2rem; justify-content: flex-end; }

.condo-badge {
    background: rgba(255, 255, 255, 0.6); padding: 0.6rem 1.4rem; border-radius: 50px;
    font-size: 0.9rem; font-weight: 700; color: var(--text-main);
    border: 1px solid white; display: flex; align-items: center; gap: 10px;
    cursor: pointer; transition: var(--transition); box-shadow: var(--shadow-sm);
}
.condo-badge:hover { 
    border-color: var(--primary-light); color: var(--primary); 
    transform: translateY(-2px); box-shadow: var(--shadow); 
}

.user-profile-btn {
    background: transparent; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 50px;
    transition: var(--transition); border: 1px solid transparent;
}
.user-profile-btn:hover { background: rgba(255,255,255,0.8); border-color: white; box-shadow: var(--shadow-sm); }
.user-avatar {
    width: 42px; height: 42px; 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Dropdown User */
.dropdown-menu {
    position: absolute; top: 120%; right: 0; 
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px);
    border: 1px solid white; border-radius: 20px; box-shadow: var(--glass-shadow);
    width: 240px; display: none; flex-direction: column; overflow: hidden;
    animation: fadeInUp 0.2s ease-out; z-index: 100; padding: 0.5rem;
}
.dropdown-menu.show { display: flex; }
.dropdown-item {
    padding: 12px 16px; font-size: 0.9rem; font-weight: 500; color: var(--text-main);
    background: transparent; border: none; text-align: left; cursor: pointer; border-radius: 12px;
    transition: all 0.2s; display: flex; align-items: center; gap: 12px;
}
.dropdown-item:hover { background: var(--primary-light); color: var(--primary); transform: translateX(4px); }
.dropdown-item.danger { color: var(--danger); margin-top: 5px; border-top: 1px solid var(--border); border-radius: 0 0 12px 12px; }
.dropdown-item.danger:hover { background: var(--danger-bg); transform: none; }

/* === 7. Contenido Principal === */
#app-main { 
    grid-area: main; padding: 2rem; overflow-y: auto; overflow-x: hidden;
    height: 100%; 
}
h1, h2, h3, h4 { color: var(--text-main); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 1rem; }

/* === 8. Componentes UI Generales (Soft & Glass) === */

/* Tarjetas "Flotantes" */
.card {
    background: linear-gradient(145deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.6) 100%);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255,255,255,1);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    padding: 1.8rem;
    margin-bottom: 1.5rem; 
    transition: var(--transition);
}
.card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

/* Stat Cards */
.stat-card {
    background: var(--glass-bg); backdrop-filter: var(--glass-blur);
    border: var(--glass-border); border-radius: 24px; padding: 1.5rem;
    display: flex; align-items: center; gap: 1.2rem; box-shadow: var(--shadow-sm); 
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.stat-icon-box {
    width: 60px; height: 60px; border-radius: 20px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.2rem;
}

/* Botones "Bouncy" y Pill */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 0.8rem 1.6rem; border-radius: 50px; font-weight: 700; font-size: 0.95rem;
    border: none; cursor: pointer; transition: var(--transition);
    letter-spacing: 0.3px; position: relative; overflow: hidden;
}
.btn:active { transform: scale(0.95); }

.btn-primary { 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white; box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover { 
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4); 
    transform: translateY(-3px); 
}

.btn-secondary { background: white; color: var(--text-main); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }

.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; border-radius: 12px; }

/* Inputs Modernos */
input, select, textarea {
    width: 100%; padding: 0.9rem 1.4rem; border: 1px solid transparent; border-radius: 16px;
    background: rgba(255,255,255,0.8); backdrop-filter: blur(4px); box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    font-family: inherit; font-size: 0.95rem; color: var(--text-main); transition: var(--transition);
}
input:focus, select:focus, textarea:focus { 
    outline: none; border-color: var(--primary); background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); 
}

/* Tablas */
.table-responsive { 
    border-radius: 20px; border: var(--glass-border);
    background: rgba(255,255,255,0.5); backdrop-filter: blur(10px); 
    box-shadow: var(--shadow-sm); overflow-x: auto;
}
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 700px; }
.data-table th { 
    text-align: left; padding: 1.4rem 1.5rem; background: rgba(255, 255, 255, 0.8);
    color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; 
    font-weight: 800; letter-spacing: 0.8px; border-bottom: 1px solid var(--border);
}
.data-table td { 
    padding: 1.2rem 1.5rem; border-bottom: 1px solid rgba(241, 245, 249, 0.6); 
    color: var(--text-main); font-size: 0.95rem; vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background-color: rgba(255, 255, 255, 0.8); }

/* Badges */
.badge { padding: 0.4rem 0.9rem; border-radius: 50px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; background: white; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.status-pill { display: inline-flex; align-items: center; padding: 0.4rem 1rem; border-radius: 50px; font-size: 0.8rem; font-weight: 700; }
.status-pill.paid { background: #d1fae5; color: #059669; border: 1px solid #6ee7b7; }
.status-pill.pending { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }

/* === 9. Páginas Específicas === */

/* Login Page */
.login-container {
    min-height: 100dvh; display: flex; align-items: center; justify-content: center;
    background-color: var(--bg-body);
    background-image: 
        radial-gradient(at 20% 20%, rgba(99, 102, 241, 0.2) 0px, transparent 50%),
        radial-gradient(at 80% 80%, rgba(14, 165, 233, 0.2) 0px, transparent 50%);
    padding: 1rem;
}

/* Carrusel Selector */
.condo-selector-page {
    width: 100%; height: 100dvh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; background: var(--bg-body);
    overflow: hidden; text-align: center;
    background-image: radial-gradient(circle at center, rgba(255,255,255,0.8) 0%, rgba(241,245,249,0.8) 100%);
}
.carousel-wrapper {
    position: relative; width: 100%; height: 420px;
    perspective: 1000px; cursor: grab; user-select: none; margin: 2rem 0;
}
.carousel-track {
    position: absolute; top: 0; left: 0; height: 100%;
    display: flex; align-items: center; transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.carousel-item {
    width: 320px; height: 260px; flex-shrink: 0; padding: 2rem; margin: 0 1rem;
    border-radius: 30px; 
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    transition: all 0.5s ease;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transform-origin: center center; cursor: pointer;
}
.carousel-item.active-slide { 
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--primary); 
    box-shadow: 0 25px 60px -10px rgba(99, 102, 241, 0.4); 
    transform: scale(1.1);
}
.condo-card-icon { 
    width: 80px; height: 80px; margin-bottom: 1.5rem; 
    display: flex; align-items: center; justify-content: center; 
    background: var(--primary-light); border-radius: 50%; color: var(--primary);
    box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.1);
}
.carousel-nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
    background: white; border: none; color: var(--text-main);
    width: 56px; height: 56px; border-radius: 50%; font-size: 1.5rem;
    cursor: pointer; box-shadow: var(--shadow-lg); transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.carousel-nav-btn:hover { background: var(--primary); color: white; transform: translateY(-50%) scale(1.15); }
.carousel-nav-btn.prev { left: 5%; }
.carousel-nav-btn.next { right: 5%; }

/* === 10. ESTILOS AVANZADOS: CHAT & COMUNIDAD === */

/* Contenedor Principal del Chat (Efecto Vidrio) */
.chat-layout { 
    display: grid; 
    grid-template-columns: 320px 1fr; /* Sidebar más ancho */
    /* FIX CRÍTICO: Ajuste para que el input no se salga de pantalla */
    height: calc(100vh - 140px); /* Ajustado para dar espacio al header y márgenes */
    min-height: 500px;
    background: var(--glass-bg); 
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.8); 
    border-radius: 30px; 
    overflow: hidden; /* Corta lo que sobra */
    box-shadow: var(--shadow-lg); 
}

/* Sidebar de Contactos */
.chat-sidebar { 
    background: rgba(255, 255, 255, 0.6); 
    border-right: 1px solid rgba(255, 255, 255, 0.5); 
    display: flex; flex-direction: column; 
    overflow: hidden; /* Para que la lista scrollee */
}

.chat-user-list { flex: 1; overflow-y: auto; }

.chat-user { 
    padding: 1.2rem; 
    display: flex; align-items: center; gap: 15px; 
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(0,0,0,0.02);
    position: relative;
}

.chat-user:hover { background: rgba(255,255,255,0.8); }

.chat-user.active { 
    background: white; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.chat-user.active::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: var(--primary); border-radius: 0 4px 4px 0;
}

/* Burbujas de Mensaje */
.chat-main { 
    display: flex; 
    flex-direction: column; 
    background: rgba(255, 255, 255, 0.4); 
    position: relative;
    height: 100%; /* Ocupar altura completa */
    overflow: hidden; /* FIX: Para que el scroll sea interno en messages */
}

.chat-messages { 
    flex: 1; /* Ocupa espacio disponible */
    min-height: 0; /* FIX: Permite scroll flexbox */
    padding: 2rem; 
    overflow-y: auto; /* Scroll solo aquí */
    display: flex; 
    flex-direction: column; 
    gap: 1rem; 
    scroll-behavior: smooth;
}

.msg-row {
    display: flex; 
    flex-direction: column;
    max-width: 70%;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.msg-sent { 
    align-self: flex-end; 
    align-items: flex-end;
}

.msg-received { 
    align-self: flex-start; 
    align-items: flex-start;
}

.msg-bubble { 
    padding: 1rem 1.2rem; 
    border-radius: 20px; 
    font-size: 0.95rem; 
    line-height: 1.5; 
    position: relative; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    word-wrap: break-word;
}

.msg-sent .msg-bubble { 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); 
    color: white; 
    border-bottom-right-radius: 4px; 
}

.msg-received .msg-bubble { 
    background: white; 
    color: var(--text-main); 
    border-bottom-left-radius: 4px; 
}

.msg-time {
    font-size: 0.7rem; 
    margin-top: 5px; 
    opacity: 0.7;
    margin-left: 2px;
}

/* Área de Input Flotante */
.chat-input-area { 
    flex-shrink: 0; /* FIX: No encoger nunca */
    padding: 1.5rem; 
    background: white;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex; /* Flex para alinear botón */
    align-items: center; 
    gap: 1rem;
    z-index: 10; /* Encima de todo */
}

/* === FEED (MURO) ESTILO FACEBOOK/LINKEDIN === */
.feed-container { max-width: 800px; margin: 0 auto; }

.create-post-box {
    background: white;
    padding: 1.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid rgba(255,255,255,0.8);
}

.post-textarea {
    width: 100%; border: none; outline: none; 
    font-size: 1.1rem; padding: 10px; resize: none;
    background: transparent; font-family: inherit;
    min-height: 80px;
}

.post-card {
    background: white;
    border-radius: 24px;
    padding: 0; /* Padding interno manejado por hijos */
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform 0.3s;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.post-header {
    padding: 1.2rem 1.5rem;
    display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.post-content {
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-main);
}

.post-footer {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex; justify-content: space-between; align-items: center;
}

/* Encuestas Bonitas */
.poll-container {
    margin-top: 1.5rem;
    display: flex; flex-direction: column; gap: 10px;
}
.poll-option {
    position: relative;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s;
    background: white;
}
.poll-option:hover { border-color: var(--primary); }
.poll-bar {
    position: absolute; top: 0; left: 0; bottom: 0;
    background: var(--primary-light);
    z-index: 0;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
}
.poll-text {
    position: relative; z-index: 1;
    display: flex; justify-content: space-between;
    font-weight: 500; font-size: 0.9rem;
}

/* Badges de Roles */
.role-badge { 
    font-size: 0.7rem; font-weight: 800; 
    text-transform: uppercase; padding: 3px 8px; border-radius: 6px; 
    letter-spacing: 0.5px;
}
.role-admin { background: #e0e7ff; color: #4338ca; } /* Indigo */
.role-concierge { background: #dcfce7; color: #15803d; } /* Verde */
.role-resident { background: #f1f5f9; color: #64748b; } /* Gris */
.role-committee { background: #ffedd5; color: #c2410c; } /* Naranja */

/* Empty State Ilustración */
.empty-chat-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; color: var(--text-muted); text-align: center;
    opacity: 0.6;
}
.empty-chat-icon { font-size: 5rem; margin-bottom: 1rem; color: var(--primary-hover); }

/* Tabs */
.nav-tabs { display: flex; gap: 1rem; margin-bottom: 2rem; background: rgba(255,255,255,0.5); padding: 5px; border-radius: 50px; width: fit-content; border: 1px solid white; }
.tab-btn { 
    background: transparent; border: none; padding: 0.7rem 1.5rem; border-radius: 40px;
    font-weight: 600; color: var(--text-muted); cursor: pointer; 
    transition: var(--transition); font-size: 0.9rem;
}
.tab-btn.active { background: white; color: var(--primary); box-shadow: var(--shadow-sm); }
.tab-btn:hover { color: var(--primary); }

/* UI Feedback (Modales) */
.modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000; animation: fadeIn 0.2s ease-out;
}
.modal-content {
    background: rgba(255,255,255,0.95); padding: 2.5rem; border-radius: 30px;
    width: 90%; max-width: 500px; box-shadow: 0 25px 60px rgba(0,0,0,0.25);
    border: 1px solid white; max-height: 90vh; overflow-y: auto;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-content.large-modal { max-width: 900px; }

/* === 11. Responsive Mobile === */
@media (max-width: 768px) {
    #app-layout { 
        grid-template-columns: 1fr; 
        grid-template-rows: 70px 1fr;
        grid-template-areas: "header" "main"; 
    }
    #app-sidebar { 
        position: fixed; left: 0; top: 0; bottom: 0; 
        width: 85%; max-width: 300px; 
        transform: translateX(-100%); 
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
        box-shadow: var(--shadow-lg); padding-top: 1rem;
        background: rgba(255,255,255,0.98);
    }
    #app-sidebar.mobile-open { transform: translateX(0); width: 300px; }
    #sidebar-toggle { display: flex; margin-right: 15px; background:white; padding:8px; border-radius:12px; border:1px solid var(--border); color: var(--text-main); }
    #app-header { padding: 0 1rem; display: flex; justify-content: space-between; }
    .header-center { display: none; } 
    .user-profile-info { display: none; }
    .carousel-wrapper { height: 380px; margin: 1rem 0; }
    .carousel-item { width: 280px; height: 240px; }
    
    /* Responsive Chat */
    .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 140px); }
    .chat-sidebar { width: 100%; display: flex; } /* Controlado por JS */
    .chat-main { display: none; width: 100%; }
}
