/*
 * Jiffix shared design system — Phase 12A.
 * Loaded after module styles so safe, scoped consistency fixes can be made
 * without rewriting the established module CSS in one risky change.
 */
:root {
	--jfx-color-brand: #3856d6;
	--jfx-color-brand-strong: #273ea8;
	--jfx-color-brand-soft: #eef1ff;
	--jfx-color-text: #182033;
	--jfx-color-muted: #626c7d;
	--jfx-color-subtle: #8790a0;
	--jfx-color-border: #dfe3eb;
	--jfx-color-border-strong: #c9d0dc;
	--jfx-color-surface: #ffffff;
	--jfx-color-surface-muted: #f7f8fb;
	--jfx-color-canvas: #f2f4f8;
	--jfx-color-success: #08785e;
	--jfx-color-success-soft: #e9f7f1;
	--jfx-color-warning: #9a6100;
	--jfx-color-warning-soft: #fff5dd;
	--jfx-color-danger: #b5313d;
	--jfx-color-danger-soft: #fff0f1;
	--jfx-color-info: #3158c8;
	--jfx-color-info-soft: #edf3ff;
	--jfx-color-indigo-soft: #f1efff;
	--jfx-color-teal-soft: #e9f7f5;
	--jfx-color-coral-soft: #fff0ed;
	--jfx-type-page: clamp(32px, 3.4vw, 48px);
	--jfx-type-section: clamp(21px, 2vw, 27px);
	--jfx-type-card: 16px;
	--jfx-type-label: 12px;
	--jfx-space-1: 4px;
	--jfx-space-2: 8px;
	--jfx-space-3: 12px;
	--jfx-space-4: 16px;
	--jfx-space-5: 24px;
	--jfx-space-6: 32px;
	--jfx-space-7: 48px;
	--jfx-radius-sm: 9px;
	--jfx-radius-md: 14px;
	--jfx-radius-lg: 20px;
	--jfx-shadow-card: 0 1px 2px rgba(16, 24, 40, .035), 0 12px 28px rgba(27, 39, 69, .045);
	--jfx-focus: 0 0 0 3px rgba(56, 86, 214, .24);
}

/* Shared Phase 12 interaction vocabulary. */
.jfx-segmented {
	display: flex;
	align-items: center;
	gap: 6px;
	max-width: 100%;
	overflow-x: auto;
	scrollbar-width: thin;
}

.jfx-segmented > a,
.jfx-filter-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 38px;
	padding: 8px 13px;
	border: 1px solid transparent;
	border-radius: 999px;
	color: #465168;
	background: transparent;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
}

.jfx-segmented > a:hover,
.jfx-segmented > a:focus-visible,
.jfx-filter-chip:hover,
.jfx-filter-chip:focus-visible {
	color: var(--jfx-color-brand-strong);
	background: var(--jfx-color-brand-soft);
}

.jfx-segmented > a.is-active,
.jfx-segmented > a[aria-current="page"],
.jfx-filter-chip.is-active {
	border-color: var(--jfx-color-brand);
	color: #fff;
	background: var(--jfx-color-brand);
	box-shadow: 0 4px 12px rgba(56, 86, 214, .18);
}

.jfx-segmented > a strong,
.jfx-filter-chip strong {
	display: inline-grid;
	min-width: 23px;
	height: 23px;
	padding: 0 6px;
	place-items: center;
	border-radius: 999px;
	color: inherit;
	background: rgba(97, 109, 133, .11);
	font-size: 11px;
}

.jfx-segmented > a.is-active strong,
.jfx-filter-chip.is-active strong {
	background: rgba(255, 255, 255, .18);
}

.wrap[class*="jiffix"],
.jiffix-work-area-bar,
.jiffix-dialog {
	color: var(--jfx-color-text);
}

.wrap[class*="jiffix"] {
	box-sizing: border-box;
	max-width: 1440px;
}

.wrap[class*="jiffix"] *,
.jiffix-work-area-bar *,
.jiffix-dialog * {
	box-sizing: border-box;
}

.wrap[class*="jiffix"] h1,
.wrap[class*="jiffix"] h2,
.wrap[class*="jiffix"] h3 {
	color: var(--jfx-color-text);
	letter-spacing: -.02em;
}

.wrap[class*="jiffix"] p,
.wrap[class*="jiffix"] small,
.wrap[class*="jiffix"] .description {
	color: var(--jfx-color-muted);
}

