/* ===========================================================================
   Account lead (cabecalho do perfil Cliente) + avatar do usuario.  ASCII apenas.

   HTML gerado por AppCode\Base\AccountLead.cs (TAccountLead) e
   AppCode\Base\UsuarioFoto.cs (TUsuarioFoto.AvatarHtml). Carregado pelo
   Common.Master DEPOIS do mobile.css: o "#DivUserID { display:none }" que o
   mobile.css aplica abaixo de 1024px e vencido aqui por especificidade
   (#DivUserID:has(.AccountLead) = 1,1,0), sem !important.

   O cartao abre por :hover / :focus-within, so CSS: o cabecalho mora num
   UpdatePanel e e re-renderizado a cada postback parcial - nada de estado JS.
=========================================================================== */

/* ---------------------------------------------------------------------------
   AVATAR (cabecalho, cartao, grid e formulario de usuario).
   As iniciais ficam POR BAIXO da foto: se a imagem falhar, o onerror a esconde
   e as iniciais aparecem.
--------------------------------------------------------------------------- */
.AccountLeadAvatar,
.AccountLeadCardAvatar,
.UsuarioGridAvatar,
.UsuarioFotoAvatar
{
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	border-radius: 50%;
	overflow: hidden;
	color: #fff;
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	font-weight: 600;
	letter-spacing: .02em;
	line-height: 1;
	text-transform: uppercase;
	background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
	-webkit-user-select: none;
	user-select: none;
}

.AccountLeadAvatar img,
.AccountLeadCardAvatar img,
.UsuarioGridAvatar img,
.UsuarioFotoAvatar img
{
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	border: 0;
	object-fit: cover;
	background: #fff;
}

.AccountLeadIniciais
{
	position: relative;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}

/* Sem nome (usuario novo): silhueta no lugar das iniciais. */
.AccountLeadIniciais:empty
{
	display: block;
	width: 58%;
	height: 58%;
	background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Ccircle cx='12' cy='8' r='4.2'/%3E%3Cpath d='M3.5 21c.6-4.3 4-7 8.5-7s7.9 2.7 8.5 7z'/%3E%3C/svg%3E");
	opacity: .92;
}

