:root {
	--cbdp-ink: #24282b;
	--cbdp-muted: #677078;
	--cbdp-line: #dfe3e6;
	--cbdp-soft: #f5f6f4;
	--cbdp-warm: #f4efe5;
	--cbdp-green: #315f50;
	--cbdp-red: #9e3939;
	--cbdp-radius: 14px;
}

.cb-dealer-portal .entry-content,
.cb-dealer-portal .site-main,
.cb-dealer-portal .woocommerce {
	max-width: none;
}

.cb-dealer-portal .cbdp-portal-layout {
	display: grid;
	grid-template-columns: 238px minmax(0, 1fr);
	gap: 42px;
	width: min(1540px, calc(100% - 48px));
	margin: 36px auto 80px;
	align-items: start;
}

.cb-dealer-portal .cbdp-portal-layout > .woocommerce-MyAccount-navigation,
.cb-dealer-portal .cbdp-portal-layout > .woocommerce-MyAccount-content {
	float: none;
	width: auto;
	max-width: none;
	margin: 0;
}

.cb-dealer-portal .woocommerce-MyAccount-navigation {
	position: sticky;
	top: 54px;
	padding: 22px 14px 16px;
	border: 1px solid var(--cbdp-line);
	border-radius: var(--cbdp-radius);
	background: #fff;
	box-shadow: 0 16px 40px rgba(25, 31, 34, 0.06);
	overflow: visible;
}

.cb-dealer-portal .cbdp-nav-title {
	padding: 0 10px 18px;
	margin-bottom: 8px;
	border-bottom: 1px solid var(--cbdp-line);
	line-height: 1.3;
}

.cb-dealer-portal .cbdp-nav-title strong,
.cb-dealer-portal .cbdp-nav-title span {
	display: block;
	position: static;
	float: none;
	width: auto;
	padding: 0;
	line-height: 1.3;
}

.cb-dealer-portal .cbdp-nav-title strong {
	margin: 0 0 4px;
	font-size: 16px;
	color: var(--cbdp-ink);
}

.cb-dealer-portal .cbdp-nav-title span {
	margin: 0;
	font-size: 12px;
	color: var(--cbdp-muted);
}

.cb-dealer-portal .woocommerce-MyAccount-navigation ul {
	display: block;
	margin: 0;
	padding: 0;
	white-space: normal;
}

.cb-dealer-portal .woocommerce-MyAccount-navigation li {
	display: block;
	margin: 3px 0;
	padding: 0;
}

.cb-dealer-portal .woocommerce-MyAccount-navigation li a {
	display: flex;
	align-items: center;
	min-height: 42px;
	padding: 10px 12px;
	border: 0;
	border-radius: 9px;
	color: #3d4448;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.25;
	text-decoration: none;
}

.cb-dealer-portal .woocommerce-MyAccount-navigation li a::before {
	display: inline-flex;
	width: 22px;
	padding: 0;
	margin-right: 9px;
	justify-content: center;
	color: #7a8287;
}

.cb-dealer-portal .woocommerce-MyAccount-navigation li.is-active a,
.cb-dealer-portal .woocommerce-MyAccount-navigation li a:hover,
.cb-dealer-portal .woocommerce-MyAccount-navigation li a:focus {
	background: var(--cbdp-ink);
	color: #fff;
	outline: 0;
}

.cb-dealer-portal .woocommerce-MyAccount-navigation li.is-active a::before,
.cb-dealer-portal .woocommerce-MyAccount-navigation li a:hover::before {
	color: #fff;
}

.cb-dealer-portal .woocommerce-MyAccount-navigation-link--bestilling a::before {
	content: "\f5fd";
	font-family: "fontawesome";
}

.cb-dealer-portal .woocommerce-MyAccount-navigation-link--cb-delivery-addresses a::before {
	content: "\f3c5";
	font-family: "fontawesome";
}

