/**
 * MyDoorling HubSpot — interface admin
 *
 * Style « application » : cartes, en-têtes, accents type HubSpot,
 * tout en restant dans l’écosystème WordPress admin.
 */

body.mdl-hs-admin-screen {
	--mdl-hs-accent: #ff4800;
	--mdl-hs-accent-mid: #ff7a45;
	--mdl-hs-accent-soft: rgba(255, 72, 0, 0.14);
	--mdl-hs-accent-hover: #e64200;
	--mdl-hs-surface: #fff;
	--mdl-hs-surface-2: #f4f6f8;
	--mdl-hs-border: rgba(15, 23, 42, 0.09);
	--mdl-hs-text: #0f172a;
	--mdl-hs-text-muted: #64748b;
	--mdl-hs-radius: 14px;
	--mdl-hs-radius-sm: 9px;
	--mdl-hs-shadow:
		0 1px 2px rgba(15, 23, 42, 0.05),
		0 10px 40px rgba(15, 23, 42, 0.06);
	--mdl-hs-font:
		system-ui,
		-apple-system,
		"Segoe UI",
		Roboto,
		"Helvetica Neue",
		Arial,
		sans-serif;
}

body.mdl-hs-admin-screen #wpbody-content {
	background-image:
		radial-gradient(ellipse 100% 90% at 100% 0%, rgba(255, 72, 0, 0.07), transparent 52%),
		radial-gradient(ellipse 70% 50% at 0% 80%, rgba(14, 165, 233, 0.05), transparent 50%);
	background-attachment: fixed;
}

.mdl-hs-wrap.mdl-hs-ui {
	font-family: var(--mdl-hs-font);
	max-width: 1180px;
	padding-bottom: 2.5rem;
	color: var(--mdl-hs-text);
}

.mdl-hs-wrap.mdl-hs-ui > .notice {
	border-radius: var(--mdl-hs-radius-sm);
	border-left-width: 4px;
}

/* ---------- En-tête de page ---------- */

.mdl-hs-page-head {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	column-gap: 1rem;
	row-gap: 0;
	margin: 0 0 1.35rem;
	padding: 1.35rem 1.5rem;
	background: var(--mdl-hs-surface);
	border: 1px solid var(--mdl-hs-border);
	border-radius: var(--mdl-hs-radius);
	box-shadow: var(--mdl-hs-shadow);
}

.mdl-hs-page-head--compact {
	padding: 1rem 1.25rem;
}

/* Colonne centrale : bloc orb+titre comme une unité, puis tagline */
.mdl-hs-page-head__brand {
	grid-column: 2;
	justify-self: center;
	align-self: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	min-width: 0;
	text-align: center;
}

/* Orb + H1 sur une seule ligne, alignés verticalement entre eux */
.mdl-hs-page-head__title-line {
	display: inline-flex;
	align-items: center;
	gap: 1rem;
	max-width: 100%;
	margin: 0;
	padding: 0;
}

.mdl-hs-page-head__title-line .mdl-hs-orb {
	flex-shrink: 0;
}

.mdl-hs-page-head__brand h1 {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 1.45rem;
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 1.2;
	color: var(--mdl-hs-text);
	border: none !important;
	border-bottom: none !important;
	box-shadow: none !important;
	background: transparent;
	text-decoration: none;
}

body.mdl-hs-admin-screen .mdl-hs-wrap.mdl-hs-ui .mdl-hs-page-head .mdl-hs-page-head__brand h1 {
	margin: 0 !important;
	padding-bottom: 0 !important;
	padding-top: 0 !important;
	border-bottom: none !important;
}

.mdl-hs-wrap.mdl-hs-ui .mdl-hs-page-head h1::after,
.mdl-hs-wrap.mdl-hs-ui .mdl-hs-page-head h1::before {
	content: none;
	display: none;
}

.mdl-hs-page-head--compact .mdl-hs-page-head__brand h1 {
	font-size: 1.2rem;
}

.mdl-hs-page-head__brand .mdl-hs-page-head__tagline {
	margin: 0 !important;
	max-width: 36rem;
}

.mdl-hs-page-head__tagline {
	padding: 0;
	font-size: 0.9rem;
	line-height: 1.45;
	color: var(--mdl-hs-text-muted);
	max-width: 36rem;
	border: none;
	box-shadow: none;
}

.mdl-hs-page-head__actions {
	grid-column: 3;
	justify-self: end;
	align-self: center;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-shrink: 0;
	margin: 0;
	padding: 0;
}

