/* ============================================
   HEADER USUARIO AUTENTICADO – FTL
   Cargar en todas las páginas que usen auth.js
   ============================================ */

   .user-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
  }
  
  .user-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: 1px solid rgba(52, 152, 219, 0.15);
    color: #4a5568;
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
  }
  
  .user-button:hover {
    color: #3498db;
    background: rgba(52, 152, 219, 0.08);
    border-color: rgba(52, 152, 219, 0.3);
  }
  
  .user-icon {
    font-size: 0.95rem;
    line-height: 1;
  }
  
  .user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .dropdown-arrow {
    font-size: 0.55rem;
    opacity: 0.5;
    transition: transform 0.2s;
  }
  
  .user-button[aria-expanded="true"] .dropdown-arrow,
  .dropdown-menu.show ~ .user-button .dropdown-arrow {
    transform: rotate(180deg);
  }
  
  /* Menú desplegable */
  .dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid rgba(52, 152, 219, 0.15);
    border-radius: 10px;
    box-shadow:
      0 4px 6px rgba(0, 0, 0, 0.04),
      0 10px 30px rgba(52, 152, 219, 0.12);
    min-width: 170px;
    z-index: 1000;
    overflow: hidden;
    animation: dropdownIn 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  
  .dropdown-menu.show {
    display: flex;
    flex-direction: column;
  }
  
  @keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  
  .dropdown-item {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-family: 'DM Sans', -apple-system, sans-serif;
    color: #4a5568;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    display: block;
  }
  
  .dropdown-item:hover {
    background: rgba(52, 152, 219, 0.07);
    color: #3498db;
  }
  
  .dropdown-item.logout-btn {
    color: #e53e3e;
  }
  
  .dropdown-item.logout-btn:hover {
    background: rgba(229, 62, 62, 0.07);
    color: #c53030;
  }
  
  .dropdown-divider {
    height: 1px;
    background: rgba(52, 152, 219, 0.1);
    margin: 0.25rem 0;
  }
  
  /* Banner impersonación admin */
  .impersonation-banner {
    background: linear-gradient(90deg, #f59e0b, #d97706);
    color: white;
    text-align: center;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
  }
  
  .impersonation-banner button {
    background: rgba(255,255,255,0.25);
    border: 1px solid rgba(255,255,255,0.5);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
  }
  
  .impersonation-banner button:hover {
    background: rgba(255,255,255,0.4);
  }