.cb-dealer-portal .woocommerce-MyAccount-navigation-link--cbdp-bike-order a::before {
	content: "\f206";
	font-family: "fontawesome";
}

.cb-dealer-portal .woocommerce-MyAccount-navigation-link--cbdp-document-recipients a::before {
	content: "\f0e0";
	font-family: "fontawesome";
}

.cb-dealer-portal .woocommerce-MyAccount-content {
	min-width: 0;
}

.cbdp-page-heading {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin: 0 0 28px;
}

.cbdp-eyebrow {
	display: block;
	margin-bottom: 8px;
	color: var(--cbdp-green);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

.cbdp-page-heading h1 {
	margin: 0 0 8px;
	color: var(--cbdp-ink);
	font-size: clamp(30px, 3vw, 48px);
	line-height: 1.05;
	letter-spacing: -0.03em;
}

.cbdp-page-heading p,
.cbdp-panel-heading p {
	margin: 0;
	color: var(--cbdp-muted);
}

.cbdp-heading-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.cbdp-button,
.cb-dealer-portal .cbdp-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 18px;
	border: 1px solid var(--cbdp-ink);
	border-radius: 8px;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
}

.cbdp-button-primary {
	background: var(--cbdp-ink);
	color: #fff;
}

.cbdp-button-secondary {
	background: #fff;
	color: var(--cbdp-ink);
}

.cbdp-kpi-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
	margin-bottom: 18px;
}

.cbdp-kpi-card {
	display: flex;
	flex-direction: column;
	min-height: 178px;
	padding: 22px;
	border: 1px solid var(--cbdp-line);
	border-radius: var(--cbdp-radius);
	background: #fff;
}

.cbdp-kpi-card > span {
	color: var(--cbdp-muted);
	font-size: 13px;
	font-weight: 700;
}

.cbdp-kpi-card > strong {
	margin: 18px 0 auto;
	color: var(--cbdp-ink);
	font-size: 42px;
	line-height: 1;
}

.cbdp-kpi-card > a,
.cbdp-kpi-card > small {
	margin-top: 18px;
	color: var(--cbdp-muted);
	font-size: 12px;
	line-height: 1.4;
}

.cbdp-kpi-dark {
	border-color: var(--cbdp-ink);
	background: var(--cbdp-ink);
	color: #fff;
}

.cbdp-kpi-dark > span,
.cbdp-kpi-dark > strong,
.cbdp-kpi-dark > a {
	color: #fff;
}

.cbdp-kpi-pending {
	background: var(--cbdp-warm);
}

.cbdp-kpi-alert {
	border-color: rgba(158, 57, 57, 0.45);
	background: #fff8f8;
}

.cbdp-kpi-alert > strong {
	color: var(--cbdp-red);
}

.cbdp-kpi-card .woocommerce-Price-amount {
	white-space: nowrap;
}

.cbdp-dashboard-grid {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(280px, 0.8fr);
	gap: 18px;
}

.cbdp-panel {
	padding: 24px;
	border: 1px solid var(--cbdp-line);
	border-radius: var(--cbdp-radius);
	background: #fff;
}

.cbdp-panel-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	margin-bottom: 20px;
}

.cbdp-panel h2,
.cbdp-panel-heading h2 {
	margin: 0 0 4px;
	font-size: 20px;
	color: var(--cbdp-ink);
}

.cbdp-panel-heading a {
	white-space: nowrap;
}

.cbdp-table-scroll {
	overflow-x: auto;
}

.cbdp-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.cbdp-table th,
.cbdp-table td {
	padding: 13px 10px;
	border-bottom: 1px solid var(--cbdp-line);
	text-align: left;
	vertical-align: middle;
}