/* Paleta das iniciais - TUsuarioFoto.Cor(nome) escolhe uma, estavel por pessoa. */
.AccountLeadCor0 { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }
.AccountLeadCor1 { background: linear-gradient(135deg, #a78bfa 0%, #6d28d9 100%); }
.AccountLeadCor2 { background: linear-gradient(135deg, #2dd4bf 0%, #0f766e 100%); }
.AccountLeadCor3 { background: linear-gradient(135deg, #fbbf24 0%, #c2410c 100%); }
.AccountLeadCor4 { background: linear-gradient(135deg, #f472b6 0%, #be185d 100%); }
.AccountLeadCor5 { background: linear-gradient(135deg, #34d399 0%, #047857 100%); }

/* ---------------------------------------------------------------------------
   PILULA DO CABECALHO - a esquerda da saudacao, na banda azul (45px).
--------------------------------------------------------------------------- */
#DivUserID
{
	gap: 12px;
}

.AccountLead
{
	position: relative;
	display: flex;
	align-items: center;
	gap: 9px;
	height: 36px;
	box-sizing: border-box;
	padding: 2px 5px 2px 3px;
	border: 1px solid rgba(255, 255, 255, .22);
	border-radius: 999px;
	background-color: rgba(255, 255, 255, .12);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
	color: #fff;
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	cursor: default;
	outline: 0;
	transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.AccountLead:hover,
.AccountLead:focus-within
{
	background-color: rgba(255, 255, 255, .20);
	border-color: rgba(255, 255, 255, .42);
}

.AccountLead:focus-visible
{
	box-shadow: 0 0 0 3px rgba(125, 211, 252, .70);
}

.AccountLeadAvatar
{
	flex: 0 0 30px;
	width: 30px;
	height: 30px;
	font-size: 11.5px;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, .90), 0 2px 6px rgba(0, 0, 0, .25);
}

.AccountLeadInfo
{
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
	line-height: 1.15;
}

.AccountLeadRotulo
{
	font-size: 9.5px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .72);
	white-space: nowrap;
}

.AccountLeadNome
{
	max-width: 170px;
	overflow: hidden;
	font-size: 12.5px;
	font-weight: 600;
	color: #fff;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.AccountLeadContatos
{
	display: flex;
	align-items: center;
	gap: 2px;
	margin-left: 1px;
	padding-left: 7px;
	border-left: 1px solid rgba(255, 255, 255, .22);
}

.AccountLeadContato,
.AccountLeadContato:link,
.AccountLeadContato:visited
{
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 28px;
	box-sizing: border-box;
	padding: 0 9px 0 5px;
	border-radius: 999px;
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .15s ease;
}

.AccountLeadContato:hover,
.AccountLeadContato:focus-visible
{
	background-color: rgba(255, 255, 255, .16);
	color: #fff;
	text-decoration: none;
	outline: 0;
}

/* Icone num "selo" redondo: e-mail translucido, WhatsApp no verde da marca. */
.AccountLeadContato svg
{
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	box-sizing: border-box;
	padding: 3px;
	border-radius: 50%;
}

.AccountLeadContatoEmail svg
{
	background-color: rgba(255, 255, 255, .20);
}

.AccountLeadContatoWhats svg
{
	padding: 2.5px;
	background-color: #25d366;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

.AccountLeadSeparador
{
	flex: 0 0 1px;
	width: 1px;
	height: 22px;
	background-color: rgba(255, 255, 255, .28);
}

/* ---------------------------------------------------------------------------
   CARTAO (popover do cabecalho e versao estatica da previa).
--------------------------------------------------------------------------- */
.AccountLeadCard
{
	width: 300px;
	box-sizing: border-box;
	border-radius: 16px;
	background-color: #fff;
	color: #1f2a37;
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	text-align: center;
	cursor: auto;
	box-shadow: 0 24px 48px -12px rgba(15, 23, 42, .38), 0 0 0 1px rgba(15, 23, 42, .06);
}

.AccountLeadCardPopover
{
	position: absolute;
	top: calc(100% + 12px);
	right: -6px;
	z-index: 10000;
	visibility: hidden;
	opacity: 0;
	transform: translateY(-6px) scale(.98);
	transform-origin: top right;
	transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}

.AccountLead:hover .AccountLeadCardPopover,
.AccountLead:focus-within .AccountLeadCardPopover
{
	visibility: visible;
	opacity: 1;
	transform: none;
	transition-delay: 0s;
}

/* Ponte invisivel: o mouse atravessa os 12px entre a pilula e o cartao sem
   perder o :hover. */
.AccountLeadCardPopover::before
{
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -14px;
	height: 14px;
}

/* Seta apontando para a pilula, na cor da faixa. */
.AccountLeadCardPopover::after
{
	content: "";
	position: absolute;
	top: -6px;
	right: 30px;
	width: 12px;
	height: 12px;
	border-radius: 2px;
	background-color: #5aa8fb;
	transform: rotate(45deg);
}

.AccountLeadCardFaixa
{
	position: relative;
	height: 78px;
	border-radius: 16px 16px 0 0;
	background:
		radial-gradient(circle at 88% -30%, rgba(255, 255, 255, .38) 0, rgba(255, 255, 255, 0) 55%),
		radial-gradient(circle at 8% 130%, rgba(255, 255, 255, .20) 0, rgba(255, 255, 255, 0) 50%),
		linear-gradient(135deg, #0052a3 0%, #0066cc 48%, #3b9bff 100%);
}

.AccountLeadCardCorpo
{
	position: relative;
	margin-top: -44px;
	padding: 0 18px 18px;
}

.AccountLeadCardAvatar
{
	width: 84px;
	height: 84px;
	font-size: 28px;
	border: 4px solid #fff;
	box-shadow: 0 10px 22px -6px rgba(15, 23, 42, .35);
}

.AccountLeadCardSelo
{
	display: table;
	margin: 10px auto 0;
	padding: 3px 10px 3px 9px;
	border-radius: 999px;
	background-color: #e8f1ff;
	color: #0052a3;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .08em;
	line-height: 1.5;
	text-transform: uppercase;
}

.AccountLeadCardSelo::before
{
	content: "\2605";
	margin-right: 5px;
	color: #f5a524;
}

.AccountLeadCardNome
{
	margin-top: 8px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
	color: #0f172a;
	word-wrap: break-word;
}

.AccountLeadCardDescricao
{
	margin-top: 2px;
	font-size: 12.5px;
	color: #64748b;
}

.AccountLeadCardLinhas
{
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 14px;
}

.AccountLeadCardLinha,
.AccountLeadCardLinha:link,
.AccountLeadCardLinha:visited
{
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 12px;
	border: 1px solid #eef2f7;
	border-radius: 12px;
	background-color: #f8fafc;
	color: inherit;
	text-align: left;
	text-decoration: none;
	transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.AccountLeadCardLinha:hover,
.AccountLeadCardLinha:focus-visible
{
	border-color: #cfe1fb;
	background-color: #f1f6ff;
	color: inherit;
	text-decoration: none;
	transform: translateY(-1px);
	outline: 0;
}

.AccountLeadCardIcone
{
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
}

.AccountLeadCardIcone svg
{
	width: 17px;
	height: 17px;
}

.AccountLeadCardIconeEmail
{
	background-color: #e8f1ff;
	color: #0066cc;
}

.AccountLeadCardIconeWhats
{
	background-color: #e6f8ee;
	color: #128c4a;
}

.AccountLeadCardDado
{
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.3;
}

.AccountLeadCardDado small
{
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: #64748b;
}

.AccountLeadCardDado strong
{
	overflow: hidden;
	font-size: 13px;
	font-weight: 600;
	color: #0f172a;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.AccountLeadCardAcoes
{
	display: flex;
	gap: 8px;
	margin-top: 14px;
}

.AccountLeadBtn,
.AccountLeadBtn:link,
.AccountLeadBtn:visited
{
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 auto;
	gap: 8px;
	min-width: 0;
	height: 40px;
	box-sizing: border-box;
	padding: 0 10px;
	border: 1px solid transparent;
	border-radius: 10px;
	font-size: 12.5px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.AccountLeadBtn svg
{
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
}

.AccountLeadBtn span
{
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Verde escuro da marca: branco sobre #0f7b6c da 5:1 de contraste. */
.AccountLeadBtnWhats,
.AccountLeadBtnWhats:link,
.AccountLeadBtnWhats:visited
{
	background-color: #0f7b6c;
	color: #fff;
	box-shadow: 0 6px 14px -6px rgba(15, 123, 108, .65);
}

.AccountLeadBtnWhats:hover,
.AccountLeadBtnWhats:focus-visible
{
	background-color: #0b6458;
	color: #fff;
	text-decoration: none;
}

.AccountLeadBtnEmail,
.AccountLeadBtnEmail:link,
.AccountLeadBtnEmail:visited
{
	border-color: #cfe0f5;
	background-color: #fff;
	color: #0052a3;
}

.AccountLeadBtnEmail:hover,
.AccountLeadBtnEmail:focus-visible
{
	border-color: #a9c8ee;
	background-color: #f1f6ff;
	color: #0052a3;
	text-decoration: none;
}

/* ---------------------------------------------------------------------------
   PREVIA (Manutencao > Clientes, abaixo do combo "Account lead").
--------------------------------------------------------------------------- */
.AccountLeadPreviaHolder
{
	margin: 2px 0 14px 108px;
}

.AccountLeadPreviaHolder:empty
{
	display: none;
}

.AccountLeadPrevia
{
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	padding: 14px;
	border: 1px dashed #c9d8ea;
	border-radius: 14px;
	background-color: #f4f7fb;
}

.AccountLeadPreviaTitulo
{
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #52606d;
}

.AccountLeadPreviaBanda
{
	display: flex;
	align-items: center;
	gap: 12px;
	height: 45px;
	padding: 0 16px;
	border-radius: 10px;
	background-color: #0066cc;
	color: rgba(255, 255, 255, .92);
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	font-size: 12.5px;
	white-space: nowrap;
}

.AccountLeadCardEstatico
{
	position: static;
}

.AccountLeadPreviaDica
{
	max-width: 300px;
	box-sizing: border-box;
	padding: 8px 10px;
	border: 1px solid #f5d9a3;
	border-radius: 8px;
	background-color: #fff7e6;
	color: #7a4b00;
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	font-size: 12px;
	line-height: 1.4;
}

/* ---------------------------------------------------------------------------
   TELAS MENORES
--------------------------------------------------------------------------- */

/* Abaixo de 1440px os contatos viram so icone (o cartao continua completo). */
@media only screen and (max-width: 1440px)
{
	#DivUserID .AccountLeadContatoTexto
	{
		display: none;
	}

	#DivUserID .AccountLeadContato
	{
		width: 28px;
		padding: 0;
		justify-content: center;
	}
}

/* Tablet/celular: o mobile.css esconde a saudacao inteira; com account lead a
   pilula volta (so avatar + icones) e a saudacao continua escondida. */
@media only screen and (max-width: 1024px)
{
	#DivUserID:has(.AccountLead)
	{
		display: flex;
		right: 8px;
		height: 40px;
	}

	#DivUserID .UserGreeting,
	#DivUserID .AccountLeadSeparador,
	#DivUserID .AccountLeadInfo
	{
		display: none;
	}

	#DivUserID .AccountLeadContatos
	{
		padding-left: 4px;
	}

	.AccountLeadCardPopover
	{
		right: -4px;
		width: 290px;
		max-width: calc(100vw - 16px);
	}

	.AccountLeadPreviaHolder
	{
		margin-left: 0;
	}

	.AccountLeadPrevia
	{
		max-width: 100%;
		box-sizing: border-box;
		overflow-x: auto;
	}
}

@media (prefers-reduced-motion: reduce)
{
	.AccountLead,
	.AccountLeadCardPopover,
	.AccountLeadCardLinha,
	.AccountLeadBtn,
	.AccountLeadContato
	{
		transition: none;
	}
}

@media print
{
	.AccountLead,
	.AccountLeadSeparador
	{
		display: none;
	}
}