.wrap[class*="jiffix"] a:not(.button):focus-visible,
.jiffix-work-area-bar a:focus-visible,
.jiffix-dialog button:focus-visible,
.wrap[class*="jiffix"] button:focus-visible,
.wrap[class*="jiffix"] input:focus-visible,
.wrap[class*="jiffix"] select:focus-visible,
.wrap[class*="jiffix"] textarea:focus-visible {
	outline: 2px solid var(--jfx-color-brand) !important;
	outline-offset: 2px !important;
	box-shadow: var(--jfx-focus) !important;
}

.wrap[class*="jiffix"] .button,
.jiffix-dialog .button {
	min-height: 40px;
	border-radius: var(--jfx-radius-sm);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 650;
	line-height: 1.2;
}

.wrap[class*="jiffix"] .button.button-primary,
.jiffix-dialog .button.button-primary {
	border-color: var(--jfx-color-brand);
	background: var(--jfx-color-brand);
	box-shadow: none;
}

.wrap[class*="jiffix"] .button.button-primary:hover,
.wrap[class*="jiffix"] .button.button-primary:focus,
.jiffix-dialog .button.button-primary:hover,
.jiffix-dialog .button.button-primary:focus {
	border-color: var(--jfx-color-brand-strong);
	background: var(--jfx-color-brand-strong);
}

.wrap[class*="jiffix"] input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.wrap[class*="jiffix"] select,
.wrap[class*="jiffix"] textarea {
	max-width: 100%;
	min-height: 42px;
	border-color: #aeb6c2;
	border-radius: var(--jfx-radius-sm);
}

.wrap[class*="jiffix"] textarea {
	min-height: 92px;
}

.jiffix-page-header,
.jiffix-page-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	margin: 28px 0 24px;
}

.jiffix-page-header h1,
.jiffix-page-heading h1 {
	margin: 0 0 8px;
	font-size: clamp(29px, 3vw, 42px);
	font-weight: 760;
	line-height: 1.08;
}

.jiffix-page-header > div > p:last-child,
.jiffix-page-heading > p {
	max-width: 850px;
	margin: 0;
	font-size: 15px;
	line-height: 1.65;
}

.jiffix-page-eyebrow {
	margin: 0 0 8px !important;
	color: var(--jfx-color-brand) !important;
	font-size: 12px;
	font-weight: 760;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.jiffix-work-area-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 18px 20px 0 2px;
	padding: 8px;
	overflow-x: auto;
	border: 1px solid var(--jfx-color-border);
	border-radius: var(--jfx-radius-md);
	background: rgba(255, 255, 255, .96);
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
	scrollbar-width: thin;
}

.jiffix-work-area-bar a {
	min-height: 38px;
	padding: 9px 12px;
	border-radius: 8px;
	color: #3c4655;
	font-weight: 650;
	text-decoration: none;
	white-space: nowrap;
}

.jiffix-work-area-bar a:hover {
	color: var(--jfx-color-brand-strong);
	background: var(--jfx-color-brand-soft);
}

.jiffix-work-area-bar a.is-current,
.jiffix-work-area-bar a[aria-current="page"] {
	color: #fff;
	background: var(--jfx-color-brand);
	box-shadow: 0 4px 10px rgba(52, 87, 232, .2);
}

.jiffix-work-area-bar__home,
.jiffix-work-area-bar__links {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.jiffix-work-area-bar__home {
	min-height: 38px;
	padding: 0 12px 0 8px;
	border-right: 1px solid var(--jfx-color-border);
	color: #27324a;
	font-weight: 760;
	white-space: nowrap;
}

@media (min-width: 783px) and (max-width: 1250px) {
	.jiffix-work-area-bar {
		align-items: stretch;
		overflow: visible;
	}

	.jiffix-work-area-bar__links {
		display: grid;
		flex: 1;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		min-width: 0;
	}

	.jiffix-work-area-bar__links a {
		text-align: center;
		white-space: normal;
	}
}

.jiffix-hub-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	max-width: 1100px;
}