.cbdp-table th {
	color: var(--cbdp-muted);
	font-size: 11px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.cbdp-table td small {
	display: block;
	margin-top: 2px;
	color: var(--cbdp-muted);
}

.cbdp-table .cbdp-number {
	text-align: right;
}

.cbdp-order-link {
	font-weight: 700;
}

.cbdp-status {
	display: inline-flex;
	align-items: center;
	min-height: 26px;
	padding: 4px 9px;
	border-radius: 999px;
	background: #edf0f1;
	color: #495156;
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
}

.cbdp-status-processing,
.cbdp-status-open,
.cbdp-status-on-hold,
.cbdp-status-godkendt {
	background: #e2efe8;
	color: var(--cbdp-green);
}

.cbdp-status-pending,
.cbdp-status-gennemsyn {
	background: #f4ead8;
	color: #76591f;
}

.cbdp-status-cancelled,
.cbdp-status-failed,
.cbdp-status-refunded {
	background: #fae7e7;
	color: var(--cbdp-red);
}

.cbdp-next-phase {
	background: var(--cbdp-soft);
}

.cbdp-next-phase p,
.cbdp-next-phase li {
	color: var(--cbdp-muted);
}

.cbdp-next-phase ul {
	padding-left: 18px;
	margin: 18px 0 0;
}

.cbdp-next-phase li + li {
	margin-top: 8px;
}

.cbdp-quick-actions {
	grid-column: 1 / -1;
}

.cbdp-action-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
}

.cbdp-action-grid a {
	display: flex;
	flex-direction: column;
	min-height: 100px;
	padding: 18px;
	border: 1px solid var(--cbdp-line);
	border-radius: 10px;
	color: var(--cbdp-ink);
	text-decoration: none;
}

.cbdp-action-grid a:hover {
	border-color: var(--cbdp-ink);
	transform: translateY(-1px);
}

.cbdp-action-grid span {
	margin-top: 6px;
	color: var(--cbdp-muted);
	font-size: 12px;
	line-height: 1.4;
}

/* Fast cargo-bike model chooser */
.cbdp-bike-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
}

.cbdp-bike-card {
	display: flex;
	min-width: 0;
	flex-direction: column;
	border: 1px solid var(--cbdp-line);
	border-radius: var(--cbdp-radius);
	background: #fff;
	overflow: hidden;
}

.cbdp-bike-image {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
	padding: 22px;
	background: var(--cbdp-soft);
}

.cbdp-bike-image img {
	display: block;
	width: 100%;
	height: 190px;
	object-fit: contain;
}

.cbdp-bike-card-content {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	padding: 22px;
}

.cbdp-bike-card-content h2 {
	margin: 0 0 7px;
	color: var(--cbdp-ink);
	font-size: 20px;
}

.cbdp-bike-card-content p {
	margin: 0 0 22px;
	color: var(--cbdp-muted);
	font-size: 13px;
}

.cbdp-bike-card-content .cbdp-button {
	margin-top: auto;
}

/* Existing order search and table */
.cb-dealer-portal .woocommerce-MyAccount-content > form,
.cb-dealer-portal .woocommerce-MyAccount-content .cb-account-order-search {
	padding: 20px;
	margin-bottom: 16px;
	border: 1px solid var(--cbdp-line);
	border-radius: var(--cbdp-radius);
	background: var(--cbdp-soft);
}

.cbdp-order-filters {
	display: flex;
	align-items: flex-end;
	gap: 14px;
	padding: 16px 18px;
	margin: 18px 0 0;
	border: 1px solid var(--cbdp-line);
	border-bottom: 0;
	border-radius: var(--cbdp-radius) var(--cbdp-radius) 0 0;
	background: #fff;
}

.cbdp-order-filters label > span {
	display: block;
	margin-bottom: 5px;
	font-size: 12px;
	font-weight: 700;
}

.cbdp-order-filters select {
	min-width: 190px;
	height: 40px;
	padding: 0 36px 0 12px;
	border: 1px solid var(--cbdp-line);
	border-radius: 7px;
	background: #fff;
}

.cbdp-order-filters .cbdp-open-filter {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
}

.cbdp-order-filters .cbdp-open-filter span {
	margin: 0;
}

