/* ==========================================================================
   Moot Freight Operations — premium command centre UI
   ========================================================================== */

.moot-freight-app .freight-sidebar {
	background: #0b1220;
	border-right-color: rgba(255, 255, 255, 0.06);
	color: #e2e8f0;
}

.moot-freight-app .freight-logo {
	color: #f8fafc;
}

.moot-freight-app .freight-logo__mark {
	background: rgba(37, 99, 235, 0.18);
	color: #60a5fa;
}

.moot-freight-app .freight-company-switcher__select {
	background: rgba(255, 255, 255, 0.06);
	border-color: rgba(255, 255, 255, 0.1);
	color: #f1f5f9;
}

.moot-freight-app .freight-nav__link {
	color: #94a3b8;
}

.moot-freight-app .freight-nav__link:hover {
	background: rgba(255, 255, 255, 0.06);
	color: #f8fafc;
}

.moot-freight-app .freight-nav__link.is-active {
	background: rgba(37, 99, 235, 0.22);
	color: #fff;
}

.moot-freight-app .freight-profile-card__name {
	color: #f1f5f9;
}

.moot-freight-app .freight-profile-card__role,
.moot-freight-app .freight-sidebar__logout {
	color: #94a3b8;
}

.moot-freight-app .freight-badge {
	background: #2563eb;
	color: #fff;
}

/* Ops layout */
.fo-root {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.fo-banner {
	padding: 0.85rem 1rem;
	border-radius: 12px;
	font-size: 0.92rem;
}

.fo-banner--success {
	background: #ecfdf3;
	border: 1px solid #bbf7d0;
	color: #166534;
}

.fo-banner--error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
}

.fo-page-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
}

.fo-page-head__copy h2 {
	margin: 0 0 0.35rem;
	font-size: 1.35rem;
}

.fo-page-head__copy p {
	margin: 0;
	color: var(--freight-muted);
	max-width: 52ch;
}

.fo-page-head__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.fo-stat-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 0.85rem;
}

.fo-stat-card {
	background: var(--freight-surface);
	border: 1px solid var(--freight-border);
	border-radius: 16px;
	padding: 1rem 1.1rem;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.fo-stat-card__label {
	display: block;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--freight-muted);
	margin-bottom: 0.35rem;
}

.fo-stat-card__value {
	font-size: 1.45rem;
	font-weight: 800;
	line-height: 1.1;
}

.fo-stat-card__meta {
	display: block;
	margin-top: 0.25rem;
	font-size: 0.82rem;
	color: var(--freight-muted);
}

.fo-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	padding: 0.35rem;
	background: #eef2f7;
	border-radius: 14px;
	width: fit-content;
}

.fo-tab {
	border: 0;
	background: transparent;
	padding: 0.55rem 1rem;
	border-radius: 10px;
	font: inherit;
	font-weight: 600;
	color: var(--freight-muted);
	cursor: pointer;
}

.fo-tab.is-active {
	background: #fff;
	color: var(--freight-text);
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.fo-card {
	background: var(--freight-surface);
	border: 1px solid var(--freight-border);
	border-radius: 18px;
	padding: 1.15rem 1.25rem;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.fo-card__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.fo-card__head h3 {
	margin: 0;
	font-size: 1.05rem;
}

.fo-grid-2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.fo-grid-3 {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr) 300px;
	gap: 1rem;
	align-items: start;
}

.fo-field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin-bottom: 0.85rem;
}

.fo-field span {
	font-size: 0.82rem;
	font-weight: 600;
	color: #475569;
}

.fo-field input,
.fo-field select,
.fo-field textarea {
	border: 1px solid var(--freight-border);
	border-radius: 12px;
	padding: 0.65rem 0.8rem;
	font: inherit;
	background: #fff;
}

.fo-field textarea {
	min-height: 80px;
	resize: vertical;
}

.fo-chip-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.fo-chip {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.55rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
	background: #f1f5f9;
	color: #475569;
}

