/* Iconos de pendientes asignados en el topbar: conteo sobre el icono. */
.topbar-pending-badge {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background-color: #ef6f21;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--vz-header-bg, #fff);
}

/* Tooltip de los pendientes: un cliente por linea. */
.topbar-pending-tooltip .tooltip-inner {
    max-width: 280px;
    text-align: left;
    white-space: pre-line;
}

/* Sin pendientes: badge gris. */
.topbar-pending-badge.is-empty {
    background-color: #ededf0;
    color: var(--vz-secondary-color, #878a99);
}

/* Latido al llegar una asignacion en tiempo real. */
.topbar-pending-badge.is-pulsing {
    animation: topbar-pending-pulse .6s ease-in-out 3;
}

@keyframes topbar-pending-pulse {
    50% { transform: scale(1.35); }
}

/* Etiqueta "New!" con los NewBiz de hoy en la oficina (topbar.php): blanca, con borde y
   texto del color de los iconos del topbar, y el contador arriba como sus badges. */
.topbar-newbiz {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border: 1px solid var(--vz-header-item-sub-color, #878a99);
    border-radius: 13px;
    background-color: #fff;
    color: var(--vz-header-item-sub-color, #878a99);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: default;
}

.topbar-newbiz .topbar-pending-badge {
    top: -9px;
    right: -9px;
}

.topbar-newbiz.is-pulsing {
    animation: topbar-newbiz-pulse .6s ease-in-out 3;
}

@keyframes topbar-newbiz-pulse {
    50% { transform: scale(1.12); }
}

/* Linea separadora entre grupos de iconos del topbar. */
.topbar-divider {
    width: 1px;
    height: 28px;
    margin: 0 .5rem 0 .75rem;
    background-color: #737686;
}

/* Popup pequeño de Apps (sistemas SSO) del topbar. */
.topbar-apps-menu {
    width: 280px;
    padding: .5rem !important;
}

.topbar-apps-title {
    margin: .25rem .375rem .5rem;
    font-size: .875rem;
    font-weight: 600;
}

.topbar-apps-menu .profile-app-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Badge DEVELOPMENT más ancho. */
.topbar-env-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    min-width: 180px;
    padding: .55rem 1.25rem;
    border-radius: .375rem;
    background-color: red;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .75px;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, .2);
}

.topbar-env-badge i {
    font-size: 16px;
}

/* Menu de perfil: apps asignadas en lista. */
.profile-menu {
    width: 220px;
    padding-bottom: .25rem;
}

/* Nombre del usuario arriba del menu, más pequeño. */
.profile-menu .dropdown-header {
    padding: .5rem .875rem .25rem;
    font-size: 12px;
}

.profile-menu-section {
    padding: .5rem .75rem;
}

.profile-menu-title {
    padding: 0 .25rem;
    margin-bottom: .5rem;
    font-size: .9375rem;
    font-weight: 500;
    color: var(--vz-heading-color, #495057);
}

/* Apps en grilla de 5 estilo launcher: panel redondeado, icono arriba, prefix abajo. */
.profile-app-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    padding: .375rem;
    border-radius: .75rem;
    background-color: var(--vz-light, #f3f6f9);
}

.profile-app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    min-width: 0;
    padding: .5rem .125rem .4rem;
    border-radius: .625rem;
    color: var(--vz-body-color, #212529);
    text-align: center;
    transition: background-color .15s ease;
}

.profile-app-item:hover {
    background-color: #ededf0;
    color: var(--vz-body-color, #212529);
}

.profile-app-item img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.profile-app-prefix {
    max-width: 100%;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Acciones del perfil como botones de ancho completo. */
.profile-menu-action {
    padding: .2rem .625rem .375rem;
}

.profile-menu-section + .profile-menu-action {
    padding-top: .625rem;
}

.profile-action {
    display: flex;
    align-items: center;
    gap: .4rem;
    width: 100%;
    padding: .3rem .625rem;
    border: 1px solid transparent;
    border-radius: .375rem;
    font-size: 12px;
    font-weight: 600;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.profile-action i {
    font-size: .875rem;
    line-height: 1;
}

/* My Profile: azul CRM suave con borde. */
.profile-myprofile {
    background-color: rgba(117, 155, 211, .12);
    border-color: rgba(117, 155, 211, .45);
    color: #4f78b8;
}

.profile-myprofile:hover,
.profile-myprofile:focus {
    background-color: #759BD3;
    border-color: #759BD3;
    color: #fff;
}

/* Trusted Devices: naranja suave con borde. */
.profile-devices {
    background-color: rgba(239, 111, 33, .08);
    border-color: rgba(239, 111, 33, .45);
    color: #d65f17;
}

.profile-devices:hover,
.profile-devices:focus {
    background-color: #ef6f21;
    border-color: #ef6f21;
    color: #fff;
}

/* Sign out: rojo con borde, se llena al pasar el mouse. */
.profile-signout {
    background-color: rgba(240, 101, 72, .08);
    border-color: rgba(240, 101, 72, .5);
    color: var(--vz-danger, #f06548);
}

.profile-signout:hover,
.profile-signout:focus {
    background-color: var(--vz-danger, #f06548);
    border-color: var(--vz-danger, #f06548);
    color: #fff;
}

/* Tarjetas de asignacion en tiempo real (realtime-notify.js). */
.realtime-toasts {
    position: fixed;
    top: 80px;
    right: 16px;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 360px;
    max-width: calc(100vw - 32px);
}

.realtime-toast {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 14px 36px 16px 14px;
    overflow: hidden;
    background: var(--vz-secondary-bg, #fff);
    border: 1px solid var(--vz-border-color, #e9ebec);
    border-left: 4px solid #ef6f21;
    border-radius: 6px;
    box-shadow: 0 5px 18px rgba(30, 32, 37, .12);
    animation: realtime-toast-in .3s ease-out;
}

.realtime-toast.is-leaving {
    opacity: 0;
    transform: translateX(24px);
    transition: opacity .25s, transform .25s;
}

.realtime-toast-icon {
    flex: 0 0 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(239, 111, 33, .12);
    color: #ef6f21;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.realtime-toast-body {
    min-width: 0;
}

.realtime-toast-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--vz-heading-color, #495057);
}

.realtime-toast-title span {
    font-weight: 400;
    color: var(--vz-secondary-color, #878a99);
}

.realtime-toast-text {
    margin-top: 2px;
    font-size: 13px;
    color: var(--vz-body-color, #212529);
    word-break: break-word;
}

.realtime-toast-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #f36f21;
}

.realtime-toast-link:hover {
    color: #ef6f21;
    text-decoration: underline;
}

.realtime-toast-close {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 10px;
}

/* Barra de tiempo restante en azul CRM. */
.realtime-toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: #759bd3;
    transform-origin: left;
    animation: realtime-toast-timer linear forwards;
}

.realtime-toast.is-paused .realtime-toast-progress {
    animation-play-state: paused;
}

@keyframes realtime-toast-in {
    from { opacity: 0; transform: translateX(24px); }
}

@keyframes realtime-toast-timer {
    to { transform: scaleX(0); }
}

/* Variante reconocimiento (NewBiz / Renew / Rewrite creados en Activity): foto del creador, colores de marca. */
.realtime-toast--celebrate {
    flex-wrap: wrap;
    row-gap: 10px;
    padding: 16px 36px 18px 16px;
    border-left-color: #759bd3;
    background:
        linear-gradient(135deg, rgba(117, 155, 211, .10), transparent 65%),
        var(--vz-secondary-bg, #fff);
}

.realtime-toast-avatar {
    position: relative;
    flex: 0 0 56px;
    height: 56px;
}

.realtime-toast-avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #759bd3;
    box-shadow: 0 0 0 3px rgba(117, 155, 211, .18);
}

.realtime-toast--celebrate .realtime-toast-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
}

.realtime-toast-type {
    font-weight: 600;
    color: #759bd3;
}

.realtime-toast-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--vz-secondary-color, #878a99);
    word-break: break-word;
}

.realtime-toast-detail {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.realtime-toast-detail i {
    flex-shrink: 0;
    font-size: 13px;
    opacity: .8;
}

/* Encabezado de la felicitacion: ocupa todo el ancho arriba, grande, para que se lea como celebracion y no como tarea. */
.realtime-toast-cheer {
    flex: 0 0 100%;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.2;
    color: #759bd3;
}

/* Trofeo sobre la esquina inferior derecha de la foto. */
.realtime-toast-trophy {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f7b84b;
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--vz-secondary-bg, #fff);
    animation: realtime-toast-trophy-pop .6s ease-out .2s both;
}

@keyframes realtime-toast-trophy-pop {
    0% { transform: scale(0) rotate(-30deg); }
    60% { transform: scale(1.25) rotate(10deg); }
    100% { transform: scale(1) rotate(0); }
}