.cbdp-order-count {
	margin-left: auto;
	padding-bottom: 9px;
	color: var(--cbdp-muted);
	font-size: 13px;
}

.cb-dealer-portal .cbdp-order-filters + table.woocommerce-orders-table,
.cb-dealer-portal .cbdp-order-filters + table.woocommerce-MyAccount-orders {
	margin-top: 0;
	border: 1px solid var(--cbdp-line);
	border-radius: 0 0 var(--cbdp-radius) var(--cbdp-radius);
	overflow: hidden;
}

.cb-dealer-portal table.woocommerce-orders-table th,
.cb-dealer-portal table.woocommerce-orders-table td {
	text-align: left;
}

.cb-dealer-portal table.woocommerce-orders-table th {
	background: #f2f3f2;
	font-size: 11px;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

/* Account and the existing multiple-address plugin */
.cb-dealer-portal .woocommerce-EditAccountForm,
.cb-dealer-portal .woocommerce-MyAccount-content > form.woocommerce-EditAccountForm {
	padding: 28px;
	border: 1px solid var(--cbdp-line);
	border-radius: var(--cbdp-radius);
	background: #fff;
}

.cb-dealer-portal .woocommerce-MyAccount-content input.input-text,
.cb-dealer-portal .woocommerce-MyAccount-content select,
.cb-dealer-portal .woocommerce-MyAccount-content textarea {
	min-height: 46px;
	border: 1px solid #cfd4d7;
	border-radius: 7px;
	background: #fff;
}

.cbdp-address-heading {
	margin-top: 54px !important;
	padding-top: 30px;
	border-top: 1px solid var(--cbdp-line);
	scroll-margin-top: 80px;
}

.cbdp-new-address-heading {
	margin-top: 36px !important;
}

.cbdp-address-card {
	border: 1px solid var(--cbdp-line) !important;
	border-radius: 12px !important;
	background: #fff !important;
	box-shadow: 0 8px 22px rgba(25, 31, 34, 0.05);
}

.cbdp-address-section {
	padding: 28px;
	border: 1px solid var(--cbdp-line);
	border-radius: var(--cbdp-radius);
	background: #fff;
}

.cbdp-address-section .cbdp-address-heading {
	margin-top: 0 !important;
	padding-top: 0;
	border-top: 0;
}

body.cbdp-account-section-kontooplysninger .cbdp-address-section,
body.cbdp-account-section-kontooplysninger .cbdp-document-layouts,
body.cbdp-account-section-leveringsadresser .woocommerce-EditAccountForm,
body.cbdp-account-section-leveringsadresser .cbdp-document-layouts,
body.cbdp-account-section-emailmodtagere .woocommerce-EditAccountForm,
body.cbdp-account-section-emailmodtagere .cbdp-address-section {
	display: none !important;
}

/* Fallback for address plugins whose markup cannot be wrapped reliably. */
body.cbdp-account-section-emailmodtagere #cbdp-document-layouts ~ * {
	display: none !important;
}

.cb-dealer-portal a.cbdp-address-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 7px 12px;
	margin: 4px 4px 0 0;
	border: 1px solid var(--cbdp-ink);
	border-radius: 7px;
	background: var(--cbdp-ink);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	text-decoration: none;
}

.cb-dealer-portal a[href*="wcmsa_dk_delete"].cbdp-address-action {
	background: #fff;
	color: var(--cbdp-red);
	border-color: #d8b3b3;
}

/* Business Central document recipients */
.cbdp-document-layouts {
	padding: 28px;
	margin-top: 36px;
	border: 1px solid var(--cbdp-line);
	border-radius: var(--cbdp-radius);
	background: #fff;
}

.cbdp-document-layout-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 22px;
}

.cbdp-document-layout-heading h2 {
	margin: 0 0 7px;
	color: var(--cbdp-ink);
	font-size: 26px;
}

.cbdp-document-layout-heading p {
	max-width: 720px;
	margin: 0;
	color: var(--cbdp-muted);
}

