/* ────────────────────────────────────────────────────────────────
 * EnterpriseWorkflow page — process flowchart
 * ──────────────────────────────────────────────────────────────── */

.ewf-flow {
	max-width: 920px;
	margin: 0 auto;
	position: relative;
	padding: 0 0 1rem 0;
}

/* Vertical spine — runs down the centre of the flow */
.ewf-spine {
	position: relative;
	padding: 0;
}
.ewf-spine::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: 3px;
	background: linear-gradient(to bottom, #cbd5e1 0%, #cbd5e1 100%);
	transform: translateX(-1.5px);
	z-index: 0;
}

/* Sources row — three cards side by side at the top */
.ewf-sources {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 1rem;
	margin-bottom: 1rem;
}

/* Each stage node */
.ewf-node {
	position: relative;
	background: #ffffff;
	border-radius: 12px;
	padding: 1.1rem 1.2rem;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
	border: 1px solid #e2e8f0;
	z-index: 1;
}
.ewf-node-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.4rem;
}
.ewf-node-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #eff6ff;
	color: #1d4ed8;
	font-weight: 700;
	font-size: 0.85rem;
	flex-shrink: 0;
	border: 1.5px solid #3b82f6;
}
.ewf-node-title {
	margin: 0;
	font-weight: 700;
	font-size: 1.05rem;
	color: #0f172a;
	line-height: 1.25;
}
.ewf-node-role {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 600;
	color: #2563eb;
	font-style: italic;
	margin-top: 0.15rem;
}
.ewf-node-body {
	font-size: 0.9rem;
	color: #475569;
	margin: 0.5rem 0 0;
	line-height: 1.45;
}

/* Node variants */
.ewf-node-auto {
	background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
	border-color: #86efac;
}
.ewf-node-auto .ewf-node-num {
	background: #dcfce7;
	color: #15803d;
	border-color: #22c55e;
}
.ewf-node-auto .ewf-node-role {
	color: #15803d;
}

.ewf-node-collection {
	background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
	border-color: #d8b4fe;
	text-align: center;
}
.ewf-node-collection .ewf-node-title {
	color: #6b21a8;
	font-size: 1.4rem;
}
.ewf-node-collection .ewf-node-body {
	color: #7e22ce;
	font-style: italic;
	font-size: 0.85rem;
}

.ewf-node-action {
	border-left: 4px solid #3b82f6;
}

.ewf-node-decision {
	background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
	border: 2px solid #f59e0b;
	border-left-width: 2px;
}
.ewf-node-decision .ewf-node-num {
	background: #fef3c7;
	color: #92400e;
	border-color: #f59e0b;
}
.ewf-node-decision .ewf-node-title {
	color: #92400e;
}
.ewf-node-decision .ewf-node-role {
	color: #b45309;
}
.ewf-node-decision::before {
	content: "?";
	position: absolute;
	top: -14px;
	right: 16px;
	width: 28px;
	height: 28px;
	background: #f59e0b;
	color: #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 1rem;
	border: 3px solid #ffffff;
}

.ewf-node-signoff {
	background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
	border: 2px solid #fb923c;
	position: relative;
}
.ewf-node-signoff .ewf-node-num {
	background: #fed7aa;
	color: #9a3412;
	border-color: #fb923c;
}
.ewf-node-signoff .ewf-node-title {
	color: #9a3412;
}
.ewf-node-signoff .ewf-node-role {
	color: #c2410c;
}
.ewf-node-signoff::after {
	content: "APPROVAL GATE";
	position: absolute;
	top: -10px;
	left: 16px;
	background: #fb923c;
	color: #ffffff;
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 1.5px;
	padding: 3px 10px;
	border-radius: 10px;
}

.ewf-node-terminal-bad {
	background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
	border: 2px solid #ef4444;
	text-align: center;
	padding: 0.9rem 1rem;
}
.ewf-node-terminal-bad .ewf-node-title {
	color: #991b1b;
	font-size: 0.95rem;
}
.ewf-node-terminal-bad .ewf-node-body {
	color: #b91c1c;
	font-size: 0.8rem;
	margin-top: 0.25rem;
}
.ewf-node-terminal-bad::before {
	content: "\f622"; /* bi-x-octagon-fill — falls back to bullet on missing font */
	font-family: "bootstrap-icons";
	display: block;
	font-size: 1.6rem;
	color: #ef4444;
	margin-bottom: 0.25rem;
	line-height: 1;
}

.ewf-node-terminal-good {
	background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
	border: 2px solid #22c55e;
	text-align: center;
	padding: 1rem;
}
.ewf-node-terminal-good .ewf-node-title {
	color: #166534;
}
.ewf-node-terminal-good .ewf-node-body {
	color: #15803d;
	font-size: 0.85rem;
	margin-top: 0.3rem;
}
.ewf-node-terminal-good::before {
	content: "\f26b"; /* bi-check-circle-fill */
	font-family: "bootstrap-icons";
	display: block;
	font-size: 1.8rem;
	color: #22c55e;
	margin-bottom: 0.3rem;
	line-height: 1;
}

