:root {
    --nvl-blue: #0099D8;
    --border-color: #dbe2e8;
    --bg-page: #f5f7f9;
}

body {
    background-color: var(--bg-page);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    overflow-x: hidden;
}

/* --- NAVBAR MEJORADA --- */
.top-nav {
    background: white;
    padding: 0.8rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap; /* Permite que el menú baje en celulares muy pequeños */
}

.nav-brand img { height: 32px; }

/* Contenedor de enlaces del menú */
.nav-menu {
    display: flex;
    gap: 15px; /* Espacio entre opciones */
    align-items: center;
}

/* Enlaces del menú */
.nav-link-custom {
    text-decoration: none;
    color: #555;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-link-custom:hover, .nav-link-custom.active {
    color: var(--nvl-blue);
    background-color: #e3f2fd;
}

.nav-link-logout {
    color: #dc3545; /* Rojo para salir */
    border: 1px solid #dc3545;
}
.nav-link-logout:hover {
    background-color: #dc3545;
    color: white;
}

/* --- TARJETA Y CHAT (Igual que antes) --- */
.hco-card {
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    height: 400px; /* Altura fija para scroll */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 20px;
}

.hco-card-header { padding: 15px; border-bottom: 1px solid var(--border-color); background-color: #f8f9fa; }
.hco-card-body { flex: 1; overflow-y: auto; padding: 0; background-color: white; }
.hco-card-footer { padding: 15px; border-top: 1px solid var(--border-color); background-color: white; }

.message-row { display: flex; padding: 15px; border-bottom: 1px solid #f0f0f0; }
.avatar-circle { width: 38px; height: 38px; border-radius: 50%; background-color: #e9ecef; color: #555; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 1em; margin-right: 12px; flex-shrink: 0; }
.avatar-admin { background-color: #e3f2fd; color: #0099D8; }
.msg-content { width: 100%; min-width: 0; }
.msg-header { display: flex; justify-content: space-between; margin-bottom: 5px; flex-wrap: wrap; }
.msg-author { font-weight: 700; color: #2c3e50; font-size: 0.95rem; }
.msg-date { color: #999; font-size: 0.75rem; }
.msg-text { color: #444; line-height: 1.4; white-space: pre-wrap; font-size: 0.95rem; }

.system-alert { text-align: center; padding: 8px; background: #fff8e1; color: #f57f17; font-size: 0.8em; border-bottom: 1px solid #f0f0f0; }

/* Botón "Volver" flotante o estilo link */
.btn-back-link {
    text-decoration: none;
    color: #6c757d;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
}
.btn-back-link:hover { color: #333; text-decoration: underline; }

/* Adaptación Móvil */
@media (max-width: 768px) {
    .hco-card { height: 500px; }
    .nav-brand { margin-bottom: 10px; width: 100%; text-align: center; } /* Logo centrado en móvil */
    .top-nav { justify-content: center; }
    .nav-menu { gap: 10px; width: 100%; justify-content: center; } /* Menú centrado */
    .nav-link-custom { font-size: 0.85rem; padding: 5px; }
    .w-100-mobile { width: 100%; }
}