

.wrap {
	max-width: 1400px;
	margin-left: auto;
	margin-right: auto;
	padding-right: 20px;
}

.notice {
	width: min(1400px, 100% - 20px);
	margin-inline: max(0px, (100% - 1400px - 20px) / 2);
	margin-inline-end: auto;
	box-sizing: border-box;
}

.wrap .notice {
	width: 100%;
}

/* ==========================================================================
   List tables — force auto layout
   ========================================================================== */
/*
 * WP's default `.widefat.fixed` classing (applied by WP_List_Table unless a
 * subclass overrides get_table_classes()) locks column widths to whatever the
 * browser computes on the first layout pass. With several columns and no
 * explicit widths declared anywhere, that pass can pin some columns (e.g. the
 * primary "Name" column) to 0px, forcing their content to wrap one character
 * per line. Auto layout lets the browser size columns from actual content on
 * every row instead of freezing an initial guess.
 */
.wp-list-table.fixed {
	table-layout: auto;
}



/* ==========================================================================
   Header
   ========================================================================== */

.ambh-admin-header {
	background: linear-gradient( 135deg, #1d2327 0%, #2c3338 100% );
	color: #fff;
	border-radius: 8px;
	width: min(1400px, 100% - 20px);
	margin-inline: max(0px, (100% - 1400px - 20px) / 2);
	margin-inline-end: auto;
}

.ambh-admin-header__inner {
	display: flex;
	padding: 28px 32px;
	margin: 16px 0 28px;
	align-items: center;
	gap: 16px;
}

.ambh-admin-header__logo-icon {
	width: 40px;
	height: 40px;
	flex-shrink: 0;
}

.ambh-admin-header__text {
	flex: 1;
}

.ambh-admin-header .ambh-admin-header__title {
	margin: 0 0 4px;
	font-size: 22px;
	font-weight: 700;
	color: #fff;
	line-height: 1.2;
}

.ambh-admin-header__subtitle {
	margin: 0;
	font-size: 13px;
	color: #a7aaad;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.ambh-dashboard {
	max-width: 1400px;
	margin-left: auto;
	margin-right: auto;
}

.ambh-dashboard__section {
	margin-bottom: 50px;
}

.ambh-dashboard__section-title {
	font-size: 15px;
	font-weight: 600;
	color: #1d2327;
	margin: 0 0 14px;
}

.ambh-dashboard__graph {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 20px 18px 16px;
	height:300px;
}

.ambh-dashboard__section-title--no-margin {
	margin-bottom: 0;
}

/* ==========================================================================
   KPI cards
   ========================================================================== */

.ambh-kpi-grid {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 16px;
}

.ambh-kpi-card {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 20px 18px 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	position: relative;
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.ambh-kpi-card:hover {
	border-color: var(--wp-admin-theme-color);
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.08 );
}

.ambh-kpi-card__icon {
	font-size: 24px;
	width: 24px;
	height: 24px;
	color: var(--wp-admin-theme-color);
}

.ambh-kpi-card__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ambh-kpi-card__value {
	font-size: 32px;
	font-weight: 700;
	color: #1d2327;
	line-height: 1.1;
}

.ambh-kpi-card__label {
	font-size: 12px;
	color: #646970;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.ambh-kpi-card__link {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	font-size: 12px;
	font-weight: 600;
	color: var(--wp-admin-theme-color);
	text-decoration: none;
	margin-top: auto;
}

.ambh-kpi-card__link:hover {
	color: var(--wp-admin-theme-color-darker-10);
	text-decoration: underline;
}

.ambh-kpi-card__link .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

/* ==========================================================================
   Setup checklist
   ========================================================================== */

.ambh-setup-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.ambh-setup-header__actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ambh-setup-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	background: transparent;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	cursor: pointer;
	color: #646970;
	transition: background 0.1s ease, color 0.1s ease;
}

.ambh-setup-toggle:hover {
	background: #f0f0f1;
	color: #1d2327;
}