.jiffix-hub-card {
	display: grid;
	grid-template-columns: 46px minmax(0, 1fr) 20px;
	align-items: center;
	gap: 16px;
	min-height: 116px;
	padding: 22px;
	border: 1px solid var(--jfx-color-border);
	border-radius: var(--jfx-radius-lg);
	color: var(--jfx-color-text);
	background: var(--jfx-color-surface);
	box-shadow: var(--jfx-shadow-card);
	text-decoration: none;
	transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.jiffix-hub-card:hover,
.jiffix-hub-card:focus-visible {
	border-color: #9cafef;
	color: var(--jfx-color-text);
	box-shadow: 0 12px 34px rgba(31, 50, 115, .11);
	transform: translateY(-1px);
}

.jiffix-hub-card__icon {
	display: grid;
	width: 46px;
	height: 46px;
	place-items: center;
	border-radius: 13px;
	color: var(--jfx-color-brand);
	background: var(--jfx-color-brand-soft);
	font-size: 22px;
}

.jiffix-hub-card strong,
.jiffix-hub-card small {
	display: block;
}

.jiffix-hub-card strong {
	margin-bottom: 5px;
	font-size: 17px;
}

.jiffix-hub-card small {
	color: var(--jfx-color-muted);
	font-size: 13px;
	line-height: 1.5;
}

.jiffix-access-empty {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr) auto;
	align-items: center;
	gap: 18px;
	max-width: 900px;
	padding: 24px;
	border: 1px solid #cbd6f7;
	border-radius: var(--jfx-radius-lg);
	background: var(--jfx-color-brand-soft);
}

.jiffix-access-empty > .dashicons {
	display: grid;
	width: 48px;
	height: 48px;
	place-items: center;
	border-radius: 50%;
	color: var(--jfx-color-brand);
	background: #fff;
	font-size: 23px;
}

.jiffix-access-empty h2,
.jiffix-access-empty p {
	margin: 0;
}

.jiffix-access-empty p {
	margin-top: 5px;
}

.jiffix-instructor-hero__actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 9px;
}

/* One vocabulary for visual states. Text remains present in every badge. */
.jiffix-status,
.jiffix-state,
.jiffix-portal-status,
.jiffix-instructor-status,
.jiffix-funding-status {
	display: inline-flex;
	align-items: center;
	min-height: 27px;
	padding: 4px 10px;
	border: 1px solid transparent;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 720;
	line-height: 1.2;
}

.jiffix-status--active,
.jiffix-state.is-active,
.jiffix-state.is-approved,
.jiffix-state.is-completed,
.jiffix-state.is-paid,
.jiffix-portal-status.is-approved,
.jiffix-instructor-status.is-target-reached,
.jiffix-funding-status.is-active {
	border-color: #b9e8ca;
	color: var(--jfx-color-success);
	background: var(--jfx-color-success-soft);
}

.jiffix-status--inactive,
.jiffix-status--archived,
.jiffix-state.is-inactive,
.jiffix-state.is-resolved,
.jiffix-portal-status.is-resolved {
	border-color: #d9dee7;
	color: #46505e;
	background: #f1f3f6;
}

.jiffix-state.is-pending,
.jiffix-state.is-pending-review,
.jiffix-state.is-in-review,
.jiffix-state.is-hold,
.jiffix-state.is-needs-review,
.jiffix-state.is-needs-management-review,
.jiffix-portal-status.is-pending-review,
.jiffix-portal-status.is-needs-management-review,
.jiffix-instructor-status.is-close-to-target {
	border-color: #f4d598;
	color: var(--jfx-color-warning);
	background: var(--jfx-color-warning-soft);
}

.jiffix-state.is-declined,
.jiffix-state.is-refunded,
.jiffix-state.is-reversed,
.jiffix-state.is-cancelled,
.jiffix-portal-status.is-declined,
.jiffix-instructor-status.is-underperformance {
	border-color: #f3bbb5;
	color: var(--jfx-color-danger);
	background: var(--jfx-color-danger-soft);
}

.wrap[class*="jiffix"] .notice,
.jiffix-portal-notice {
	border-radius: var(--jfx-radius-sm);
	box-shadow: none;
}

.jiffix-dialog {
	width: min(460px, calc(100vw - 32px));
	padding: 0;
	border: 0;
	border-radius: var(--jfx-radius-lg);
	background: #fff;
	box-shadow: 0 28px 80px rgba(16, 24, 40, .28);
}

.jiffix-dialog::backdrop {
	background: rgba(15, 23, 42, .58);
	backdrop-filter: blur(2px);
}

.jiffix-dialog__body {
	padding: 26px 26px 18px;
}

.jiffix-dialog__icon {
	display: grid;
	width: 44px;
	height: 44px;
	margin-bottom: 16px;
	place-items: center;
	border-radius: 50%;
	color: var(--jfx-color-warning);
	background: var(--jfx-color-warning-soft);
	font-size: 20px;
	font-weight: 800;
}

.jiffix-dialog.is-destructive .jiffix-dialog__icon {
	color: var(--jfx-color-danger);
	background: var(--jfx-color-danger-soft);
}

.jiffix-dialog h2 {
	margin: 0 0 9px;
	font-size: 22px;
	line-height: 1.2;
}

.jiffix-dialog p {
	margin: 0;
	color: var(--jfx-color-muted);
	font-size: 14px;
	line-height: 1.6;
}