/* Marque orb (signature visuelle) */

.mdl-hs-orb {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 15px;
	background: linear-gradient(145deg, var(--mdl-hs-accent) 0%, var(--mdl-hs-accent-mid) 48%, #ffc9a8 100%);
	box-shadow:
		0 6px 18px rgba(255, 72, 0, 0.38),
		inset 0 1px 0 rgba(255, 255, 255, 0.45);
	position: relative;
}

.mdl-hs-orb::after {
	content: "";
	position: absolute;
	inset: 11px;
	border-radius: 9px;
	border: 2px solid rgba(255, 255, 255, 0.55);
	pointer-events: none;
}

.mdl-hs-orb--sm {
	width: 38px;
	height: 38px;
	border-radius: 11px;
}

.mdl-hs-orb--sm::after {
	inset: 9px;
	border-width: 1.5px;
	border-radius: 6px;
}

/* Bouton primaire (liste / ajout) */

.mdl-hs-wrap.mdl-hs-ui .page-title-action.mdl-hs-btn-primary {
	border-radius: var(--mdl-hs-radius-sm) !important;
	padding: 0.4rem 1rem !important;
	height: auto !important;
	line-height: 1.45 !important;
	font-weight: 600 !important;
	background: linear-gradient(180deg, var(--mdl-hs-accent) 0%, var(--mdl-hs-accent-hover) 100%) !important;
	border: none !important;
	color: #fff !important;
	box-shadow: 0 3px 12px rgba(255, 72, 0, 0.34);
	text-shadow: none;
}

.mdl-hs-wrap.mdl-hs-ui .page-title-action.mdl-hs-btn-primary:hover,
.mdl-hs-wrap.mdl-hs-ui .page-title-action.mdl-hs-btn-primary:focus {
	color: #fff !important;
	filter: brightness(1.06);
	box-shadow: 0 4px 16px rgba(255, 72, 0, 0.4);
}

/* ---------- Panneaux ---------- */

.mdl-hs-panel {
	margin-bottom: 1.25rem;
	background: var(--mdl-hs-surface);
	border: 1px solid var(--mdl-hs-border);
	border-radius: var(--mdl-hs-radius);
	box-shadow: var(--mdl-hs-shadow);
	overflow: hidden;
}

.mdl-hs-panel__head {
	padding: 1rem 1.35rem 0.85rem;
	border-bottom: 1px solid var(--mdl-hs-border);
	background: linear-gradient(180deg, var(--mdl-hs-surface-2) 0%, var(--mdl-hs-surface) 100%);
}

.mdl-hs-panel__title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 650;
	letter-spacing: -0.02em;
	color: var(--mdl-hs-text);
}

.mdl-hs-panel__lead.description {
	margin: 0.55rem 0 0 !important;
	padding: 0 !important;
	max-width: 52rem;
	color: var(--mdl-hs-text-muted);
	font-size: 0.9rem;
	line-height: 1.5;
}

.mdl-hs-panel__body {
	padding: 1.1rem 1.35rem 1.35rem;
}

.mdl-hs-panel__body--flush {
	padding: 0;
}

.mdl-hs-panel .form-table {
	margin-top: 0;
}

.mdl-hs-panel .form-table th {
	padding-left: 0;
	width: 230px;
	font-weight: 600;
	color: var(--mdl-hs-text);
}

.mdl-hs-panel .form-table td {
	padding-right: 0;
}

.mdl-hs-form-actions {
	margin-top: 0.25rem;
}

.mdl-hs-form-actions .button-primary {
	border-radius: var(--mdl-hs-radius-sm);
	padding: 0.35rem 1.35rem;
	font-weight: 600;
	background: linear-gradient(180deg, var(--mdl-hs-accent) 0%, var(--mdl-hs-accent-hover) 100%);
	border-color: var(--mdl-hs-accent-hover);
	box-shadow: 0 3px 12px rgba(255, 72, 0, 0.28);
	text-shadow: none;
}

.mdl-hs-form-actions .button-primary:hover,
.mdl-hs-form-actions .button-primary:focus {
	filter: brightness(1.05);
	border-color: var(--mdl-hs-accent-hover);
}

.mdl-hs-back-link {
	margin-top: 1.25rem;
}

.mdl-hs-link-back {
	font-weight: 500;
	color: var(--mdl-hs-text-muted);
	text-decoration: none;
	transition: color 0.15s ease;
}

