:root { 
    --primary-color: #002B5B; 
    --secondary-color: #00B4D8; 
    --bg-color: #ffffff; 
    
    --text-color: #333333; 
    --border-color: #dddddd; 
    --success-color: #28a745; 
    --danger-color: #dc3545; 
    --warning-color: #ffc107; 
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }
body { background-color: #f4f7f6; color: var(--text-color); line-height: 1.6; }

.container { max-width: 1000px; margin: 20px auto; padding: 20px; background: var(--bg-color); border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
h2, h3 { color: var(--primary-color); margin-bottom: 15px; }

.nav-bar { display: flex; justify-content: space-between; align-items: center; background-color: var(--primary-color); padding: 10px 20px; border-radius: 8px 8px 0 0; margin-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 15px; color: white; font-weight: bold; font-size: 1.2rem; height: 100%; }
.logo-institucional { height: 50px; width: auto; max-width: 120px; object-fit: contain; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-title { font-size: 1.4rem; font-weight: 800; letter-spacing: 1px; }
.brand-slogan { font-size: 0.65rem; color: var(--secondary-color); font-weight: 600; letter-spacing: 2px; }

.perfil-img-nav { width: 35px; height: 35px; border-radius: 50%; object-fit: cover; border: 2px solid var(--secondary-color); vertical-align: middle; background-color: #e9ecef; }
.user-menu { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.nav-bar a { color: #ffffff; text-decoration: none; font-weight: bold; transition: color 0.3s ease; }
.nav-bar a:hover { color: var(--secondary-color); text-decoration: none; }

.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
table th, table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border-color); }
table th { background-color: var(--primary-color); color: white; }

.badge { padding: 5px 10px; border-radius: 20px; font-size: 12px; font-weight: bold; color: #fff; }
.bg-danger { background-color: var(--danger-color); } 
.bg-success { background-color: var(--success-color); } 
.bg-warning { background-color: var(--warning-color); color: #000; }

form { display: flex; flex-direction: column; gap: 15px; }
label { font-weight: bold; color: var(--primary-color); }
input, select, textarea { width: 100%; padding: 10px; border: 1px solid var(--border-color); border-radius: 4px; font-size: 16px; transition: border 0.3s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--secondary-color); }

button, .btn { display: inline-block; background-color: var(--secondary-color); color: #ffffff; padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; text-decoration: none; font-size: 16px; text-align: center; font-weight: bold; transition: background 0.3s; }
button:hover, .btn:hover { background-color: #008ba8; }

.chat-container { display: flex; gap: 20px; height: 60vh; }
.chat-sidebar { width: 30%; border-right: 1px solid var(--border-color); overflow-y: auto; padding-right: 10px; }
.chat-sidebar a { display: block; padding: 10px; margin-bottom: 5px; background: #f9f9f9; text-decoration: none; color: var(--text-color); border-radius: 4px; transition: background 0.3s; }
.chat-sidebar a:hover { background: #e0f7fa; }
.chat-sidebar a.activo { background: var(--primary-color); color: white; }

.chat-box { width: 70%; display: flex; flex-direction: column; }
.chat-messages { flex-grow: 1; background: #fafafa; border: 1px solid var(--border-color); border-radius: 4px; padding: 15px; overflow-y: auto; margin-bottom: 10px; display: flex; flex-direction: column; gap: 10px; }
.mensaje-burbuja { max-width: 70%; padding: 10px 15px; border-radius: 15px; font-size: 14px; }
.mensaje-enviado { background-color: #e0f7fa; align-self: flex-end; border-bottom-right-radius: 0; border: 1px solid var(--secondary-color); }
.mensaje-recibido { background-color: #ffffff; border: 1px solid var(--border-color); align-self: flex-start; border-bottom-left-radius: 0; }
.mensaje-fecha { font-size: 10px; color: #888; display: block; text-align: right; margin-top: 5px; }

@media (max-width: 768px) { 
    .nav-bar { flex-direction: column; gap: 15px; text-align: center; } 
    .brand { flex-direction: column; height: auto; }
    .user-menu { justify-content: center; }
    .chat-container { flex-direction: column; height: auto; } 
    .chat-sidebar { width: 100%; height: 150px; } 
    .chat-box { width: 100%; } 
}