.fo-chip--blue { background: #dbeafe; color: #1d4ed8; }
.fo-chip--green { background: #dcfce7; color: #15803d; }
.fo-chip--amber { background: #fef3c7; color: #b45309; }
.fo-chip--red { background: #fee2e2; color: #b91c1c; }
.fo-chip--violet { background: #ede9fe; color: #6d28d9; }

.fo-status {
	display: inline-flex;
	align-items: center;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.fo-status--available { background: #dcfce7; color: #15803d; }
.fo-status--on_route { background: #dbeafe; color: #1d4ed8; }
.fo-status--assigned { background: #ede9fe; color: #6d28d9; }
.fo-status--in_progress { background: #fef3c7; color: #b45309; }
.fo-status--completed { background: #ecfdf3; color: #166534; }
.fo-status--maintenance { background: #fee2e2; color: #b91c1c; }
.fo-status--pending { background: #fef3c7; color: #b45309; }

.fo-empty {
	text-align: center;
	padding: 2.5rem 1.5rem;
	border: 1px dashed var(--freight-border);
	border-radius: 18px;
	background: #fafbfd;
}

.fo-empty h3 {
	margin: 0 0 0.5rem;
}

.fo-empty p {
	margin: 0 0 1rem;
	color: var(--freight-muted);
}

/* Route builder */
.fo-stop-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.fo-stop {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.75rem;
	border: 1px solid var(--freight-border);
	border-radius: 12px;
	background: #fafbfd;
	cursor: grab;
}

.fo-stop__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--freight-blue);
	flex-shrink: 0;
}

.fo-stop__body {
	flex: 1;
	min-width: 0;
}

.fo-stop__body strong {
	display: block;
	font-size: 0.92rem;
}

.fo-stop__body small {
	color: var(--freight-muted);
}

.fo-map {
	position: relative;
	min-height: 360px;
	border-radius: 16px;
	overflow: hidden;
	background: linear-gradient(180deg, #e8f0fe 0%, #dbeafe 100%);
	border: 1px solid var(--freight-border);
}

.fo-map__canvas {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(rgba(37, 99, 235, 0.06) 1px, transparent 1px),
		linear-gradient(90deg, rgba(37, 99, 235, 0.06) 1px, transparent 1px);
	background-size: 32px 32px;
}

.fo-map__route {
	position: absolute;
	left: 12%;
	top: 28%;
	width: 76%;
	height: 44%;
	border: 3px solid rgba(37, 99, 235, 0.55);
	border-radius: 40% 60% 55% 45% / 48% 42% 58% 52%;
}

.fo-map__pin {
	position: absolute;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2);
}

.fo-map__pin--green { background: #22c55e; left: 10%; top: 52%; }
.fo-map__pin--blue { background: #3b82f6; left: 45%; top: 35%; }
.fo-map__pin--orange { background: #f97316; left: 72%; top: 58%; }
.fo-map__pin--violet { background: #8b5cf6; left: 58%; top: 22%; }

.fo-map__legend {
	position: absolute;
	left: 12px;
	bottom: 12px;
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	padding: 0.45rem 0.6rem;
	background: rgba(255, 255, 255, 0.92);
	border-radius: 10px;
	font-size: 0.72rem;
}

.fo-summary-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fo-summary-list li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.55rem 0;
	border-bottom: 1px solid var(--freight-border);
	font-size: 0.92rem;
}

.fo-summary-list li:last-child {
	border-bottom: 0;
}

.fo-summary-list span {
	color: var(--freight-muted);
}

/* Kanban planner */
.fo-kanban {
	display: grid;
	grid-template-columns: repeat(4, minmax(220px, 1fr));
	gap: 0.85rem;
	overflow-x: auto;
	padding-bottom: 0.5rem;
}

.fo-kanban-col {
	background: #f8fafc;
	border: 1px solid var(--freight-border);
	border-radius: 16px;
	padding: 0.75rem;
	min-height: 420px;
}

.fo-kanban-col__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.75rem;
	font-weight: 700;
	font-size: 0.88rem;
}

.fo-kanban-col__count {
	background: #e2e8f0;
	color: #475569;
	border-radius: 999px;
	padding: 0.1rem 0.45rem;
	font-size: 0.72rem;
}

.fo-kanban-card {
	background: #fff;
	border: 1px solid var(--freight-border);
	border-radius: 14px;
	padding: 0.85rem;
	margin-bottom: 0.65rem;
	box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
	cursor: grab;
}

.fo-kanban-card__title {
	margin: 0 0 0.35rem;
	font-size: 0.95rem;
}

.fo-kanban-card__meta {
	margin: 0;
	font-size: 0.8rem;
	color: var(--freight-muted);
}

.fo-kanban-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 0.65rem;
	font-size: 0.78rem;
}

/* Load / match cards */
.fo-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1rem;
}

.fo-load-card,
.fo-match-card {
	background: #fff;
	border: 1px solid var(--freight-border);
	border-radius: 18px;
	padding: 1rem 1.1rem;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.fo-load-card__route,
.fo-match-card__route {
	font-weight: 700;
	margin: 0 0 0.35rem;
}

.fo-load-card__meta,
.fo-match-card__meta {
	margin: 0;
	color: var(--freight-muted);
	font-size: 0.86rem;
}

.fo-load-card__foot,
.fo-match-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 0.85rem;
	gap: 0.5rem;
}

.fo-match-card.is-new {
	border-color: #c4b5fd;
	box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.15), 0 12px 32px rgba(139, 92, 246, 0.12);
}

.fo-match-card__badge {
	display: inline-block;
	padding: 0.2rem 0.5rem;
	border-radius: 999px;
	background: #ede9fe;
	color: #6d28d9;
	font-size: 0.72rem;
	font-weight: 800;
	text-transform: uppercase;
	margin-bottom: 0.5rem;
}

/* Capacity donut row */
.fo-capacity-bars {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.fo-capacity-bar__head {
	display: flex;
	justify-content: space-between;
	font-size: 0.86rem;
	margin-bottom: 0.35rem;
}

.fo-capacity-bar__track {
	height: 8px;
	background: #e2e8f0;
	border-radius: 999px;
	overflow: hidden;
}

.fo-capacity-bar__fill {
	height: 100%;
	background: linear-gradient(90deg, #2563eb, #60a5fa);
	border-radius: 999px;
}

/* Compliance */
.fo-compliance-score {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	padding: 1.25rem;
	border-radius: 18px;
	background: linear-gradient(135deg, #0f172a, #1e3a5f);
	color: #fff;
}

.fo-compliance-score__ring {
	width: 88px;
	height: 88px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.35rem;
	font-weight: 800;
	background: conic-gradient(#22c55e var(--fo-score, 0%), rgba(255,255,255,0.12) 0);
	position: relative;
}

.fo-compliance-score__ring::after {
	content: '';
	position: absolute;
	inset: 8px;
	border-radius: 50%;
	background: #0f172a;
}

.fo-compliance-score__ring span {
	position: relative;
	z-index: 1;
}

.fo-doc-list {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.fo-doc-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 0.85rem;
	border: 1px solid var(--freight-border);
	border-radius: 12px;
	background: #fafbfd;
}

.fo-doc-row__name {
	font-weight: 600;
	font-size: 0.9rem;
}

.fo-doc-row__meta {
	font-size: 0.78rem;
	color: var(--freight-muted);
}

/* Modal */
.fo-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
	z-index: 1200;
}

.fo-modal {
	position: fixed;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(720px, calc(100vw - 32px));
	max-height: calc(100vh - 48px);
	overflow: auto;
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
	z-index: 1201;
}

.fo-modal__head,
.fo-modal__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.1rem 1.25rem;
	border-bottom: 1px solid var(--freight-border);
}

.fo-modal__foot {
	border-bottom: 0;
	border-top: 1px solid var(--freight-border);
	justify-content: flex-end;
	gap: 0.6rem;
}

.fo-modal__head h2 {
	margin: 0;
	font-size: 1.15rem;
}

.fo-modal__body {
	padding: 1.1rem 1.25rem 1.25rem;
}

.fo-modal__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.85rem;
}

.fo-modal__money {
	padding: 0.85rem;
	border-radius: 14px;
	background: #ecfdf3;
	border: 1px solid #bbf7d0;
}

.fo-modal__money strong {
	display: block;
	font-size: 1.35rem;
	color: #15803d;
}

/* Dashboard command centre map */
.fo-command-map {
	min-height: 420px;
}

.fo-command-panel {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}

.fo-command-panel__item {
	padding: 0.75rem 0.85rem;
	border: 1px solid var(--freight-border);
	border-radius: 12px;
	background: #fafbfd;
}

.fo-command-panel__item strong {
	display: block;
	margin-bottom: 0.2rem;
}

.fo-command-panel__item span {
	font-size: 0.82rem;
	color: var(--freight-muted);
}

@media (max-width: 1100px) {
	.fo-grid-3 {
		grid-template-columns: 1fr;
	}

	.fo-kanban {
		grid-template-columns: repeat(2, minmax(220px, 1fr));
	}
}

@media (max-width: 720px) {
	.fo-grid-2,
	.fo-modal__grid {
		grid-template-columns: 1fr;
	}

	.fo-kanban {
		grid-template-columns: 1fr;
	}
}
