/*
 * Tfiber Jobs — live presence (viewer avatars, heartbeat strip).
 * Eager-loaded on the jobs table; full dashboard.css loads with the KPI tab.
 */

/* Embedded jobs table toolbar placement for the presence strip. */
.tfiber-jobs-tabs-right .tfiber-dashboard-viewers {
	align-items: center;
	display: inline-flex;
	flex: 0 0 auto;
	gap: 8px;
	margin-right: 4px;
	min-height: 22px;
}

.tfiber-jobs-tabs-right .tfiber-dashboard-viewers-pulse {
	background: #4cb85c;
	border-radius: 50%;
	display: inline-block;
	flex: 0 0 auto;
	height: 8px;
	width: 8px;
}

.tfiber-jobs-tabs-right .tfiber-dashboard-viewers.is-empty .tfiber-dashboard-viewers-pulse {
	animation: tfiber-jobs-presence-pulse 1.8s ease-out infinite;
	background: #4cb85c;
	box-shadow: 0 0 0 2px rgba(76, 184, 92, 0.35);
	opacity: 0.9;
}

@keyframes tfiber-jobs-presence-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(76, 184, 92, 0.55); }
	70%  { box-shadow: 0 0 0 8px rgba(76, 184, 92, 0); }
	100% { box-shadow: 0 0 0 0 rgba(76, 184, 92, 0); }
}

/* -------------------------------------------------------------------
 * Live viewers indicator (right-side panel of the table tabs row,
 * also used in the standalone dashboard header).
 * ----------------------------------------------------------------- */

.tfiber-dashboard-viewers {
	align-items: center;
	color: #f7f7f7;
	display: inline-flex;
	font-size: 12px;
	font-weight: 600;
	gap: 8px;
	transition: opacity 200ms ease;
}

.tfiber-dashboard-viewers.is-empty {
	color: #a8a8a8;
}

.tfiber-dashboard-viewers.is-presence-error {
	color: #c96a2c;
}

.tfiber-dashboard-viewers.is-presence-error .tfiber-dashboard-viewers-pulse {
	animation: none;
	background: #e07a2f;
	box-shadow: none;
}

.tfiber-dashboard-viewers--header {
	margin-right: 12px;
}

.tfiber-dashboard-viewers-pulse {
	background: #7ed957;
	border-radius: 50%;
	box-shadow: 0 0 0 0 rgba(126, 217, 87, 0.55);
	display: inline-block;
	flex: 0 0 auto;
	height: 8px;
	width: 8px;
	animation: tfiberDashboardViewersPulse 1800ms ease-out infinite;
}

.tfiber-dashboard-viewers.is-empty .tfiber-dashboard-viewers-pulse {
	animation: none;
	background: rgba(255, 255, 255, 0.18);
	box-shadow: none;
}

/* Embedded jobs table toolbar is light — empty pulse must stay visible */
.tfiber-jobs-tabs-right .tfiber-dashboard-viewers.is-empty .tfiber-dashboard-viewers-pulse {
	animation: tfiberDashboardViewersPulse 1800ms ease-out infinite;
	background: #4cb85c;
	box-shadow: 0 0 0 2px rgba(76, 184, 92, 0.35);
	opacity: 0.9;
}

@keyframes tfiberDashboardViewersPulse {
	0%   { box-shadow: 0 0 0 0   rgba(126, 217, 87, 0.55); transform: scale(1); }
	70%  { box-shadow: 0 0 0 8px rgba(126, 217, 87, 0);    transform: scale(1.05); }
	100% { box-shadow: 0 0 0 0   rgba(126, 217, 87, 0);    transform: scale(1); }
}

.tfiber-dashboard-viewers-stack {
	display: inline-flex;
	flex-direction: row-reverse;
}

.tfiber-dashboard-viewers-stack:empty {
	display: none;
}