.jiffix-dialog__actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding: 16px 26px 22px;
	border-top: 1px solid var(--jfx-color-border);
}

.jiffix-dialog.is-destructive .jiffix-dialog__confirm {
	border-color: var(--jfx-color-danger);
	color: #fff;
	background: var(--jfx-color-danger);
}

.jiffix-dialog.is-destructive .jiffix-dialog__confirm:hover {
	border-color: #8f1b13;
	background: #8f1b13;
}

/* Explicit responsive data cards for the two Phase 12A release blockers. */
@media screen and (max-width: 782px) {
	#wpbody-content {
		overflow-x: hidden;
	}

	.wrap[class*="jiffix"] {
		width: auto;
		max-width: none;
		margin-right: 10px;
		margin-left: 10px;
	}

	.jiffix-work-area-bar {
		align-items: stretch;
		flex-wrap: wrap;
		gap: 8px;
		margin-right: 10px;
		margin-left: 10px;
	}

	.jiffix-work-area-bar__home {
		justify-content: center;
		width: 100%;
		border-right: 0;
	}

	.jiffix-work-area-bar__links {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		overflow: visible;
		width: 100%;
	}

	.jiffix-work-area-bar__links a {
		justify-content: center;
		min-width: 0;
		text-align: center;
		white-space: normal;
	}

	.jiffix-page-header,
	.jiffix-page-heading,
	.jiffix-access-empty {
		grid-template-columns: 1fr;
		align-items: stretch;
		flex-direction: column;
	}

	.jiffix-instructor-hero__actions {
		align-items: stretch;
		flex-direction: column-reverse;
	}

	.jiffix-instructor-hero__actions .button {
		width: 100%;
	}

	.jiffix-hub-grid {
		grid-template-columns: 1fr;
	}

	.jiffix-hub-card {
		min-height: 102px;
		padding: 18px;
	}

	.jiffix-groups-wrap,
	.jiffix-group-card,
	.jiffix-groups-toolbar,
	.jiffix-form-row,
	.jiffix-shift-form-row,
	.jiffix-time-fields,
	.jiffix-time-picker,
	.jiffix-time-picker__control,
	.jiffix-filter-field,
	.jiffix-filter-field--search,
	.jiffix-toolbar-actions {
		min-width: 0 !important;
		max-width: 100% !important;
	}

	.jiffix-time-picker__control > select {
		flex: 1 1 78px;
		width: auto;
		min-width: 0;
	}

	.jiffix-groups-table,
	.jiffix-groups-table tbody,
	.jiffix-groups-table tr,
	.jiffix-groups-table td {
		display: block;
		width: 100% !important;
		min-width: 0 !important;
		max-width: 100% !important;
	}

	.jiffix-groups-table {
		border: 0;
		background: transparent;
		box-shadow: none;
	}

	.jiffix-groups-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
		border: 0;
	}

	.jiffix-groups-table tbody {
		display: grid;
		gap: 14px;
	}

	.jiffix-groups-table tr {
		overflow: hidden;
		border: 1px solid var(--jfx-color-border);
		border-radius: var(--jfx-radius-md);
		background: #fff;
		box-shadow: 0 4px 18px rgba(16, 24, 40, .05);
	}

	.jiffix-groups-table td {
		display: grid;
		grid-template-columns: minmax(105px, 38%) minmax(0, 1fr);
		gap: 12px;
		padding: 12px 14px !important;
		border: 0;
		border-top: 1px solid #edf0f4;
		text-align: left;
		white-space: normal;
		overflow-wrap: anywhere;
	}

	.jiffix-groups-table td:first-child {
		border-top: 0;
	}

	.jiffix-groups-table td::before {
		content: attr(data-label);
		color: var(--jfx-color-muted);
		font-size: 11px;
		font-weight: 760;
		letter-spacing: .04em;
		text-transform: uppercase;
	}

	.jiffix-groups-table td.jiffix-empty-cell {
		display: block;
		padding: 22px !important;
	}

	.jiffix-groups-table td.jiffix-empty-cell::before {
		display: none;
	}

	.jiffix-groups-table .jiffix-row-actions,
	.jiffix-groups-table .jiffix-row-actions form,
	.jiffix-groups-table .jiffix-row-actions .button {
		width: 100%;
		min-width: 0;
	}

	.jiffix-groups-table .jiffix-row-actions {
		display: grid;
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.jiffix-dialog__actions {
		flex-direction: column-reverse;
	}

	.jiffix-dialog__actions .button {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jiffix-hub-card {
		transition: none;
	}
}
