/* Cooper Mobile Pro — mobile first */

:root {
	--cmp-accent: #0b5cab;
	--cmp-accent-dark: #08477f;
	--cmp-ink: #17212b;
	--cmp-muted: #687480;
	--cmp-line: #dfe5ea;
	--cmp-bg: #f5f7f9;
	--cmp-surface: #ffffff;
	--cmp-success: #16835d;
	--cmp-danger: #c03532;
	--cmp-radius: 12px;
	--cmp-shadow: 0 8px 28px rgba(20, 34, 48, .08);
	--cmp-header-height: 60px;
	--cmp-bottom-height: 66px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--cmp-bg);
	color: var(--cmp-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.55;
	text-rendering: optimizeLegibility;
}

body.admin-bar .cmp-site-header {
	top: 46px;
}

html.cmp-menu-open,
html.cmp-menu-open body {
	overflow: hidden;
}

a {
	color: var(--cmp-accent);
	text-decoration-thickness: .08em;
	text-underline-offset: .18em;
}

img,
svg,
video,
iframe {
	max-width: 100%;
}

button,
input,
select,
textarea {
	font: inherit;
}

button,
[type="button"],
[type="submit"],
[type="reset"],
a {
	-webkit-tap-highlight-color: transparent;
}

input,
select,
textarea {
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid var(--cmp-line);
	border-radius: 9px;
	background: var(--cmp-surface);
	color: var(--cmp-ink);
}

textarea {
	min-height: 110px;
	resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--cmp-accent) 28%, transparent);
	outline-offset: 2px;
	border-color: var(--cmp-accent);
}