.cbdp-sync-pill {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	padding: 6px 11px;
	border-radius: 999px;
	background: var(--cbdp-soft);
	color: var(--cbdp-muted);
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}

.cbdp-sync-synced {
	background: #e8f2ec;
	color: var(--cbdp-green);
}

.cbdp-sync-pending,
.cbdp-sync-sent {
	background: var(--cbdp-warm);
	color: #765c26;
}

.cbdp-sync-error {
	background: #f8e9e9;
	color: var(--cbdp-red);
}

.cbdp-document-layout-form {
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	background: transparent !important;
}

.cbdp-document-layout-list {
	border-top: 1px solid var(--cbdp-line);
}

.cbdp-document-layout-row {
	display: grid;
	grid-template-columns: minmax(210px, 0.8fr) minmax(280px, 1.2fr);
	align-items: center;
	gap: 24px;
	padding: 15px 0;
	border-bottom: 1px solid var(--cbdp-line);
}

.cbdp-document-layout-name strong,
.cbdp-document-layout-name small {
	display: block;
}

.cbdp-document-layout-name strong {
	color: var(--cbdp-ink);
	font-size: 14px;
}

.cbdp-document-layout-name small {
	margin-top: 3px;
	color: var(--cbdp-muted);
	font-size: 11px;
}

.cb-dealer-portal .cbdp-document-layout-row input.input-text {
	width: 100%;
	margin: 0;
}

.cbdp-document-layout-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding-top: 22px;
}

.cbdp-document-layout-footer > span {
	color: var(--cbdp-muted);
	font-size: 12px;
}

@media (max-width: 1180px) {
	.cb-dealer-portal .cbdp-portal-layout {
		grid-template-columns: 210px minmax(0, 1fr);
		gap: 24px;
	}

	.cbdp-kpi-grid,
	.cbdp-action-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cbdp-bike-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 820px) {
	.cb-dealer-portal .cbdp-portal-layout {
		display: block;
		width: min(100% - 28px, 760px);
		margin-top: 18px;
	}

	.cb-dealer-portal .woocommerce-MyAccount-navigation {
		position: static;
		margin-bottom: 24px !important;
		padding: 12px;
	}

	.cb-dealer-portal .cbdp-nav-title {
		display: none;
	}

	.cb-dealer-portal .woocommerce-MyAccount-navigation ul {
		display: flex;
		overflow-x: auto;
		gap: 6px;
	}

	.cb-dealer-portal .woocommerce-MyAccount-navigation li {
		flex: 0 0 auto;
	}

	.cb-dealer-portal .woocommerce-MyAccount-navigation li a {
		min-height: 38px;
		white-space: nowrap;
	}

	.cbdp-page-heading {
		align-items: flex-start;
		flex-direction: column;
	}

	.cbdp-dashboard-grid {
		grid-template-columns: 1fr;
	}

	.cbdp-quick-actions {
		grid-column: auto;
	}

	.cbdp-document-layout-heading {
		flex-direction: column;
	}
}

@media (max-width: 560px) {
	.cbdp-kpi-grid,
	.cbdp-action-grid,
	.cbdp-bike-grid {
		grid-template-columns: 1fr;
	}

	.cbdp-order-filters {
		align-items: stretch;
		flex-direction: column;
	}

	.cbdp-order-count {
		margin-left: 0;
	}

	.cbdp-heading-actions,
	.cbdp-heading-actions .cbdp-button {
		width: 100%;
	}

	.cbdp-document-layouts {
		padding: 20px;
	}

	.cbdp-address-section {
		padding: 20px;
	}

	.cbdp-document-layout-row {
		grid-template-columns: 1fr;
		gap: 9px;
	}

	.cbdp-document-layout-footer {
		align-items: stretch;
		flex-direction: column;
	}

	.cbdp-document-layout-footer .cbdp-button {
		width: 100%;
	}
}