.ambh-setup-toggle .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.ambh-setup-section.is-collapsed .ambh-progress,
.ambh-setup-section.is-collapsed .ambh-setup-list {
	display: none;
}

.ambh-setup-section.is-collapsed .ambh-setup-header {
	margin-bottom: 0;
}

.ambh-setup-header__sub {
	margin: 4px 0 0;
	font-size: 12px;
	color: #646970;
}

.ambh-setup-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: color-mix( in srgb, var(--wp-admin-theme-color) 10%, #fff );
	color: var(--wp-admin-theme-color);
	font-size: 12px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 20px;
	border: 1px solid color-mix( in srgb, var(--wp-admin-theme-color) 35%, #fff );
	white-space: nowrap;
}

.ambh-setup-badge--done {
	background: #edfaef;
	color: #1a7928;
	border-color: #b8e6be;
}

.ambh-setup-badge--done .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

/* Progress bar */
.ambh-progress {
	height: 6px;
	background: #f0f0f1;
	border-radius: 3px;
	overflow: hidden;
	margin-bottom: 16px;
}

.ambh-progress__bar {
	height: 100%;
	background: linear-gradient(
		90deg,
		var(--wp-admin-theme-color),
		color-mix( in srgb, var(--wp-admin-theme-color) 55%, #fff )
	);
	border-radius: 3px;
	transition: width 0.4s ease;
}

/* Step list */
.ambh-setup-list {
	margin: 0;
	padding: 0;
	list-style: none;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	overflow: hidden;
}

.ambh-setup-step {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	border-bottom: 1px solid #f0f0f1;
	transition: background 0.1s ease;
	margin-bottom: 0;
}

.ambh-setup-step:last-child {
	border-bottom: none;
}

.ambh-setup-step:hover {
	background: #f9f9f9;
}

.ambh-setup-step__icon {
	font-size: 20px;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

.ambh-setup-step.is-done .ambh-setup-step__icon {
	color: #1a7928;
}

.ambh-setup-step.is-pending .ambh-setup-step__icon {
	color: #c3c4c7;
}

.ambh-setup-step__content {
	flex: 1;
	min-width: 0;
}

.ambh-setup-step__title {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
}

.ambh-setup-step.is-done .ambh-setup-step__title {
	color: #1a7928;
}

.ambh-setup-step__desc {
	display: block;
	font-size: 12px;
	color: #646970;
	margin-top: 2px;
}

.ambh-setup-step__action {
	flex-shrink: 0;
}

/* ==========================================================================
   Header – Add New action button (dark header variant)
   ========================================================================== */

.ambh-header__add-new {
	display: inline-flex;
	align-items: center;
	padding: 7px 14px;
	border: 2px solid rgba( 255, 255, 255, 0.55 );
	border-radius: 4px;
	color: #fff;
	background: transparent;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	flex-shrink: 0;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.ambh-header__add-new:hover {
	background: rgba( 255, 255, 255, 0.12 );
	border-color: #fff;
	color: #fff;
}

/* ==========================================================================
   Hide default elements
   ========================================================================== */

.wrap h1.wp-heading-inline, .wrap .page-title-action, .wrap .wp-header-end {
	display: none;
}


/* ==========================================================================
   Campaign Settings — WooCommerce-style tabbed meta box
   ========================================================================== */

.post-type-ambh_campaign #ambh-campaign-data .inside,
.block-editor-page #ambh-campaign-data .inside {
	margin: 0;
	padding: 0;
}

.ambh-campaign-data-wrap {
	display: flex;
	min-height: 320px;
}

.ambh-campaign-tabs {
	list-style: none;
	margin: 0;
	padding: 8px 0;
	width: 176px;
	min-width: 176px;
	background: #f6f7f7;
	border-right: 1px solid #dcdcde;
}

.ambh-campaign-tab {
	margin: 0;
	padding: 0;
}

.ambh-campaign-tab a {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 9px 12px;
	font-size: 13px;
	color: #50575e;
	text-decoration: none;
	border-left: 3px solid transparent;
	line-height: 1.4;
	transition: background 0.1s ease, color 0.1s ease;
}

.ambh-campaign-tab a:hover,
.ambh-campaign-tab a:focus {
	background: #f0f0f1;
	color: #1d2327;
	outline: none;
	box-shadow: none;
}

.ambh-campaign-tab.active a {
	background: #fff;
	color: var( --wp-admin-theme-color );
	border-left-color: var( --wp-admin-theme-color );
	font-weight: 600;
	/* Flush white panel against the right border */
	margin-right: -1px;
	border-right: 1px solid #fff;
}

.ambh-campaign-tab .dashicons {
	font-size: 17px;
	width: 17px;
	height: 17px;
	flex-shrink: 0;
}

.ambh-campaign-tab-panels {
	flex: 1;
	padding: 16px 20px;
	min-width: 0;
	background: #fff;
}

.ambh-campaign-tab-panel {
	display: none;
}

.ambh-campaign-tab-panel.active {
	display: block;
}

.ambh-tab-divider {
	border: none;
	border-top: 1px solid #f0f0f1;
	margin: 18px 0;
}

/* ==========================================================================
   Status pill — generic reusable badge
   ========================================================================== */

.ambh-status-pill {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 500;
}

.ambh-status-pill--green { background: #d4edda; color: #155724; }
.ambh-status-pill--grey  { background: #f0f0f1; color: #646970; }
.ambh-status-pill--red   { background: #f8d7da; color: #721c24; }

/* ==========================================================================
   Settings page — two-column layout (moved from the orphaned, never-enqueued
   src/Admin/Settings/assets/settings.css so it actually loads)
   ========================================================================== */


/* ── Two-column layout: section nav (left) + settings panel (right) ─────── */

.ambh-settings-layout {
	display: flex;
	align-items: flex-start;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	overflow: hidden;
	margin-top: 16px;
}

.ambh-settings-nav {
	flex: 0 0 200px;
	width: 200px;
	box-sizing: border-box;
	padding: 12px 0;
	background: #f6f7f7;
	border-right: 1px solid #dcdcde;
	align-self: stretch;
}

.ambh-settings-nav__item {
	display: block;
	padding: 10px 20px;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	color: #1d2327;
	text-decoration: none;
	border-left: 3px solid transparent;
	box-sizing: border-box;
}

.ambh-settings-nav__item:hover,
.ambh-settings-nav__item:focus {
	background: #fff;
	color: #2271b1;
}

.ambh-settings-nav__item.is-active {
	background: #fff;
	color: #2271b1;
	font-weight: 600;
	border-left-color: #2271b1;
}

/* ── Content wrapper ──────────────────────────────────────────────────── */

.ambassadorhub-settings-content {
	flex: 1 1 auto;
	min-width: 0;
	background: #fff;
	padding: 28px 32px;
	box-sizing: border-box;
}

.ambassadorhub-settings-content form {
	max-width: 100%;
}

/* ── Field help tooltip ───────────────────────────────────────────────── */
/* Replaces the old <p class="description"> block below each field: a small
   help icon next to the label reveals the explanation on hover/focus, kept
   in the accessibility tree (opacity, not visibility) so aria-describedby
   still reaches it for screen reader users who tab into the field itself. */

.ambh-help-tip {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-left: 4px;
	color: #787c82;
	cursor: help;
	vertical-align: middle;
}

.ambh-help-tip .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
}

.ambh-help-tip:hover,
.ambh-help-tip:focus {
	color: var(--wp-admin-theme-color, #2271b1);
	outline: none;
}

.ambh-help-tip__bubble {
	opacity: 0;
	pointer-events: none;
	position: absolute;
	z-index: 10;
	top: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	width: 260px;
	background: #1e1e1e;
	color: #fff;
	font-size: 12.5px;
	font-weight: 400;
	line-height: 1.5;
	padding: 10px 12px;
	border-radius: 6px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	transition: opacity 0.15s ease;
}

.ambh-help-tip__bubble::before {
	content: '';
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-bottom-color: #1e1e1e;
}

.ambh-help-tip:hover .ambh-help-tip__bubble,
.ambh-help-tip:focus .ambh-help-tip__bubble {
	opacity: 1;
}

@media screen and (max-width: 782px) {
	.ambh-settings-layout {
		flex-direction: column;
	}

	.ambh-settings-nav {
		flex: none;
		width: 100%;
		display: flex;
		overflow-x: auto;
		border-right: none;
		border-bottom: 1px solid #dcdcde;
		padding: 0;
	}

	.ambh-settings-nav__item {
		flex: 0 0 auto;
		white-space: nowrap;
		border-left: none;
		border-bottom: 3px solid transparent;
	}

	.ambh-settings-nav__item.is-active {
		border-left-color: transparent;
		border-bottom-color: #2271b1;
	}
}

/* ── Shared form-table scope ──────────────────────────────────────────── */
/*
 * Applies to forms both inside the main settings content area AND inside
 * the PSP connector settings panels (.ambh-psp-settings-panel).
 */

.ambassadorhub-settings-content .form-table,
.ambh-psp-settings-panel .form-table {
	margin-top: 0;
	border-collapse: collapse;
	width: 100%;
	/* Fixed layout: each section renders its own <table>, so without this the
	   label column width is computed per-table (based on that table's longest
	   label) and drifts between sections/tabs. Fixed layout makes every
	   form-table's label column exactly the same width, everywhere. */
	table-layout: fixed;
}

.ambassadorhub-settings-content .form-table th,
.ambh-psp-settings-panel .form-table th {
	width: 200px;
	padding: 12px 20px 12px 0;
	vertical-align: top;
	text-align: left;
	font-weight: 600;
	font-size: 13px;
	color: #1d2327;
	/* No nowrap: with a fixed-width column, a long label should wrap onto a
	   second line rather than overflow past the column edge. */
}

.ambassadorhub-settings-content .form-table td,
.ambh-psp-settings-panel .form-table td {
	padding: 10px 0;
	vertical-align: top;
}

/* ── Inputs, selects, textareas ───────────────────────────────────────── */

.ambassadorhub-settings-content .form-table input[type="text"],
.ambassadorhub-settings-content .form-table input[type="email"],
.ambassadorhub-settings-content .form-table input[type="url"],
.ambassadorhub-settings-content .form-table input[type="number"],
.ambassadorhub-settings-content .form-table input[type="password"],
.ambassadorhub-settings-content .form-table textarea,
.ambassadorhub-settings-content .form-table select,
.ambh-psp-settings-panel .form-table input[type="text"],
.ambh-psp-settings-panel .form-table input[type="email"],
.ambh-psp-settings-panel .form-table input[type="url"],
.ambh-psp-settings-panel .form-table input[type="number"],
.ambh-psp-settings-panel .form-table input[type="password"],
.ambh-psp-settings-panel .form-table textarea,
.ambh-psp-settings-panel .form-table select {
	width: 100%;
	max-width: 100%;
	padding: 8px 10px;
	border: 1px solid #8c8f94;
	border-radius: 3px;
	font-size: 13px;
	line-height: 1.5;
	color: #1d2327;
	background-color: #fff;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, .07);
	transition: border-color 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
	box-sizing: border-box;
}

/* Override WP's .regular-text fixed width so our width rule wins */
.ambassadorhub-settings-content .form-table input.regular-text,
.ambh-psp-settings-panel .form-table input.regular-text {
	width: 100%;
}

/* Keep the label column from shrinking when input columns stretch full-width. */
.ambassadorhub-settings-content .form-table td,
.ambh-psp-settings-panel .form-table td {
	width: auto;
}

.ambassadorhub-settings-content .form-table input[type="text"]:focus,
.ambassadorhub-settings-content .form-table input[type="email"]:focus,
.ambassadorhub-settings-content .form-table input[type="url"]:focus,
.ambassadorhub-settings-content .form-table input[type="number"]:focus,
.ambassadorhub-settings-content .form-table input[type="password"]:focus,
.ambassadorhub-settings-content .form-table textarea:focus,
.ambassadorhub-settings-content .form-table select:focus,
.ambh-psp-settings-panel .form-table input[type="text"]:focus,
.ambh-psp-settings-panel .form-table input[type="email"]:focus,
.ambh-psp-settings-panel .form-table input[type="url"]:focus,
.ambh-psp-settings-panel .form-table input[type="number"]:focus,
.ambh-psp-settings-panel .form-table input[type="password"]:focus,
.ambh-psp-settings-panel .form-table textarea:focus,
.ambh-psp-settings-panel .form-table select:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
}

.ambassadorhub-settings-content .form-table textarea,
.ambh-psp-settings-panel .form-table textarea {
	min-height: 100px;
	font-family: monospace;
	font-size: 13px;
	resize: vertical;
}

.ambassadorhub-settings-content .form-table select,
.ambh-psp-settings-panel .form-table select {
	height: 36px;
}

/* ── Descriptions ─────────────────────────────────────────────────────── */

.ambassadorhub-settings-content .description,
.ambh-psp-settings-panel .description {
	display: block;
	font-style: italic;
	color: #646970;
	margin-top: 6px;
	font-size: 13px;
	line-height: 1.5;
	max-width: 520px;
}

.ambassadorhub-settings-content .description code,
.ambh-psp-settings-panel .description code {
	font-style: normal;
	word-break: break-all;
	background: #f0f0f1;
	padding: 1px 5px;
	border-radius: 3px;
}

/* ── Submit row ───────────────────────────────────────────────────────── */

.ambassadorhub-settings-content .submit,
.ambh-psp-settings-panel .submit {
	padding: 16px 0 0;
	border-top: 1px solid #eee;
	margin-top: 20px;
}

.ambassadorhub-settings-content .submit .button,
.ambh-psp-settings-panel .submit .button {
	min-width: 130px;
	padding: 8px 18px;
	font-size: 13px;
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media screen and (max-width: 782px) {
	.ambassadorhub-settings-content {
		padding: 16px 18px;
	}

	.ambassadorhub-settings-content .form-table,
	.ambh-psp-settings-panel .form-table {
		/* Undo the fixed layout on small screens so the label row can stack
		   above the field instead of staying side-by-side in a cramped column. */
		table-layout: auto;
	}

	.ambassadorhub-settings-content .form-table th,
	.ambh-psp-settings-panel .form-table th {
		display: block;
		width: auto;
		white-space: normal;
		padding: 10px 0 4px;
	}

	.ambassadorhub-settings-content .form-table td,
	.ambh-psp-settings-panel .form-table td {
		display: block;
	}

	.ambassadorhub-settings-content .form-table input[type="text"],
	.ambassadorhub-settings-content .form-table input[type="email"],
	.ambassadorhub-settings-content .form-table input[type="url"],
	.ambassadorhub-settings-content .form-table input[type="number"],
	.ambassadorhub-settings-content .form-table input[type="password"],
	.ambassadorhub-settings-content .form-table textarea,
	.ambassadorhub-settings-content .form-table select,
	.ambassadorhub-settings-content .form-table input.regular-text,
	.ambh-psp-settings-panel .form-table input[type="text"],
	.ambh-psp-settings-panel .form-table input[type="email"],
	.ambh-psp-settings-panel .form-table input[type="url"],
	.ambh-psp-settings-panel .form-table input[type="number"],
	.ambh-psp-settings-panel .form-table input[type="password"],
	.ambh-psp-settings-panel .form-table textarea,
	.ambh-psp-settings-panel .form-table select,
	.ambh-psp-settings-panel .form-table input.regular-text {
		width: 100%;
	}
}

