/* style/global.css */

/* --- 1. Variables (Colores) --- */
:root {
  /* CAMBIO PRINCIPAL: Azul (#0d6efd) -> Rojo DREMH (#d32f2f) */
  /* Este color se usará en botones principales, enlaces activos del sidebar, etc. */
  --color-primario: #d32f2f; 
  
  /* Color más oscuro para efectos hover (al pasar el mouse) */
  --color-primario-hover: #b71c1c; 

  /* CAMBIO SECUNDARIO: Ajustado a Naranja DREMH o Gris oscuro */
  --color-secundario: #f57c00; /* Naranja institucional para elementos secundarios */
  
  /* Colores de estado */
  --color-exito: #198754;      /* Verde (se mantiene estándar para éxitos) */
  --color-peligro: #dc3545;    /* Rojo alerta */
  
  /* CAMBIO ADVERTENCIA: Amarillo genérico -> Amarillo DREMH (#fbc02d) */
  --color-advertencia: #fbc02d; 
  
  --color-info: #0dcaf0;       /* Cian (se puede mantener o cambiar a naranja si prefieres) */

  /* Colores de fondo y texto (Se mantienen para buena legibilidad) */
  --color-fondo-cuerpo: #f8f9fa;
  --color-fondo-sidebar: #212529; /* Fondo oscuro elegante para el menú */
  --color-texto-sidebar: #f8f9fa;
  --color-fondo-tarjeta: #ffffff;
  --color-texto-principal: #212529;
  --color-texto-secundario: #6c757d;
  --color-borde: #dee2e6;
  --sombra-tarjeta: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* --- 2. Reset Básico --- */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
body { display: flex; background: var(--color-fondo-cuerpo); color: var(--color-texto-principal); min-height: 100vh; }
/* --- 3. Layout Principal --- */
.main { flex: 1; padding: 24px; margin-left: 280px; transition: margin-left 0.3s ease; }

/* --- 4. Sidebar (Menú Lateral) --- */
.sidebar { width: 280px; height: 100vh; background: var(--color-fondo-sidebar); color: var(--color-texto-sidebar); position: fixed; display: flex; flex-direction: column; padding: 24px 15px; border-right: 1px solid var(--color-borde); }
.sidebar .brand h2 { font-size: 20px; margin-bottom: 24px; font-weight: 600; color: #fff; text-align: center; }
.sidebar .user-info { text-align: center; margin-bottom: 24px; border-bottom: 1px solid #495057; padding-bottom: 24px; }
.sidebar .user-info img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; border: 4px solid #495057; }
.sidebar .user-info h4 { font-size: 16px; font-weight: 600; color: #fff; }
.sidebar .user-info p { font-size: 13px; color: var(--color-secundario); }
.sidebar .menu { display: flex; flex-direction: column; width: 100%; }
.sidebar .menu a { text-decoration: none; color: var(--color-texto-sidebar); padding: 14px 18px; margin: 4px 0; border-radius: 8px; transition: background-color 0.2s ease; font-size: 15px; display: flex; align-items: center; gap: 12px; }
.sidebar .menu a i { font-size: 16px; width: 20px; text-align: center; }
.sidebar .menu a.active, .sidebar .menu a:hover { 
    background: var(--color-primario); /* Ahora será #d32f2f */
    color: #fff; 
    font-weight: 500; 
}
.sidebar .menu a.logout-btn { margin-top: 20px; background: var(--color-peligro); color: #fff; }
.sidebar .menu a.logout-btn:hover { background: #b02a37; }

/* --- 5. Topbar (Barra Superior) --- */
.topbar { display: flex; justify-content: space-between; align-items: center; background: var(--color-fondo-tarjeta); padding: 16px 24px; border-radius: 12px; margin-bottom: 24px; box-shadow: var(--sombra-tarjeta); border: 1px solid var(--color-borde); }
.topbar h1 { font-size: 22px; color: var(--color-texto-principal); font-weight: 600; margin: 0; }
.topbar .top-actions { display: flex; align-items: center; gap: 20px; font-size: 14px; color: var(--color-texto-secundario); }
.topbar-logout-btn { text-decoration: none; color: var(--color-secundario); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 8px; transition: all 0.2s ease; }
.topbar-logout-btn i { color: var(--color-peligro); }
.topbar-logout-btn:hover { background-color: var(--color-peligro); color: #fff; }
.topbar-logout-btn:hover i { color: #fff; }

/* --- NOTIFICACIONES GLOBAL --- */
.notifications {
    position: relative;
    margin-right: 20px;
}

#notification-bell {
    font-size: 20px;
    color: #555;
    text-decoration: none;
    position: relative;
    cursor: pointer; /* Importante para indicar que es clicable */
    display: inline-block;
}

#notification-bell:hover {
    color: #0d6efd; /* Color azul al pasar el mouse */
}

/* Contador rojo */
.notification-count {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #dc3545; /* Rojo */
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    border: 2px solid #fff;
}

/* El menú desplegable */
.notification-dropdown {
    display: none; /* Oculto por defecto */
    position: absolute;
    top: 100%; /* Justo debajo de la campana */
    right: -10px; /* Alineado a la derecha */
    width: 320px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15); /* Sombra fuerte para resaltar */
    z-index: 9999; /* ¡MUY IMPORTANTE! Para que flote sobre todo */
    overflow: hidden;
}

/* Clase que agrega JS para mostrarlo */
.notification-dropdown.show {
    display: block !important;
}

/* Contenido del menú */
.dropdown-header {
    background: #f8f9fa;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.dropdown-body {
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-body a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #555;
    font-size: 13px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}

.dropdown-body a:hover {
    background-color: #f0f7ff;
    color: #0d6efd;
}

.dropdown-footer {
    text-align: center;
    padding: 10px;
    background: #fff;
    border-top: 1px solid #eee;
}

.dropdown-footer a {
    color: #0d6efd;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}
/* --- 6. Responsive --- */
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); position: fixed; z-index: 1000; }
  .main { margin-left: 0; padding: 15px; }
  .topbar { flex-direction: column; gap: 10px; }
}