.tfiber-dashboard-viewer-avatar {
	align-items: center;
	background: #ff8400;
	border: 2px solid #1f1f1f;
	border-radius: 50%;
	box-sizing: border-box;
	color: #1f1f1f;
	cursor: pointer;
	display: inline-flex;
	flex: 0 0 22px;
	font-size: 9px;
	font-weight: 800;
	height: 22px;
	justify-content: center;
	letter-spacing: 0;
	line-height: 1;
	margin-left: -6px;
	min-width: 22px;
	overflow: hidden;
	padding: 0;
	text-overflow: clip;
	transition: transform 140ms ease, box-shadow 140ms ease;
	white-space: nowrap;
	width: 22px;
}

.tfiber-dashboard-viewer-avatar:hover,
.tfiber-dashboard-viewer-avatar:focus {
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.32);
	outline: none;
	transform: translateY(-1px) scale(1.08);
	z-index: 1;
}

.tfiber-dashboard-viewer-avatar.is-self {
	box-shadow: 0 0 0 1.5px #ffb266;
	position: relative;
}

.tfiber-dashboard-viewer-avatar.is-self:hover,
.tfiber-dashboard-viewer-avatar.is-self:focus {
	box-shadow: 0 0 0 1.5px #ffb266, 0 2px 8px rgba(15, 23, 42, 0.32);
}

.tfiber-dashboard-viewer-overflow {
	align-items: center;
	background: rgba(255, 255, 255, 0.10);
	border: 2px solid #1f1f1f;
	border-radius: 999px;
	box-sizing: border-box;
	color: #f7f7f7;
	cursor: pointer;
	display: inline-flex;
	flex: 0 0 auto;
	font-size: 9px;
	font-weight: 700;
	height: 22px;
	justify-content: center;
	line-height: 1;
	margin-left: -6px;
	min-width: 26px;
	padding: 0 6px;
	transition: transform 140ms ease, box-shadow 140ms ease;
	white-space: nowrap;
}

.tfiber-dashboard-viewer-overflow:hover,
.tfiber-dashboard-viewer-overflow:focus {
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.32);
	outline: none;
	transform: translateY(-1px) scale(1.08);
}

.tfiber-dashboard-viewers-label {
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.01em;
	white-space: nowrap;
}

@media (max-width: 720px) {
	.tfiber-dashboard-viewers-label { display: none; }
}

/* -------------------------------------------------------------------
 * Click-to-reveal name popover. Single floating element appended to
 * <body>; shared across all bubbles.
 * ----------------------------------------------------------------- */

.tfiber-jobs-viewer-popover {
	align-items: center;
	background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
	border: 1px solid rgba(255, 132, 0, 0.40);
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04);
	color: #f7f7f7;
	display: inline-flex;
	font-size: 13px;
	gap: 10px;
	left: -9999px;
	min-width: 160px;
	max-width: 280px;
	opacity: 0;
	padding: 10px 14px 10px 10px;
	pointer-events: none;
	position: absolute;
	top: -9999px;
	transform: translateY(-4px) scale(0.96);
	transition: opacity 180ms ease, transform 180ms ease;
	z-index: 100000;
}

.tfiber-jobs-viewer-popover.is-open {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

.tfiber-jobs-viewer-popover::before {
	background: inherit;
	border-left: 1px solid rgba(255, 132, 0, 0.40);
	border-top: 1px solid rgba(255, 132, 0, 0.40);
	content: '';
	height: 12px;
	left: 50%;
	margin-left: -6px;
	position: absolute;
	top: -7px;
	transform: rotate(45deg);
	width: 12px;
}

.tfiber-jobs-viewer-popover-avatar {
	align-items: center;
	background: #ff8400;
	border: 2px solid rgba(255, 255, 255, 0.85);
	border-radius: 50%;
	color: #1f1f1f;
	display: inline-flex;
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 800;
	height: 32px;
	justify-content: center;
	width: 32px;
}

.tfiber-jobs-viewer-popover-meta {
	display: inline-flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.tfiber-jobs-viewer-popover-name {
	color: #ffffff;
	font-size: 13px;
	font-weight: 700;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tfiber-jobs-viewer-popover-tag {
	color: #ffb266;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

@media (max-width: 480px) {
	.tfiber-dashboard-viewer-avatar,
	.tfiber-dashboard-viewer-overflow {
		flex-basis: 20px;
		height: 20px;
		min-width: 20px;
		width: 20px;
	}
}

