/* ── Project Pulse ───────────────────────────────────────────
   Per-project activity cards with roster, hourly bar chart,
   schedule timeline, and status pattern analysis.
   ─────────────────────────────────────────────────────────── */

/* ── Card shell ── */

.pp-card {
	margin-top: 20px;
	background: #ffffff;
	border-radius: var(--radius-lg);
	border: 1px solid var(--pp-border, var(--border));
	border-left: 4px solid var(--pp-accent, var(--blue-500));
	box-shadow: var(--shadow-md);
	overflow: hidden;
}

/* ── Header ── */

.pp-card__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 22px;
	background: var(--pp-bg, #f8fafc);
	border-bottom: 1px solid var(--pp-border, var(--blue-100));
}

.pp-card__title {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.pp-card__title-dot {
	flex-shrink: 0;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--pp-accent);
}

.pp-card__title-name {
	font-size: 16px;
	font-weight: 700;
	color: var(--ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pp-card__vitals {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

.pp-rate-track {
	width: 100px;
	height: 6px;
	background: rgba(0, 0, 0, 0.08);
	border-radius: 3px;
	overflow: hidden;
}

.pp-rate-fill {
	height: 100%;
	background: var(--pp-accent);
	border-radius: 3px;
	transition: width 0.5s ease;
}

.pp-rate-label {
	font-size: 13px;
	color: #334155;
	white-space: nowrap;
}

.pp-rate-label strong {
	color: var(--pp-accent);
	font-size: 15px;
}

.pp-level {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	padding: 3px 9px;
	border-radius: 4px;
	white-space: nowrap;
}

.pp-level--high     { background: #dcfce7; color: #166534; }
.pp-level--medium   { background: #fef9c3; color: #854d0e; }
.pp-level--low      { background: #ffedd5; color: #9a3412; }
.pp-level--inactive { background: #f1f5f9; color: #64748b; }

/* ── Body ── */

.pp-card__body {
	display: grid;
	grid-template-columns: 230px 1fr;
}

/* ── Roster ── */

.pp-roster {
	padding: 18px 20px;
	border-right: 1px solid var(--pp-border, var(--blue-100));
}

.pp-section-label {
	font-size: 11px;
	font-weight: 700;
	color: #64748b;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin-bottom: 10px;
}

.pp-section-label--spaced {
	margin-top: 18px;
}

.pp-section-sub {
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	color: #94a3b8;
	font-size: 11px;
}

.pp-empty-roster {
	font-size: 13px;
	color: #64748b;
	margin: 0;
}

.pp-member {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 7px 0;
	border-bottom: 1px solid #f1f5f9;
}

.pp-member:last-of-type {
	border-bottom: none;
}

.pp-member__dot {
	flex-shrink: 0;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #cbd5e1;
}

.pp-member__dot--on {
	background: var(--green-500);
	box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
	animation: pp-pulse 2.4s ease-in-out infinite;
}

.pp-member__info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.pp-member__name {
	font-size: 13px;
	font-weight: 600;
	color: #1e293b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pp-member--active .pp-member__name {
	color: #0f172a;
}

.pp-member__status {
	font-size: 12px;
	color: #475569;
}

.pp-member--active .pp-member__status {
	color: var(--green-600);
}

.pp-member__badge {
	flex-shrink: 0;
	font-size: 11px;
	font-weight: 700;
	color: var(--pp-accent);
	background: var(--pp-bg, #f1f5f9);
	border-radius: 9px;
	padding: 1px 7px;
	min-width: 20px;
	text-align: center;
}

.pp-today-total {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid var(--pp-border, var(--blue-100));
	font-size: 12px;
	color: #475569;
}

/* ── Analytics ── */

.pp-analytics {
	padding: 18px 22px;
}

/* ── Hourly bars ── */

.pp-bars {
	display: flex;
	align-items: flex-end;
	gap: 3px;
	height: 64px;
	margin-bottom: 2px;
}

.pp-bar {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	height: 100%;
	position: relative;
}

.pp-bar::before {
	content: '';
	display: block;
	width: 100%;
	height: var(--bar-h, 3%);
	background: #e2e8f0;
	border-radius: 2px 2px 0 0;
	transition: height 0.35s ease;
}

.pp-bar--peak::before {
	background: var(--pp-accent);
}

.pp-bar__label {
	font-size: 10px;
	color: #64748b;
	margin-top: 4px;
	height: 14px;
	line-height: 14px;
}

.pp-peak-note {
	font-size: 12px;
	color: #475569;
	margin-top: 4px;
}

.pp-peak-note strong {
	color: var(--pp-accent);
}

/* ── Average schedule timeline ── */

.pp-timeline {
	display: flex;
	height: 36px;
	border-radius: 6px;
	overflow: hidden;
	gap: 2px;
	background: #f1f5f9;
	margin-bottom: 4px;
}

.pp-timeline__seg {
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	transition: opacity 0.2s;
	border-radius: 3px;
}

.pp-timeline__seg:hover {
	opacity: 0.85;
	cursor: default;
}

.pp-timeline__seg-label {
	font-size: 10px;
	font-weight: 700;
	color: rgba(255,255,255,0.92);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding: 0 5px;
	pointer-events: none;
	text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.pp-timeline-axis {
	display: flex;
	justify-content: space-between;
	margin-bottom: 10px;
}

.pp-timeline-axis span {
	font-size: 10px;
	color: #94a3b8;
}

.pp-timeline-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 14px;
	margin-bottom: 4px;
}

.pp-legend-item {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	color: #475569;
}

.pp-legend-swatch {
	flex-shrink: 0;
	width: 10px;
	height: 10px;
	border-radius: 2px;
}

/* ── Expected now indicator ── */

.pp-expected-now {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	font-weight: 600;
	color: #1e293b;
	background: color-mix(in srgb, var(--pp-accent) 10%, white);
	border: 1.5px solid var(--pp-accent);
	border-radius: 8px;
	padding: 6px 12px;
	margin-bottom: 12px;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--pp-accent) 12%, transparent);
}

.pp-expected-now::before {
	content: '';
	flex-shrink: 0;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--pp-accent);
	animation: pp-pulse 2.4s ease-in-out infinite;
}

.pp-expected-now strong {
	color: var(--pp-accent);
	font-size: 14px;
	font-weight: 700;
}

/* ── Status patterns table ── */

.pp-status-peaks {
	display: flex;
	flex-direction: column;
}

.pp-status-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 6px 0;
	border-bottom: 1px solid #f1f5f9;
}

.pp-status-row:last-child {
	border-bottom: none;
}

.pp-status-row--expected {
	background: var(--pp-bg);
	border-radius: 6px;
	padding: 6px 8px;
	margin: 0 -8px;
}

.pp-status-row__name {
	font-size: 13px;
	font-weight: 600;
	color: #1e293b;
	white-space: nowrap;
}

.pp-status-row__peak {
	font-size: 12px;
	color: #475569;
	white-space: nowrap;
	flex: 1;
}

.pp-status-row__meta {
	font-size: 12px;
	font-weight: 600;
	color: var(--pp-accent);
	white-space: nowrap;
	text-align: right;
}
