/* Profitability Optimizer — EFuturesCFO design system parity */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@400;500;600;700&display=swap');

.po-app {
	--po-deep: #0c0c0c;
	--po-rich: #121212;
	--po-gold: #d4af37;
	--po-gold-light: #f2c94c;
	--po-success: #22c55e;
	--po-warning: #f59e0b;
	--po-danger: #ef4444;
	--po-info: #3b82f6;
	--po-neutral: #9ca3af;
	--po-card: #171717;
	--po-elevated: #1f1f1f;
	--po-input: #0f0f0f;
	--po-border: #2a2a2a;
	--po-divider: #232323;
	--po-white: #ffffff;
	--po-muted: #a0a0a0;
	--po-heading: 'Playfair Display', Georgia, serif;
	--po-body: 'Inter', system-ui, sans-serif;
	background: var(--po-deep);
	color: var(--po-white);
	font-family: var(--po-body);
	min-height: 100vh;
	margin: 0;
}

.efcfo-ed-single--full-tool {
	background: var(--po-deep, #0c0c0c);
	padding: 0;
}

.efcfo-ed-single--full-tool .efcfo-ed-body {
	max-width: none;
	padding: 0;
	margin: 0;
}

.po-header {
	background: var(--po-rich);
	border-bottom: 1px solid var(--po-border);
	padding: 32px 48px;
}

.po-header__inner {
	max-width: 1440px;
	margin: 0 auto;
}

.po-eyebrow {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 2px;
	text-transform: uppercase;
	background: linear-gradient(90deg, #d4af37 0%, #f2c94c 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	margin-bottom: 8px;
}

.po-title {
	font-family: var(--po-heading);
	font-size: clamp(28px, 4vw, 40px);
	font-weight: 700;
	letter-spacing: -0.5px;
	margin: 0 0 8px;
	color: var(--po-white);
}

.po-subtitle {
	font-size: 16px;
	color: var(--po-muted);
	line-height: 1.5;
	margin: 0;
	max-width: 640px;
}

.po-layout {
	max-width: 1440px;
	margin: 0 auto;
	padding: 32px 48px;
	display: grid;
	grid-template-columns: 380px 1fr;
	gap: 32px;
	align-items: start;
}

.po-panel {
	background: var(--po-card);
	border-radius: 16px;
	border: 1px solid var(--po-border);
	padding: 24px;
	position: sticky;
	top: 24px;
}

.po-panel__title {
	font-family: var(--po-heading);
	font-size: 20px;
	font-weight: 600;
	color: var(--po-gold);
	margin: 0 0 24px;
}

.po-input {
	margin-bottom: 20px;
}

.po-input__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 13px;
	font-weight: 500;
	color: var(--po-muted);
	margin-bottom: 8px;
}

.po-input__value {
	color: var(--po-gold);
	font-weight: 600;
}

.po-input input[type='range'] {
	width: 100%;
	height: 6px;
	-webkit-appearance: none;
	appearance: none;
	border-radius: 3px;
	outline: none;
	cursor: pointer;
	background: var(--po-border);
}

.po-input input[type='range']::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--po-gold);
	cursor: pointer;
	border: 2px solid var(--po-deep);
	box-shadow: 0 0 6px rgba(212, 175, 55, 0.4);
}

.po-input input[type='range']::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--po-gold);
	cursor: pointer;
	border: 2px solid var(--po-deep);
}