.mdl-hs-link-back:hover {
	color: var(--mdl-hs-accent);
}

/* Interrupteurs (liste flux, objets synchronisés, actif) */

.mdl-hs-switch {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	margin: 0;
	cursor: pointer;
	vertical-align: middle;
	user-select: none;
}

.mdl-hs-switch input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.mdl-hs-switch-track {
	position: relative;
	flex-shrink: 0;
	box-sizing: border-box;
	width: 2.75rem;
	height: 1.5rem;
	border-radius: 999px;
	background: #cbd5e1;
	transition:
		background 0.2s ease,
		box-shadow 0.15s ease;
}

.mdl-hs-switch-thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: calc(1.5rem - 4px);
	height: calc(1.5rem - 4px);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
	transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mdl-hs-switch input:checked + .mdl-hs-switch-track {
	background: var(--mdl-hs-accent);
}

.mdl-hs-switch input:checked + .mdl-hs-switch-track .mdl-hs-switch-thumb {
	transform: translateX(1.25rem);
}

.mdl-hs-switch input:focus-visible + .mdl-hs-switch-track {
	outline: 2px solid var(--mdl-hs-accent);
	outline-offset: 2px;
}

.mdl-hs-switch input:disabled + .mdl-hs-switch-track {
	opacity: 0.5;
	cursor: not-allowed;
}

.mdl-hs-switch:has(input:disabled) {
	cursor: not-allowed;
}

.mdl-hs-switch--with-label {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0.75rem;
	max-width: 42rem;
}

.mdl-hs-switch-label {
	font-weight: 500;
	line-height: 1.35;
	color: var(--mdl-hs-text);
}

.mdl-hs-switch--table {
	justify-content: center;
}

/* Ligne « Objets HubSpot » : une ligne par interrupteur */

.mdl-hs-sync-targets {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.65rem;
	border: none;
	padding: 0;
	margin: 0;
	min-width: 0;
}

.mdl-hs-sync-targets br {
	display: none;
}

.mdl-hs-sync-targets .mdl-hs-switch--contact input:checked + .mdl-hs-switch-track {
	background: #6366f1;
}

.mdl-hs-sync-targets .mdl-hs-switch--deal input:checked + .mdl-hs-switch-track {
	background: var(--mdl-hs-accent);
}

.mdl-hs-sync-targets .mdl-hs-switch--hs-order input:checked + .mdl-hs-switch-track {
	background: #0ea5e9;
}

.mdl-hs-col-active {
	text-align: center;
	width: 6rem;
}

.mdl-hs-data-table thead th.mdl-hs-col-active {
	text-align: center;
}

/* Champs */

.mdl-hs-wrap.mdl-hs-ui .regular-text,
.mdl-hs-wrap.mdl-hs-ui .large-text,
.mdl-hs-wrap.mdl-hs-ui select,
.mdl-hs-wrap.mdl-hs-ui textarea {
	border-radius: var(--mdl-hs-radius-sm);
}

.mdl-hs-wrap.mdl-hs-ui select {
	min-height: 2.25rem;
}

/* ---------- Tableaux listés ---------- */

.mdl-hs-panel--table .mdl-hs-data-table.widefat {
	border: none;
	box-shadow: none;
	border-radius: 0;
}

.mdl-hs-data-table.widefat thead th {
	font-weight: 650;
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.055em;
	color: var(--mdl-hs-text-muted);
	padding: 0.95rem 1.15rem;
	border-bottom: 1px solid var(--mdl-hs-border);
}

.mdl-hs-data-table.widefat tbody td {
	padding: 0.85rem 1.15rem;
	vertical-align: middle;
	border-top-color: var(--mdl-hs-border);
}

.mdl-hs-data-table.widefat tbody tr:hover td {
	background: rgba(255, 72, 0, 0.045);
}


/* ---------- Badges journal ---------- */

.mdl-hs-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.22rem 0.6rem;
	border-radius: 999px;
	font-size: 0.74rem;
	font-weight: 650;
	line-height: 1.2;
}

.mdl-hs-badge--success {
	background: rgba(34, 197, 94, 0.16);
	color: #166534;
}

.mdl-hs-badge--error {
	background: rgba(239, 68, 68, 0.14);
	color: #b91c1c;
}

.mdl-hs-chip {
	display: inline-block;
	padding: 0.18rem 0.55rem;
	border-radius: 7px;
	font-size: 0.78rem;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	background: var(--mdl-hs-surface-2);
	border: 1px solid var(--mdl-hs-border);
	color: var(--mdl-hs-text-muted);
}