button,
.button,
.wp-element-button,
input[type="submit"],
.cmp-button {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 16px;
	border: 0;
	border-radius: 9px;
	background: var(--cmp-accent);
	color: #fff;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

button:hover,
.button:hover,
.wp-element-button:hover,
input[type="submit"]:hover,
.cmp-button:hover {
	background: var(--cmp-accent-dark);
	color: #fff;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.cmp-skip-link {
	position: fixed;
	z-index: 10000;
	top: 8px;
	left: 8px;
	transform: translateY(-140%);
	padding: 10px 14px;
	border-radius: 8px;
	background: #111;
	color: #fff;
}

.cmp-skip-link:focus {
	transform: translateY(0);
}

.cmp-site-header {
	position: sticky;
	z-index: 1000;
	top: 0;
	height: var(--cmp-header-height);
	border-bottom: 1px solid var(--cmp-line);
	background: rgba(255, 255, 255, .96);
	backdrop-filter: blur(12px);
}

.cmp-header-inner {
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 0 14px;
}

.cmp-brand {
	display: flex;
	align-items: center;
	min-width: 0;
}

.cmp-brand .custom-logo-link {
	display: flex;
	align-items: center;
}

.cmp-brand .custom-logo {
	display: block;
	width: auto;
	max-width: 190px;
	max-height: 40px;
	object-fit: contain;
}

.cmp-site-name {
	overflow: hidden;
	color: var(--cmp-ink);
	font-size: 18px;
	font-weight: 800;
	line-height: 1.1;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cmp-menu-button,
.cmp-drawer-close {
	width: 44px;
	height: 44px;
	padding: 10px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--cmp-ink);
}

.cmp-menu-button:hover,
.cmp-drawer-close:hover {
	background: #eef2f5;
	color: var(--cmp-ink);
}

.cmp-menu-button svg,
.cmp-drawer-close svg,
.cmp-bottom-link svg,
.cmp-dashboard-icon svg {
	width: 24px;
	height: 24px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.cmp-desktop-nav {
	display: none;
}

.cmp-drawer-backdrop {
	position: fixed;
	z-index: 1090;
	inset: 0;
	background: rgba(11, 18, 25, .48);
	opacity: 0;
	transition: opacity .18s ease;
}

.cmp-drawer-backdrop.is-visible {
	opacity: 1;
}

.cmp-mobile-drawer {
	position: fixed;
	z-index: 1100;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(88vw, 360px);
	padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
	background: var(--cmp-surface);
	box-shadow: -12px 0 34px rgba(0, 0, 0, .14);
	transform: translateX(105%);
	transition: transform .2s ease;
}

.cmp-mobile-drawer.is-open {
	transform: translateX(0);
}

.cmp-drawer-head {
	min-height: 64px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 12px 10px 18px;
	border-bottom: 1px solid var(--cmp-line);
}

.cmp-drawer-title {
	overflow: hidden;
	font-weight: 800;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cmp-drawer-menu,
.cmp-nav-list,
.cmp-footer-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cmp-drawer-menu {
	padding: 8px;
}

.cmp-drawer-menu li {
	margin: 2px 0;
}

.cmp-drawer-menu a {
	display: flex;
	align-items: center;
	min-height: 48px;
	padding: 11px 13px;
	border-radius: 9px;
	color: var(--cmp-ink);
	font-weight: 650;
	text-decoration: none;
}

.cmp-drawer-menu a:hover,
.cmp-drawer-menu .current-menu-item > a {
	background: #edf4fb;
	color: var(--cmp-accent);
}

.cmp-main {
	min-height: calc(100vh - var(--cmp-header-height));
	padding: 14px 12px calc(var(--cmp-bottom-height) + 22px);
}

.cmp-content-shell {
	width: 100%;
	max-width: 1180px;
	margin-inline: auto;
}

.cmp-app-shell {
	width: 100%;
	max-width: none;
	margin: 0;
}

.cmp-entry {
	margin: 0;
}

.cmp-entry-header {
	margin: 4px 0 14px;
}

.cmp-entry-title {
	margin: 0;
	font-size: clamp(26px, 7vw, 42px);
	line-height: 1.15;
	letter-spacing: -.025em;
}

.cmp-entry-content > :first-child {
	margin-top: 0;
}

.cmp-entry-content > :last-child {
	margin-bottom: 0;
}

.cmp-entry-content h2,
.cmp-entry-content h3,
.cmp-entry-content h4 {
	line-height: 1.25;
	letter-spacing: -.015em;
}

.cmp-entry-content table {
	width: 100%;
	border-collapse: collapse;
}

.cmp-entry-content th,
.cmp-entry-content td {
	padding: 10px;
	border: 1px solid var(--cmp-line);
	text-align: left;
	vertical-align: top;
}

.cmp-entry-content th {
	background: #f0f3f6;
	font-weight: 750;
}

.cmp-entry-content figure,
.cmp-entry-content .wp-block-table {
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.cmp-dashboard {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.cmp-dashboard-card {
	min-height: 112px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
	padding: 16px;
	border: 1px solid var(--cmp-line);
	border-radius: var(--cmp-radius);
	background: var(--cmp-surface);
	box-shadow: 0 3px 12px rgba(20, 34, 48, .04);
	color: var(--cmp-ink);
	font-size: 15px;
	font-weight: 750;
	text-decoration: none;
}

.cmp-dashboard-card:hover {
	border-color: color-mix(in srgb, var(--cmp-accent) 50%, var(--cmp-line));
	box-shadow: var(--cmp-shadow);
	color: var(--cmp-accent);
	transform: translateY(-1px);
}

.cmp-dashboard-icon {
	width: 38px;
	height: 38px;
	display: grid;
	place-items: center;
	border-radius: 10px;
	background: #edf4fb;
	color: var(--cmp-accent);
}

.cmp-empty-state {
	max-width: 520px;
	margin: 10vh auto;
	padding: 28px;
	border: 1px solid var(--cmp-line);
	border-radius: var(--cmp-radius);
	background: var(--cmp-surface);
	text-align: center;
}

.cmp-site-footer {
	display: none;
}

.cmp-bottom-nav {
	position: fixed;
	z-index: 990;
	right: 0;
	bottom: 0;
	left: 0;
	height: calc(var(--cmp-bottom-height) + env(safe-area-inset-bottom));
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	padding: 5px 4px env(safe-area-inset-bottom);
	border-top: 1px solid var(--cmp-line);
	background: rgba(255, 255, 255, .98);
	box-shadow: 0 -8px 25px rgba(20, 34, 48, .07);
	backdrop-filter: blur(12px);
}

.cmp-bottom-link {
	min-width: 0;
	min-height: 54px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	padding: 4px 2px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--cmp-muted);
	font-size: 10px;
	font-weight: 700;
	line-height: 1.1;
	text-align: center;
	text-decoration: none;
}

.cmp-bottom-link svg {
	width: 22px;
	height: 22px;
}

.cmp-bottom-link span {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cmp-bottom-link:hover,
.cmp-bottom-link.is-active {
	background: #edf4fb;
	color: var(--cmp-accent);
}

/* App pages: remove theme padding and let plugin own the workspace. */
.cmp-app-page .cmp-main {
	padding: 0 0 calc(var(--cmp-bottom-height) + env(safe-area-inset-bottom));
}

.cmp-app-page .cmp-app-entry,
.cmp-app-page .cmp-entry-content {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}

/*
 * Compatibility layer for Cooper quotation/CRM plugins.
 * Scoped to app pages to avoid altering normal website content.
 */
.cmp-app-page .cmp-entry-content > div,
.cmp-app-page .cmp-entry-content > section,
.cmp-app-page .cmp-entry-content > form,
.cmp-app-page .crq-wrap,
.cmp-app-page .crq-app,
.cmp-app-page .crq-container,
.cmp-app-page .crx-app,
.cmp-app-page .crx-wrap,
.cmp-app-page .cooper-app,
.cmp-app-page #crq-app,
.cmp-app-page #crx-app {
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.cmp-app-page .crq-wrap,
.cmp-app-page .crq-app,
.cmp-app-page .crq-container,
.cmp-app-page .crx-app,
.cmp-app-page .crx-wrap,
.cmp-app-page .cooper-app,
.cmp-app-page #crq-app,
.cmp-app-page #crx-app {
	padding: 12px !important;
}

.cmp-app-page table {
	max-width: 100%;
}

.cmp-app-page .table-responsive,
.cmp-app-page .responsive-table,
.cmp-app-page .crq-table-wrap,
.cmp-app-page .crx-table-wrap,
.cmp-app-page .inventory-table-wrap,
.cmp-app-page .data-table-wrap {
	width: 100%;
	max-width: 100%;
	overflow-x: auto !important;
	-webkit-overflow-scrolling: touch;
}

.cmp-app-page input,
.cmp-app-page select,
.cmp-app-page textarea,
.cmp-app-page button {
	max-width: 100%;
}

.cmp-app-page .row,
.cmp-app-page .form-row,
.cmp-app-page .crq-row,
.cmp-app-page .crx-row {
	max-width: 100%;
}

.cmp-app-page [style*="min-width: 1100px"],
.cmp-app-page [style*="min-width:1100px"],
.cmp-app-page [style*="min-width: 980px"],
.cmp-app-page [style*="min-width:980px"] {
	min-width: 0 !important;
	max-width: 100% !important;
}

.cmp-app-page .modal,
.cmp-app-page [role="dialog"] {
	max-width: calc(100vw - 20px);
}

@media (max-width: 782px) {
	body.admin-bar .cmp-site-header {
		top: 46px;
	}

	.cmp-app-page .cmp-entry-content {
		overflow-x: clip;
	}

	.cmp-app-page .crq-grid,
	.cmp-app-page .crx-grid,
	.cmp-app-page .form-grid,
	.cmp-app-page .settings-grid {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) !important;
		gap: 10px !important;
	}

	.cmp-app-page .crq-actions,
	.cmp-app-page .form-actions,
	.cmp-app-page .action-buttons {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) !important;
		gap: 8px !important;
	}

	.cmp-app-page .crq-actions > *,
	.cmp-app-page .form-actions > *,
	.cmp-app-page .action-buttons > * {
		width: 100% !important;
		margin: 0 !important;
	}

	.cmp-app-page .tabs,
	.cmp-app-page .nav-tabs,
	.cmp-app-page .crq-tabs,
	.cmp-app-page .crx-tabs {
		display: flex !important;
		max-width: 100%;
		overflow-x: auto !important;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.cmp-app-page .tabs::-webkit-scrollbar,
	.cmp-app-page .nav-tabs::-webkit-scrollbar,
	.cmp-app-page .crq-tabs::-webkit-scrollbar,
	.cmp-app-page .crx-tabs::-webkit-scrollbar {
		display: none;
	}
}

@media (min-width: 783px) {
	body.admin-bar .cmp-site-header {
		top: 32px;
	}
}

@media (min-width: 900px) {
	:root {
		--cmp-header-height: 72px;
	}

	.cmp-header-inner {
		max-width: 1320px;
		margin-inline: auto;
		padding: 0 24px;
	}

	.cmp-brand .custom-logo {
		max-width: 230px;
		max-height: 48px;
	}

	.cmp-menu-button {
		display: none;
	}

	.cmp-desktop-nav {
		display: block;
		min-width: 0;
	}

	.cmp-nav-list {
		display: flex;
		align-items: center;
		gap: 4px;
	}

	.cmp-nav-list > li {
		position: relative;
	}

	.cmp-nav-list > li > a {
		display: flex;
		align-items: center;
		min-height: 42px;
		padding: 9px 12px;
		border-radius: 8px;
		color: var(--cmp-ink);
		font-size: 14px;
		font-weight: 680;
		text-decoration: none;
		white-space: nowrap;
	}

	.cmp-nav-list > li > a:hover,
	.cmp-nav-list > .current-menu-item > a {
		background: #edf4fb;
		color: var(--cmp-accent);
	}

	.cmp-main {
		padding: 28px 24px 48px;
	}

	.cmp-app-page .cmp-main {
		padding: 0;
	}

	.cmp-app-page .crq-wrap,
	.cmp-app-page .crq-app,
	.cmp-app-page .crq-container,
	.cmp-app-page .crx-app,
	.cmp-app-page .crx-wrap,
	.cmp-app-page .cooper-app,
	.cmp-app-page #crq-app,
	.cmp-app-page #crx-app {
		padding: 22px !important;
	}

	.cmp-dashboard {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 14px;
	}

	.cmp-dashboard-card {
		min-height: 140px;
		padding: 20px;
		font-size: 16px;
	}

	.cmp-bottom-nav {
		display: none;
	}

	.cmp-site-footer {
		display: block;
		border-top: 1px solid var(--cmp-line);
		background: var(--cmp-surface);
		color: var(--cmp-muted);
		font-size: 13px;
	}

	.cmp-app-page .cmp-site-footer {
		display: none;
	}

	.cmp-footer-inner {
		max-width: 1320px;
		min-height: 64px;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 20px;
		margin-inline: auto;
		padding: 12px 24px;
	}

	.cmp-footer-menu {
		display: flex;
		gap: 16px;
	}

	.cmp-footer-menu a {
		color: inherit;
		text-decoration: none;
	}
}

@media print {
	.cmp-site-header,
	.cmp-mobile-drawer,
	.cmp-drawer-backdrop,
	.cmp-bottom-nav,
	.cmp-site-footer {
		display: none !important;
	}

	body,
	.cmp-main,
	.cmp-app-page .cmp-main {
		margin: 0 !important;
		padding: 0 !important;
		background: #fff !important;
	}

	.cmp-app-page .crq-wrap,
	.cmp-app-page .crq-app,
	.cmp-app-page .crq-container,
	.cmp-app-page .crx-app,
	.cmp-app-page .crx-wrap {
		padding: 0 !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
	}
}


/* Homepage */
.cmp-home-shell {
	max-width: 1200px;
}

.cmp-home-hero {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 18px;
	border: 1px solid var(--cmp-line);
	border-radius: 18px;
	background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
	box-shadow: 0 10px 30px rgba(20, 34, 48, .05);
}

.cmp-home-label {
	align-self: flex-start;
	padding: 8px 12px;
	border-radius: 999px;
	background: #edf4fb;
	color: var(--cmp-accent);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.cmp-home-title {
	margin: 0;
	font-size: clamp(28px, 8vw, 52px);
	line-height: 1.05;
	letter-spacing: -.03em;
}

.cmp-home-subtitle {
	max-width: 650px;
	margin: 0;
	color: var(--cmp-muted);
	font-size: 16px;
}

.cmp-home-actions {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
}

.cmp-home-action {
	min-height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 16px;
	border-radius: 12px;
	font-weight: 800;
	text-decoration: none;
}

.cmp-home-action.is-primary {
	background: var(--cmp-accent);
	color: #fff;
}

.cmp-home-action.is-secondary {
	background: #edf4fb;
	color: var(--cmp-accent);
}

.cmp-home-points {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
	margin-top: 14px;
}

.cmp-home-point {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 16px;
	border: 1px solid var(--cmp-line);
	border-radius: 14px;
	background: var(--cmp-surface);
}

.cmp-home-point strong {
	font-size: 15px;
}

.cmp-home-point span {
	color: var(--cmp-muted);
	font-size: 14px;
}

.cmp-home-section {
	margin-top: 18px;
}

.cmp-home-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

.cmp-home-tile {
	display: grid;
	grid-template-columns: 52px minmax(0, 1fr);
	align-items: center;
	gap: 14px;
	padding: 16px;
	border: 1px solid var(--cmp-line);
	border-radius: 16px;
	background: var(--cmp-surface);
	box-shadow: 0 4px 16px rgba(20, 34, 48, .04);
	color: var(--cmp-ink);
	text-decoration: none;
}

.cmp-home-tile:hover {
	border-color: color-mix(in srgb, var(--cmp-accent) 35%, var(--cmp-line));
	box-shadow: var(--cmp-shadow);
	transform: translateY(-1px);
}

.cmp-home-tile-icon {
	width: 52px;
	height: 52px;
	display: grid;
	place-items: center;
	border-radius: 14px;
	background: #edf4fb;
	color: var(--cmp-accent);
}

.cmp-home-tile-icon svg {
	width: 26px;
	height: 26px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.cmp-home-tile-head {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cmp-home-tile-title {
	font-size: 17px;
	font-weight: 800;
	color: var(--cmp-ink);
}

.cmp-home-tile-text {
	color: var(--cmp-muted);
	font-size: 14px;
}

.cmp-home-tile-button {
	grid-column: 1 / -1;
	margin-top: 2px;
	padding-top: 12px;
	border-top: 1px solid #eef2f5;
	color: var(--cmp-accent);
	font-size: 13px;
	font-weight: 800;
}

@media (min-width: 680px) {
	.cmp-home-actions,
	.cmp-home-points {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

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

@media (min-width: 900px) {
	.cmp-home-hero {
		padding: 26px;
	}

	.cmp-home-actions {
		display: flex;
		flex-wrap: wrap;
	}

	.cmp-home-action {
		min-width: 170px;
	}

	.cmp-home-points {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.cmp-home-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.cmp-home-tile {
		grid-template-columns: 52px minmax(0, 1fr);
		align-items: start;
		min-height: 188px;
	}

	.cmp-home-tile-button {
		align-self: end;
	}
}