/* Vertical connector arrow between rows */
.ewf-arrow {
	position: relative;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ewf-arrow::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 0;
	bottom: 0;
	width: 3px;
	background: #cbd5e1;
	transform: translateX(-1.5px);
}
.ewf-arrow::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 0;
	height: 0;
	border-left: 7px solid transparent;
	border-right: 7px solid transparent;
	border-top: 9px solid #94a3b8;
	transform: translateX(-50%);
}
.ewf-arrow-label {
	position: relative;
	z-index: 1;
	background: #f8fafc;
	padding: 0 0.7rem;
	font-size: 0.78rem;
	font-weight: 700;
	color: #475569;
	letter-spacing: 0.5px;
	border: 1px solid #cbd5e1;
	border-radius: 12px;
	line-height: 1.5;
}
.ewf-arrow-label-accept {
	background: #dcfce7;
	color: #15803d;
	border-color: #22c55e;
}
.ewf-arrow-label-approved {
	background: #fed7aa;
	color: #9a3412;
	border-color: #fb923c;
}

/* Branch row — splits one node into 2-3 outcome branches */
.ewf-branches {
	display: grid;
	gap: 1rem;
	margin: 1rem 0;
}
.ewf-branches-2 { grid-template-columns: 1fr 1fr; }
.ewf-branches-3 { grid-template-columns: 1fr 1fr 1fr; }

.ewf-branch {
	position: relative;
	padding-top: 28px;
}
.ewf-branch-label {
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	background: #ffffff;
	padding: 3px 12px;
	border-radius: 12px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.8px;
	border: 1.5px solid #cbd5e1;
	color: #475569;
	z-index: 2;
	white-space: nowrap;
}
.ewf-branch-label-good {
	background: #dcfce7;
	color: #15803d;
	border-color: #22c55e;
}
.ewf-branch-label-bad {
	background: #fee2e2;
	color: #991b1b;
	border-color: #ef4444;
}
.ewf-branch-label-amber {
	background: #fef3c7;
	color: #92400e;
	border-color: #f59e0b;
}
.ewf-branch::before {
	content: "";
	position: absolute;
	left: 50%;
	top: -16px;
	width: 3px;
	height: 28px;
	background: #cbd5e1;
	transform: translateX(-1.5px);
}

/* Reference data sidebar pull-out */
.ewf-reference {
	background: #f8fafc;
	border: 1px dashed #94a3b8;
	border-radius: 10px;
	padding: 0.85rem 1rem;
	margin: 0.75rem 0;
	font-size: 0.85rem;
	color: #475569;
}
.ewf-reference-title {
	font-weight: 700;
	color: #334155;
	font-size: 0.7rem;
	letter-spacing: 1.5px;
	margin-bottom: 0.35rem;
	display: block;
}
.ewf-reference ul {
	margin: 0;
	padding-left: 1.1rem;
	font-size: 0.85rem;
}

/* Phase label divider */
.ewf-phase-label {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 1.5rem 0 1rem;
	color: #3b82f6;
}
.ewf-phase-label::before,
.ewf-phase-label::after {
	content: "";
	flex: 1;
	height: 1px;
	background: #cbd5e1;
}
.ewf-phase-label-text {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 2.5px;
	color: #3b82f6;
}

/* Feedback loop callout */
.ewf-loop {
	background: #fef9c3;
	border-left: 3px solid #eab308;
	border-radius: 8px;
	padding: 0.6rem 0.85rem;
	margin: 0.6rem 0;
	font-size: 0.85rem;
	color: #713f12;
}
.ewf-loop strong {
	color: #854d0e;
}

/* Responsive */
@media (max-width: 767.98px) {
	.ewf-sources {
		grid-template-columns: 1fr;
	}
	.ewf-branches-2,
	.ewf-branches-3 {
		grid-template-columns: 1fr;
	}
	.ewf-node {
		padding: 0.9rem 1rem;
	}
	.ewf-node-title {
		font-size: 0.95rem;
	}
}

/* Roles grid (used outside the flowchart) */
.ewf-role-card {
	background: #ffffff;
	border-radius: 10px;
	border: 1px solid #e2e8f0;
	padding: 1.1rem 1.2rem;
	height: 100%;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
	border-top: 4px solid #3b82f6;
}
.ewf-role-card h3 {
	font-size: 1rem;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 0.25rem;
}
.ewf-role-card .ewf-role-card-kind {
	display: inline-block;
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 1.2px;
	color: #475569;
	background: #f1f5f9;
	padding: 2px 8px;
	border-radius: 8px;
	margin-bottom: 0.5rem;
}
.ewf-role-card p {
	font-size: 0.85rem;
	color: #475569;
	margin: 0;
	line-height: 1.45;
}
.ewf-role-card-system { border-top-color: #3b82f6; }
.ewf-role-card-per-tender { border-top-color: #a855f7; }
.ewf-role-card-both { border-top-color: #14b8a6; }
