/*
  Dryàs — Shared User Dropdown
  Namespace: .du-*

  Funziona sia in Hub/Dashboard che in Alerts.
  Usa variabili CSS esistenti quando presenti (fallback inclusi).
*/

.du-user{
  position: relative;
  display: inline-flex;
  align-items: center;
}

.du-trigger{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.10);
  background: var(--bg-white, #fff);
  cursor: pointer;
  color: var(--text-primary, #0d0d0d);
}

.du-trigger:hover{
  background: var(--bg-hover, rgba(0,0,0,0.04));
}

.du-avatar{
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent-soft, rgba(13,13,13,0.06));
  color: var(--text-primary, #0d0d0d);
}

.du-name{
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}

.du-caret{
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid rgba(0,0,0,0.55);
}

/* Dropdown */
.du-dropdown{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: var(--bg-white, #fff);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.12);
  padding: 10px;
  display: none;
  z-index: 1200;
}

.du-user.is-open .du-dropdown{ display: block; }

.du-head{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
}

.du-head-avatar{
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  background: var(--accent-soft, rgba(13,13,13,0.06));
  color: var(--text-primary, #0d0d0d);
}

.du-head-name{
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary, #0d0d0d);
}

.du-head-email{
  font-size: 12px;
  color: var(--text-secondary, #676767);
  margin-top: 2px;
}

.du-sep{
  height: 1px;
  background: rgba(0,0,0,0.08);
  margin: 8px 0;
}

.du-item{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  color: var(--text-primary, #0d0d0d);
  font-size: 14px;
  font-weight: 600;
}

.du-item i{ width: 18px; height: 18px; }

.du-item:hover{
  background: var(--bg-hover, rgba(0,0,0,0.04));
}

.du-danger{ color: var(--danger, #d92d20); }
/* Forza il comportamento di hidden (il tuo .du-item display:flex lo sovrascrive) */
.du-item[hidden] { display: none !important; }

/* Mobile: nasconde il nome (resta avatar + caret) */
@media (max-width: 560px){
  .du-name{ display: none; }
  .du-trigger{ padding-right: 10px; }
}