.po-dashboard {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.po-card {
	background: var(--po-card);
	border-radius: 12px;
	border: 1px solid var(--po-border);
	padding: 24px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.po-card--summary {
	background: linear-gradient(135deg, #171717 0%, #1f1f1f 100%);
	border-color: rgba(212, 175, 55, 0.25);
}

.po-card__title {
	font-family: var(--po-heading);
	font-size: 18px;
	font-weight: 600;
	color: var(--po-white);
	margin: 0 0 4px;
}

.po-card__sub {
	font-size: 13px;
	color: var(--po-muted);
	margin: 0 0 20px;
}

.po-summary {
	font-size: 16px;
	color: var(--po-muted);
	line-height: 1.7;
	margin: 8px 0 0;
}

.po-summary strong {
	color: var(--po-white);
	font-weight: 600;
}

.po-summary .po-gold {
	color: var(--po-gold);
	font-weight: 700;
}

.po-summary .po-ok {
	color: var(--po-success);
	font-weight: 700;
}

.po-summary .po-warn {
	color: var(--po-warning);
	font-weight: 700;
}

.po-kpis {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

.po-kpi {
	background: var(--po-card);
	border-radius: 12px;
	border: 1px solid var(--po-border);
	padding: 20px 20px 16px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.po-kpi--hl {
	border-color: var(--po-gold);
	box-shadow: 0 0 20px rgba(212, 175, 55, 0.1);
}

.po-kpi__label {
	font-size: 12px;
	font-weight: 500;
	color: var(--po-muted);
	margin-bottom: 8px;
	text-transform: uppercase;
	letter-spacing: 0.8px;
}

.po-kpi__value {
	font-family: var(--po-heading);
	font-size: 28px;
	font-weight: 700;
	color: var(--po-white);
	margin: 0 0 4px;
}

.po-kpi__sub {
	font-size: 13px;
	font-weight: 600;
}

.po-kpi__sub.is-pos {
	color: var(--po-success);
}

.po-kpi__sub.is-neg {
	color: var(--po-danger);
}

.po-chart-wrap {
	position: relative;
	width: 100%;
	min-height: 280px;
}

.po-chart-wrap--pie {
	min-height: 240px;
	max-width: 360px;
	margin: 0 auto;
}

.po-table-wrap {
	overflow-x: auto;
	margin-top: 20px;
}

.po-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.po-table th {
	text-align: left;
	padding: 12px 16px;
	font-size: 12px;
	font-weight: 600;
	color: var(--po-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-bottom: 1px solid var(--po-border);
	background: var(--po-elevated);
}

.po-table td {
	padding: 14px 16px;
	border-bottom: 1px solid var(--po-divider);
	color: var(--po-white);
}

.po-table tr:last-child td {
	border-bottom: none;
}

.po-pos {
	font-weight: 600;
	color: var(--po-success);
}

.po-neg {
	font-weight: 600;
	color: var(--po-danger);
}

.po-tag {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 20px;
	background: rgba(212, 175, 55, 0.07);
	border: 1px solid rgba(212, 175, 55, 0.19);
	color: var(--po-gold);
	font-size: 13px;
	font-weight: 500;
}

.po-tag--top {
	background: rgba(34, 197, 94, 0.12);
	border-color: rgba(34, 197, 94, 0.25);
	color: var(--po-success);
}

.po-split {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
}

.po-metrics {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin-top: 8px;
}

.po-metric {
	display: flex;
	justify-content: space-between;
	padding: 8px 0;
	border-bottom: 1px solid var(--po-divider);
}

.po-metric:last-child {
	border-bottom: none;
}

.po-metric span:first-child {
	font-size: 14px;
	color: var(--po-muted);
}

.po-metric span:last-child {
	font-size: 14px;
	font-weight: 600;
	color: var(--po-white);
}

.po-recs {
	display: flex;
	flex-direction: column;
}

.po-rec {
	display: flex;
	gap: 16px;
	padding: 16px 0;
	border-bottom: 1px solid var(--po-divider);
	align-items: flex-start;
}

.po-rec:last-child {
	border-bottom: none;
}

.po-rec__badge {
	min-width: 36px;
	height: 36px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	font-weight: 700;
}

.po-rec__title {
	font-size: 14px;
	font-weight: 600;
	color: var(--po-white);
	margin-bottom: 4px;
}

.po-rec__text {
	font-size: 13px;
	color: var(--po-muted);
	line-height: 1.5;
}

.po-method {
	font-size: 13px;
	color: var(--po-muted);
	line-height: 1.8;
}

.po-method p {
	margin: 0 0 12px;
}

.po-method p:last-child {
	margin-bottom: 0;
}

.po-footer {
	max-width: 1440px;
	margin: 0 auto;
	padding: 32px 48px;
	border-top: 1px solid var(--po-border);
}

.po-footer__inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
}

.po-footer__brand {
	font-family: var(--po-heading);
	font-size: 18px;
	color: var(--po-gold);
	margin-bottom: 4px;
}

.po-footer__tag,
.po-footer__copy {
	font-size: 13px;
	color: var(--po-muted);
}

.po-footer__copy {
	font-size: 12px;
	color: var(--po-neutral);
}

@media (max-width: 1024px) {
	.po-layout {
		grid-template-columns: 1fr;
	}

	.po-panel {
		position: static;
	}

	.po-kpis {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.po-header,
	.po-layout,
	.po-footer {
		padding: 24px 16px;
	}

	.po-layout {
		gap: 16px;
	}

	.po-kpis,
	.po-split {
		grid-template-columns: 1fr;
	}
}