.mdl-hs-muted {
	color: var(--mdl-hs-text-muted);
	font-size: 0.86rem;
}

.mdl-hs-log-table .column-note,
.mdl-hs-log-table td:nth-child(7) {
	max-width: 220px;
	word-break: break-word;
}

/* ---------- Mapping ---------- */

.mdl-hs-map-shell {
	overflow-x: auto;
	max-width: 100%;
	-webkit-overflow-scrolling: touch;
}

.mdl-hs-wrap .widefat.mdl-hs-map {
	table-layout: fixed;
	width: 100%;
	min-width: 36rem;
	border-collapse: collapse;
	border-radius: var(--mdl-hs-radius-sm);
	overflow: hidden;
	border: 1px solid var(--mdl-hs-border);
}

.mdl-hs-map col.mdl-hs-map-col-hubspot {
	width: 34%;
}

.mdl-hs-map col.mdl-hs-map-col-type {
	width: 11rem;
}

.mdl-hs-map col.mdl-hs-map-col-value {
	width: auto;
}

.mdl-hs-map col.mdl-hs-map-col-actions {
	width: 6rem;
}

.mdl-hs-wrap .mdl-hs-map th,
.mdl-hs-wrap .mdl-hs-map td {
	vertical-align: top;
	padding: 10px 12px;
	min-width: 0;
}

.mdl-hs-wrap .mdl-hs-map th {
	overflow-wrap: anywhere;
	line-height: 1.35;
	font-weight: 600;
}

.mdl-hs-wrap .mdl-hs-map td {
	overflow: hidden;
}

.mdl-hs-wrap .mdl-hs-map select.mdl-hs-crm-select,
.mdl-hs-wrap .mdl-hs-map select.mdl-hs-map-type,
.mdl-hs-wrap .mdl-hs-map select.mdl-hs-woo-select {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.mdl-hs-wrap .mdl-hs-map select.mdl-hs-woo-concat {
	width: 100%;
	max-width: 100%;
	min-width: 12rem;
	box-sizing: border-box;
}

.mdl-hs-wrap .mdl-hs-map .mdl-hs-woo-concat-sep-label {
	display: inline-block;
	margin-top: 0.5rem;
	vertical-align: middle;
}

.mdl-hs-wrap .mdl-hs-map textarea.mdl-hs-custom-val {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
	display: block;
}

.mdl-hs-wrap .mdl-hs-map-col-actions {
	width: 6rem;
	text-align: right;
	white-space: nowrap;
	vertical-align: middle;
}

.mdl-hs-map-add-wrap {
	margin-top: 12px;
}

.mdl-hs-map-add-wrap .button,
.mdl-hs-map .button-link {
	border-radius: var(--mdl-hs-radius-sm);
}

.mdl-hs-map .button-link {
	color: var(--mdl-hs-accent);
	font-weight: 600;
}

.mdl-hs-map .button-link:hover {
	color: var(--mdl-hs-accent-hover);
}

/* ---------- Statuts Woo (scroll) ---------- */

.mdl-hs-wc-status-scroll {
	max-height: 16rem;
	overflow: auto;
	padding: 10px 12px;
	margin-top: 8px;
	border: 1px solid var(--mdl-hs-border);
	border-radius: var(--mdl-hs-radius-sm);
	background: var(--mdl-hs-surface-2);
}

.mdl-hs-wc-status-label code {
	margin-left: 0.35rem;
	font-size: 0.76rem;
	opacity: 0.85;
}

.mdl-hs-nested-table.form-table {
	margin: 0 !important;
	width: 100%;
}

.mdl-hs-wrap.mdl-hs-ui fieldset label {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-bottom: 0.5rem;
}

/* ---------- Responsive ---------- */

@media screen and (max-width: 782px) {
	.mdl-hs-page-head {
		display: flex;
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.mdl-hs-page-head__brand {
		grid-column: auto;
		justify-self: center;
	}

	.mdl-hs-page-head__tagline {
		max-width: none;
	}

	.mdl-hs-page-head__actions {
		grid-column: auto;
		justify-self: stretch;
		width: 100%;
		justify-content: center;
		flex-wrap: wrap;
	}

	.mdl-hs-page-head__actions .page-title-action {
		text-align: center;
		justify-content: center;
	}

	.mdl-hs-panel .form-table th {
		width: auto;
		padding-bottom: 0.25rem;
	}
}
