/* Primary GE Fleet TMS: standalone app */
:root {
	--brand: #00613F;
	--brand-dark: #004A30;
	--brand-tint: #DCEFE5;
	--ink: #17211D;
	--ink-2: #3B4641;
	--muted: #66716C;
	--line: #DCE2DF;
	--bg: #F2F4F3;
	--panel: #FFFFFF;
	--side: #111916;
	--side-2: #1B2521;
	--side-text: #C7D1CD;
	--side-muted: #84918B;
	--red: #B42318;
	--red-bg: #FDECEA;
	--amber: #D99A00;
	--amber-bg: #FFF5D6;
	--display: "Overpass", "Helvetica Neue", Arial, sans-serif;
	--body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--radius: 10px;
	--side-w: 248px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 800; line-height: 1.2; margin: 0; color: var(--ink); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
.skip { position: absolute; left: -9999px; z-index: 50; background: #fff; padding: 8px 12px; }
.skip:focus { left: 8px; top: 8px; }
.app-icon { width: 20px; height: 20px; flex: none; }

/* ---------------------------------------------------------------- Shell */
.pge-app { display: block; min-height: 100vh; }
.app-side {
	position: fixed;
	inset: 0 auto 0 0;
	width: var(--side-w);
	background: var(--side);
	color: var(--side-text);
	display: flex;
	flex-direction: column;
	padding: calc(18px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px));
	z-index: 30;
	overflow-y: auto;
}
.app-side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 18px; }
.app-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; min-width: 0; }
.app-logo { max-width: 190px; max-height: 46px; display: block; }
.app-plate {
	flex: none;
	width: 42px;
	height: 42px;
	background: var(--brand);
	border-radius: 7px;
	padding: 2px;
	display: block;
}
.app-plate > span, .app-plate { position: relative; }
.app-plate > span {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	border: 1.5px solid #fff;
	border-radius: 5px;
	font-family: var(--display);
	font-weight: 800;
	font-size: 13px;
	letter-spacing: .02em;
	color: #fff;
	padding-top: 2px;
}
.app-plate i { position: absolute; left: 50%; bottom: 8px; width: 20px; margin-left: -10px; border-top: 2px dashed #fff; }
.app-plate > span { padding-bottom: 6px; }
.app-plate.large { width: 56px; height: 56px; border-radius: 9px; padding: 3px; }
.app-plate.large > span { font-size: 17px; border-width: 2px; border-radius: 6px; }
.app-plate.large i { width: 26px; margin-left: -13px; bottom: 11px; }
.app-brandname { display: flex; flex-direction: column; min-width: 0; }
.app-brandname strong { font-family: var(--display); font-weight: 800; font-size: 16px; line-height: 1.15; color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-brandname small { font-family: var(--display); font-weight: 600; font-size: 12px; color: var(--side-muted); }
.app-close { display: none; }

.app-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.app-nav a, .app-side-links a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 12px;
	border-radius: 8px;
	color: var(--side-text);
	text-decoration: none;
	font-weight: 500;
}
.app-nav a:hover, .app-side-links a:hover { background: var(--side-2); color: #fff; }
.app-nav a[aria-current="page"] { background: var(--side-2); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.app-nav a[aria-current="page"] .app-icon { color: #fff; }
.app-side :focus-visible { outline-color: #fff; }
.app-side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--side-2); }
.app-user { display: flex; gap: 10px; align-items: center; padding: 4px 6px 10px; }
.app-user strong { display: block; color: #fff; font-size: 14px; line-height: 1.2; }
.app-user small { color: var(--side-muted); font-size: 12px; }
.app-avatar {
	flex: none;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--side-2);
	color: #fff;
	display: grid;
	place-items: center;
	font-family: var(--display);
	font-weight: 800;
	font-size: 12px;
}
.app-side-links { list-style: none; margin: 0; padding: 0; }
.app-side-links a { padding: 7px 12px; font-size: 14px; color: var(--side-muted); }
.app-side-links .app-icon { width: 17px; height: 17px; }

.app-main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }
.app-top {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: calc(12px + env(safe-area-inset-top, 0px)) 28px 12px;
	background: rgba(242, 244, 243, .92);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--line);
}
.app-menu { display: none; }
.app-search { flex: 1; max-width: 560px; position: relative; }
.app-search .app-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; pointer-events: none; }
.app-search input {
	width: 100%;
	font: inherit;
	padding: 9px 12px 9px 38px;
	border: 1px solid var(--line);
	border-radius: 9px;
	background: #fff;
	color: var(--ink);
	min-height: 40px;
}
.app-search input:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.app-book {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--brand);
	color: #fff;
	text-decoration: none;
	font-family: var(--display);
	font-weight: 700;
	padding: 9px 16px 8px;
	border-radius: 9px;
	white-space: nowrap;
}
.app-book:hover { background: var(--brand-dark); color: #fff; }
.app-book .app-icon { width: 18px; height: 18px; }
.app-content { padding: 26px 28px 56px; width: 100%; max-width: 1480px; }
.app-scrim { display: none; }

/* ---------------------------------------------------------------- Overview */
.ov-head { margin-bottom: 20px; }
.ov-head h1 { font-size: clamp(24px, 3vw, 30px); }
.ov-head p { margin: 4px 0 0; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 2px; }
.kpi-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi strong { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted); font-size: 13px; }
.kpi.neg strong { color: var(--red); }
.kpi.warn .kpi-sub { color: var(--red); font-weight: 600; }

.pipeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 22px; overflow: hidden; }
.stage { display: flex; align-items: baseline; gap: 10px; padding: 14px 18px; text-decoration: none; color: var(--ink); border-left: 1px solid var(--line); position: relative; }
.stage:first-child { border-left: 0; }
.stage:hover { background: var(--brand-tint); }
.stage-n { font-family: var(--display); font-weight: 800; font-size: 24px; color: var(--brand); font-variant-numeric: tabular-nums; }
.stage-l { font-weight: 600; color: var(--ink-2); }

.ov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; min-width: 0; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { font-size: 17px; }
.panel-head a { font-size: 14px; font-weight: 600; text-decoration: none; }
.panel-head .count { font-family: var(--display); font-weight: 800; font-size: 13px; background: var(--bg); border-radius: 6px; padding: 2px 8px 1px; color: var(--ink-2); }
.empty { color: var(--muted); margin: 4px 0 0; }
.more { margin: 10px 0 0; font-size: 14px; }
.muted { color: var(--muted); }

.legend { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.lg-rev { background: var(--brand); }
.lg-exp { background: #B9C3BF; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ylab { font-size: 11px; fill: var(--muted); text-anchor: end; font-family: var(--body); }
.chart .xlab { font-size: 12px; fill: var(--ink-2); text-anchor: middle; font-family: var(--body); font-weight: 600; }
.chart .bar-rev { fill: var(--brand); }
.chart .bar-exp { fill: #B9C3BF; }

.alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.alerts li { border-left: 3px solid var(--amber); background: var(--amber-bg); border-radius: 0 6px 6px 0; padding: 7px 10px; font-size: 14px; }
.alerts li.overdue { border-left-color: var(--red); background: var(--red-bg); }
.alerts a { color: var(--ink); text-decoration: none; }
.alerts a:hover { text-decoration: underline; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 8px 0; border-bottom: 1px solid var(--bg); font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed a { font-family: var(--display); font-weight: 700; text-decoration: none; }
.feed small { display: block; color: var(--muted); font-size: 12px; }

.table-scroll { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.app-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.app-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.app-table td { padding: 10px; border-bottom: 1px solid var(--bg); vertical-align: middle; }
.app-table tr:last-child td { border-bottom: 0; }
.app-table tbody tr[data-href] { cursor: pointer; }
.app-table tbody tr:hover td { background: #F7F9F8; }
.app-table .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.app-table .neg { color: var(--red); }
.app-table th:first-child, .app-table td:first-child { padding-left: 0; }
.mono { font-family: var(--display); font-weight: 700; text-decoration: none; white-space: nowrap; }
.arrow { color: var(--muted); font-size: 13px; }
.late { color: var(--red); }
.tag { display: inline-block; font-size: 11px; font-weight: 700; background: var(--red-bg); color: var(--red); border-radius: 4px; padding: 1px 6px; margin-left: 4px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: #B9C3BF; }
.dot.busy { background: var(--brand); }
.dot.free { background: #fff; box-shadow: inset 0 0 0 2px var(--brand); }
.meter { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; width: 140px; max-width: 100%; }
.meter span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.app-table small { color: var(--muted); font-size: 12px; }

.mix { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.mix-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.mix-top span { font-family: var(--display); font-weight: 800; }
.meter.wide { width: 100%; }
.meter .mix-broker { background: #7A8A84; }
.meter .mix-3pl { background: #A9B6B1; }
.meter .mix-unset { background: #CBD3D0; }
.mix small { color: var(--muted); font-size: 12px; }
.mix-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--bg); font-size: 14px; font-weight: 600; }

/* ---------------------------------------------------------------- Shared TMS screens inside the app */
.pge-app .pge-wrap { max-width: none; color: var(--ink); }
.pge-app .pge-sign { background: none; padding: 0; margin: 0 0 18px; border-radius: 0; }
.pge-app .pge-sign-inner { border: 0; padding: 0; }
.pge-app .pge-wrap .pge-sign h1 { color: var(--ink); font-size: clamp(24px, 3vw, 30px); }
.pge-app .pge-sign-sub { color: var(--muted); opacity: 1; font-family: var(--body); font-size: 14px; }
.pge-app .pge-btn-sign { background: var(--brand); color: #fff; border-radius: 9px; padding: 9px 16px 8px; }
.pge-app .pge-btn-sign:hover, .pge-app .pge-btn-sign:focus { background: var(--brand-dark); color: #fff; }
.pge-app hr.wp-header-end { display: none; }

.pge-app .notice { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 8px; padding: 2px 14px; margin: 0 0 16px; }
.pge-app .notice-error { border-left-color: var(--red); }
.pge-app .notice p { margin: 10px 0; }

.pge-app .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	font-family: var(--display);
	font-weight: 700;
	font-size: 14px;
	line-height: 1;
	padding: 9px 14px 8px;
	border-radius: 8px;
	border: 1px solid var(--line);
	background: #fff;
	color: var(--ink);
	cursor: pointer;
	text-decoration: none;
}
.pge-app .button:hover { border-color: var(--brand); color: var(--brand); }
.pge-app .button-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.pge-app .button-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.pge-app .button-large { min-height: 44px; font-size: 15px; padding: 11px 18px 10px; }

.pge-app input[type=text], .pge-app input[type=password], .pge-app input[type=email], .pge-app input[type=tel], .pge-app input[type=number], .pge-app input[type=date], .pge-app input[type=datetime-local], .pge-app input[type=search], .pge-app input[type=month], .pge-app select, .pge-app textarea {
	font: inherit;
	color: var(--ink);
	background: #fff;
	border: 1px solid #C9D1CD;
	border-radius: 8px;
	padding: 8px 10px;
	min-height: 40px;
	max-width: 100%;
}
.pge-app input:focus, .pge-app select:focus, .pge-app textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.pge-app .app-search input { border-color: var(--line); padding-left: 38px; width: 100%; }
.pge-app .widefat a, .pge-app .pge-dispatch .pd-card a { text-decoration: none; }
.pge-app .widefat a:hover { text-decoration: underline; }
.pge-app .pge-btn-sign.pge-btn-back { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.pge-app .pge-btn-sign.pge-btn-back:hover { color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: #fff; }

.pge-app .pge-filters { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.pge-app .pge-filters input[type=search] { flex: 1; min-width: 200px; }
.pge-app .pge-table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.pge-app .widefat { width: 100%; border-collapse: collapse; border: 0; font-size: 14px; }
.pge-app .widefat th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 12px 14px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pge-app .widefat td { padding: 12px 14px; border-bottom: 1px solid var(--bg); vertical-align: top; }
.pge-app .widefat tbody tr:hover td { background: #F7F9F8; }
.pge-app .widefat tbody tr:last-child td { border-bottom: 0; }
.pge-app .widefat tfoot th { border-top: 1px solid var(--line); border-bottom: 0; color: var(--ink); font-size: 14px; }
.pge-app .pge-empty-state { background: var(--panel); border: 1px dashed var(--line); }
.pge-app .tablenav { margin-top: 14px; }
.pge-app .page-numbers { display: inline-block; min-width: 36px; text-align: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; margin-right: 4px; text-decoration: none; color: var(--ink); }
.pge-app .page-numbers.current { background: var(--brand); border-color: var(--brand); color: #fff; }

.pge-app .pge-single, .pge-app .pge-columns > div:first-child { min-width: 0; }
.pge-app .pge-form { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.pge-app .pge-section legend { border-bottom: 1px solid var(--line); font-size: 16px; }
.pge-app .pge-panel { background: var(--panel); border: 1px solid var(--line); }
.pge-app .pge-related { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }

/* Dispatch board inside the app */
.pge-app .pge-dispatch .pd-head h2 { font-size: clamp(24px, 3vw, 30px); }
.pge-app .pge-dispatch .pd-figures { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 6px; }
.pge-app .pge-dispatch .pd-figures > div:first-child { padding-left: 16px; }
.pge-app .pge-dispatch .pd-book { background: var(--panel); }
.pge-app .pge-dispatch .pd-section h3 { border-bottom-width: 1px; border-color: var(--line); }
.pge-app .pge-dispatch .pd-rows { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; }
.pge-app .pge-dispatch .pd-row:last-child { border-bottom: 0; }
.pge-app .pge-dispatch .pd-col { background: #E8ECEA; }
.pge-app .pge-dispatch .pd-two .pd-section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }

/* ---------------------------------------------------------------- Sign in */
.app-auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--side); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; padding: 28px 28px 22px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand .app-brandname strong { color: var(--ink); font-size: 18px; }
.auth-brand .app-brandname small { color: var(--muted); }
.auth-brand .app-logo { max-height: 56px; background: var(--side); padding: 8px; border-radius: 8px; }
.auth-card h1 { font-size: 24px; }
.auth-sub { color: var(--muted); margin: 4px 0 18px; }
.auth-card form p { margin: 0 0 14px; }
.auth-card label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.auth-card input[type=text], .auth-card input[type=password] { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #C9D1CD; border-radius: 8px; min-height: 44px; }
.auth-card input:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.auth-card .login-remember label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.auth-card input[type=submit], .auth-card .button-primary { width: 100%; font-family: var(--display); font-weight: 800; font-size: 16px; background: var(--brand); color: #fff; border: 0; border-radius: 9px; padding: 13px 18px 11px; cursor: pointer; text-decoration: none; display: block; text-align: center; }
.auth-card input[type=submit]:hover { background: var(--brand-dark); }
.auth-links { font-size: 14px; color: var(--muted); margin: 10px 0 0; text-align: center; }
.app-empty { padding: 40px 0; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1180px) {
	.ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.span-2, .span-3 { grid-column: 1 / -1; }
	.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
	.app-side { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
	.menu-open .app-side { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
	.menu-open .app-scrim { display: block; position: fixed; inset: 0; background: rgba(17, 25, 22, .45); z-index: 25; }
	.app-close, .app-menu {
		display: inline-grid;
		place-items: center;
		width: 40px;
		height: 40px;
		border: 0;
		border-radius: 8px;
		background: transparent;
		color: inherit;
		cursor: pointer;
	}
	.app-close { color: var(--side-text); }
	.app-menu { color: var(--ink); margin-left: -8px; }
	.app-main { margin-left: 0; }
	.app-top { padding-left: 16px; padding-right: 16px; }
	.app-content { padding: 20px 16px 48px; }
	.pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.stage:nth-child(3) { border-left: 0; }
	.stage:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 600px) {
	.app-book span { display: none; }
	.app-book { padding: 9px 10px; }
	.ov-grid { grid-template-columns: 1fr; }
	.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.kpi { padding: 12px 14px; }
	.kpi strong { font-size: 21px; }
	.kpi-label, .kpi-sub { font-size: 12px; }
	.stage { flex-direction: column; gap: 0; padding: 12px 14px; }
	.pge-app .pge-form { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .app-side { transition: none; } }

/* Messages inbox */
.nav-badge { margin-left: auto; background: #E0A800; color: #17211D; font-family: var(--display); font-weight: 800; font-size: 12px; border-radius: 99px; min-width: 22px; padding: 2px 7px 1px; text-align: center; }
.msg-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.msg-head h1 { font-size: clamp(24px, 3vw, 30px); }
.msg-new { display: flex; align-items: center; gap: 8px; }
.msg-new label { font-weight: 600; font-size: 14px; }
.msg-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; align-items: start; }
.msg-threads { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.msg-threads ul { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 220px); overflow-y: auto; }
.msg-threads .empty { padding: 16px; }
.msg-threads a { display: flex; flex-direction: column; gap: 1px; padding: 11px 14px; border-bottom: 1px solid var(--bg); text-decoration: none; color: var(--ink); }
.msg-threads a:hover { background: #F7F9F8; }
.msg-threads a[aria-current="true"] { background: var(--brand-tint); box-shadow: inset 3px 0 0 var(--brand); }
.msg-t { display: flex; justify-content: space-between; gap: 8px; }
.msg-t strong { font-family: var(--display); font-weight: 800; }
.msg-t time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.msg-s { font-size: 12px; color: var(--muted); }
.msg-p { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.has-unread .msg-p { font-weight: 700; color: var(--ink); }
.msg-n { display: inline-block; background: #E0A800; color: var(--ink); border-radius: 99px; font-size: 11px; padding: 0 6px; margin-right: 6px; }
.msg-thread-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--bg); }
.msg-thread .pge-msg-scroll { max-height: calc(100vh - 380px); min-height: 240px; }
@media (max-width: 900px) {
	.msg-layout { grid-template-columns: 1fr; }
	.msg-threads ul { max-height: 260px; }
}

a.app-user { text-decoration: none; border-radius: 8px; padding: 6px; margin: 0 0 6px; }
a.app-user:hover, a.app-user[aria-current="page"] { background: var(--side-2); }
.pge-app input.pge-readonly, .pge-app input[readonly] { background: var(--bg); color: var(--ink-2); cursor: not-allowed; }

.auth-choices { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.auth-choices a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.auth-choices a:hover { border-color: var(--brand); background: var(--brand-tint); }
.auth-choices strong { font-family: var(--display); font-size: 16px; }
.auth-choices span { font-size: 13px; color: var(--muted); }

/* Live alerts */
.app-alerts { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--brand); background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px 6px; cursor: pointer; white-space: nowrap; margin-left: auto; }
.app-alerts:hover { border-color: var(--brand); }
.app-alerts .app-icon { width: 18px; height: 18px; }
.app-alerts:not([hidden]) + .app-book { margin-left: 0; }
.app-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: flex; flex-direction: column; gap: 10px; width: 360px; max-width: calc(100vw - 40px); }
.app-toast { position: relative; display: flex; flex-direction: column; gap: 2px; background: #17211D; color: #fff; text-decoration: none; border-radius: 12px; padding: 12px 40px 12px 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); border-left: 5px solid #E0A800; }
.app-toast strong { font-family: var(--display); }
.app-toast span { color: #DDE5E1; font-size: 14px; }
.app-toast:hover { color: #fff; }
.app-toast button { position: absolute; top: 6px; right: 8px; background: none; border: 0; color: #fff; font-size: 20px; cursor: pointer; line-height: 1; padding: 4px; }
@media (max-width: 600px) { .app-alerts span { display: none; } }

/* PGE TMS pin mark (the platform's own sign-in and app) */
.app-pin { display: block; flex: none; color: #fff; }
.auth-brand .app-pin { color: #0A7A50; }
.app-alerts.is-on { background: var(--brand-tint); border-color: var(--brand); }

/* Tick-boxes and radio buttons keep their natural size, next to their text */
.pge-app input[type=checkbox], .pge-app input[type=radio] { width: auto; min-height: 0; height: auto; margin: 0; flex: none; }
.pge-app .pge-check span { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; }
.pge-app .pge-check span input { margin-top: 3px; }
.pge-app .pge-field.pge-inv-total { flex-direction: row; justify-content: space-between; align-items: baseline; }
.pge-app .pge-invoice-form [data-add-charge] { width: auto; }

/* Getting started checklist */
.ob { margin-bottom: 14px; border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.ob-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ob-head h2 { font-size: 19px; }
.ob-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.ob-link { background: none; border: 0; padding: 4px 0; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ob-link:hover, .ob-link:focus-visible { color: var(--brand); }
.ob-bar { height: 8px; background: var(--bg); border-radius: 99px; margin: 12px 0 6px; overflow: hidden; }
.ob-bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s ease; }
.ob-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 22px; }
.ob-steps li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ob-tick { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; margin-top: 1px; }
.ob-steps .is-done .ob-tick { background: var(--brand); border-color: var(--brand); color: #fff; }
.ob-steps .is-next .ob-tick { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); }
.ob-steps .is-done strong { color: var(--muted); font-weight: 600; text-decoration: line-through; text-decoration-color: var(--line); }
.ob-body strong { font-family: var(--display); font-size: 15px; }
.ob-body p { margin: 4px 0 8px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.ob-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ob-actions form { margin: 0; }
.ob-import { font-size: 14px; font-weight: 600; }

/* Import */
.pge-import .imp-drop, .pge-rc .imp-drop { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; border: 2px dashed var(--line); border-radius: var(--radius); padding: 18px; cursor: pointer; background: var(--bg); }
.pge-import .imp-drop:hover, .pge-import .imp-drop:focus-within, .pge-rc .imp-drop:hover { border-color: var(--brand); }
.pge-import .imp-drop span, .pge-rc .imp-drop span { display: grid; gap: 2px; font-weight: 400; }
.pge-import .imp-form + .imp-form, .pge-import .imp-form .pge-panel + .pge-panel { margin-top: 14px; }
.pge-import .imp-drop small, .pge-rc .imp-drop small { color: var(--muted); }
.pge-import .imp-or { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 16px 0; }
.pge-import .imp-or::before, .pge-import .imp-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.pge-import textarea { width: 100%; margin-top: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.pge-import .imp-buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.pge-import .imp-map select { min-width: 220px; max-width: 100%; }
.pge-import .imp-sub { font-size: 15px; margin: 20px 0 8px; }
.pge-import .imp-preview td { white-space: nowrap; }
.pge-import .imp-dupes { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.pge-import .imp-dupes legend { font-weight: 700; margin-bottom: 6px; }
.pge-import .imp-dupes label, .pge-import .imp-invite { display: flex; gap: 8px; align-items: flex-start; }
.pge-import .imp-tips { margin: 0 0 14px; padding-left: 18px; display: grid; gap: 8px; color: var(--ink-2, var(--ink)); }
.pge-import .imp-counts { list-style: none; padding: 0; margin: 4px 0 16px; display: flex; flex-wrap: wrap; gap: 10px; }
.pge-import .imp-counts li { background: var(--bg); border-radius: 8px; padding: 10px 14px; }
.pge-import .imp-counts strong { font-family: var(--display); font-size: 22px; margin-right: 4px; }
.pge-import .imp-notes { margin-bottom: 16px; }
.pge-import .imp-notes ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }

/* Free trial banner */
.pge-trial-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; background: var(--brand-tint); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; font-size: 14px; }
.pge-trial-banner strong { font-family: var(--display); }
.pge-trial-banner .button { margin-left: auto; }
.pge-trial-banner.is-ending { background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }

/* Driver pay */
.st-new-grid { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 10px; align-items: end; }
.st-new-grid label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.st-new-grid select, .st-new-grid input { width: 100%; }
.st-waiting { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; }
.pge-settle .pge-panel + .pge-panel, .st-edit .pge-panel { margin-bottom: 14px; }
.st-lines { width: 100%; border-collapse: collapse; }
.st-lines td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.st-lines td small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.st-lines .st-amt { text-align: right; white-space: nowrap; width: 1%; padding-left: 12px; }
.st-lines .st-amt input { width: 100px; text-align: right; }
.st-lines .st-amt label { font-size: 12px; color: var(--muted); margin-right: 4px; }
.st-lines .st-amt span { margin-left: 8px; font-weight: 700; }
.st-lines .st-rm { width: 1%; white-space: nowrap; padding-left: 14px; font-size: 13px; color: var(--muted); }
.st-label { width: 100%; max-width: 360px; }
.st-repeat, .st-check { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 4px; }
.st-more { margin-top: 12px; font-size: 14px; }
.st-more label { display: flex; gap: 8px; padding: 4px 0; }
.st-add { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; }
.st-edit textarea { width: 100%; }
.st-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 20px; }
.st-totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0 0 14px; }
.st-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.st-totals .st-net { font-weight: 800; font-family: var(--display); font-size: 18px; padding-top: 6px; border-top: 1px solid var(--line); }
.st-inline { margin: 8px 0 0; }
.st-inline label { display: block; font-size: 13px; font-weight: 600; margin: 8px 0 3px; }
.st-inline input[type=date], .st-inline input[name=paid_ref] { width: 100%; }
.st-inline .st-check { font-weight: 400; margin: 10px 0; }
.st-h3 { font-size: 15px; margin: 4px 0 0; }
.st-view iframe { width: 100%; height: 900px; border: 0; background: #E9ECEA; border-radius: 8px; }
@media (max-width: 900px) { .st-new-grid, .st-add { grid-template-columns: 1fr; } .st-lines .st-rm { display: block; width: auto; padding: 0 0 10px; } }
.pge-settle input:not([type=checkbox]):not([type=radio]), .pge-settle select, .pge-settle textarea, .st-new input, .st-new select, .pge-side form input:not([type=checkbox]), .pge-side form select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; background: #fff; min-height: 38px; box-sizing: border-box; }
.pge-settle input:focus, .pge-settle select:focus, .pge-settle textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.pge-app .button-link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 0; box-shadow: none; }
.pge-app .button-link-delete { color: var(--red); }

/* IFTA */
.ifta-q { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.ifta-q label { font-weight: 600; }
.ifta-q select, .pge-ifta input:not([type=checkbox]), .pge-ifta select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 14px; background: #fff; min-height: 36px; box-sizing: border-box; }
.ifta-kpis { margin-bottom: 14px; }
.ifta-warn { background: var(--amber-bg); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; font-size: 14px; }
.ifta-warn ul { margin: 6px 0 0; padding-left: 18px; }
.pge-ifta .pge-panel { margin-bottom: 14px; }
.ifta-table .ifta-owe { color: var(--red); font-weight: 700; }
.ifta-table .ifta-credit { color: var(--brand); font-weight: 700; }
.ifta-table .ifta-total td { font-weight: 800; border-top: 2px solid var(--ink); }
.ifta-note { font-size: 13px; margin-top: 10px; }
.ifta-single { margin: 0 0 12px; }
.ifta-inline { display: flex; gap: 6px; justify-content: flex-end; }
.ifta-inline input { width: 180px; }
.ifta-add label { display: block; font-size: 13px; font-weight: 600; margin: 8px 0 3px; }
.ifta-add input, .ifta-add select { width: 100%; }
@media print { .app-side, .app-top, .ifta-q, .pge-side, .ifta-single, .ifta-loads, .pge-sign-actions, .ifta-inline { display: none !important; } .app-main { margin: 0 !important; } }
.pge-app .pge-count { font-family: var(--display); font-weight: 800; font-size: 13px; background: var(--bg); border-radius: 6px; padding: 2px 8px 1px; color: var(--ink); margin-left: 4px; vertical-align: middle; }
@media (max-width: 700px) { .pge-bill-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Rate confirmation */
.pge-rc .rc-drop { margin-bottom: 12px; }
.rc-status { min-height: 1.4em; margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.rc-status.is-bad { color: var(--red); }
.rc-found { background: var(--brand-tint); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; font-size: 14px; }
.rc-found h2 { font-size: 16px; margin: 0 0 6px; }
.rc-found p { margin: 0 0 6px; }
.rc-found ul { margin: 4px 0 8px; padding-left: 18px; }
.rc-links details { display: inline; }
.rc-text pre { white-space: pre-wrap; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; max-height: 340px; overflow: auto; font-size: 12px; margin-top: 8px; }
.rc-hint { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.st-team { border: 0; border-top: 1px solid var(--line); margin: 14px 0 0; padding: 12px 0 0; }
.st-team legend { font-weight: 700; font-size: 14px; padding: 0 0 4px; }
.st-team-split label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 3px; }
.st-team-split input { width: 100%; }
.st-team-split .pge-muted { display: block; font-size: 12px; margin-top: 2px; }

/* Route */
.rt-sum { margin: 0 0 6px; font-size: 15px; }
.rt-sum strong { font-family: var(--display); font-size: 20px; margin-right: 6px; }
.rt-diff { font-size: 13px; margin: 0 0 8px; }
.rt-states { list-style: none; margin: 10px 0 4px; padding: 0; font-size: 14px; }
.rt-states li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); }
.rt-note { font-size: 12px; margin: 4px 0 10px; }
.rt-form { margin: 8px 0; }
.rt-links { font-size: 14px; margin: 6px 0 0; }

/* ---------------------------------------------------------------- Broker workspace */
.bk-h1 { font-size: clamp(24px, 3vw, 30px); margin-bottom: 18px; }
.bk-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.bk-kpis-sm { margin-top: 6px; }
.bk-kpi { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); }
a.bk-kpi:hover { border-color: var(--brand); }
.bk-kpi span { font-size: 13px; color: var(--muted); font-weight: 600; }
.bk-kpi strong { font-family: var(--display); font-size: 26px; font-weight: 800; line-height: 1.15; }
.bk-kpi small { color: var(--muted); font-size: 12.5px; }
.bk-kpi.is-warn { border-color: var(--amber); background: var(--amber-bg); }
.bk-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.bk-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.bk-card h2 { font-size: 16px; margin-bottom: 10px; }
.bk-rows { list-style: none; margin: 0; padding: 0; }
.bk-rows li { padding: 9px 0; border-top: 1px solid var(--line); line-height: 1.45; }
.bk-rows li:first-child { border-top: 0; padding-top: 0; }
.bk-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.bk-tabs a { text-decoration: none; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 600; font-size: 14px; }
.bk-tabs a.current { background: var(--brand); border-color: var(--brand); color: #fff; }
.bk-mtable table { margin-top: 4px; }
.bk-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; align-items: end; height: 220px; margin: 8px 0 6px; }
.bk-bar { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.bk-bar-track { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; }
.bk-bar-rev { position: relative; display: flex; align-items: flex-end; width: 100%; background: var(--brand-tint); border-radius: 6px 6px 0 0; min-height: 2px; }
.bk-bar-m { display: block; width: 100%; background: var(--brand); border-radius: 6px 6px 0 0; }
.bk-bar small { color: var(--muted); font-size: 12px; }
.bk-bar b { font-size: 11px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.bk-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin: 0 4px 0 10px; }
.bk-key-rev { background: var(--brand-tint); } .bk-key-m { background: var(--brand); }
.bk-ap td { vertical-align: top; }
.bk-settings { margin-top: 18px; }
.bk-settings summary { cursor: pointer; }
@media (max-width: 1100px) { .bk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bk-cols { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .bk-kpis { grid-template-columns: 1fr; } .bk-bars b { display: none; } }
.bk-overview .pge-badge, .bk-card .pge-badge { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 4px; padding: 2px 7px; }
.bk-overview .pge-badge-problem { background: #FDECEA; color: #B42318; box-shadow: inset 0 0 0 1px #F2B8B5; }
.bk-overview .pge-badge-invoiced { background: #FFF5D6; color: #7A5600; }
.bk-overview .pge-badge-delivered { background: #DCEFE5; color: #00613F; }
