/**
 * JPEX Order Exporter — dashboard.
 * Everything is scoped under .jpex-oe so themes and WP admin cannot bleed in.
 */

.jpex-oe {
	--jx-ink: #0d0d12;
	--jx-ink-soft: #33333d;
	--jx-muted: #7c7c88;
	--jx-faint: #a9a9b4;
	--jx-accent: #d63384;
	--jx-accent-soft: #fbeaf3;
	--jx-surface: #f5f5f7;
	--jx-paper: #fff;
	--jx-line: #e5e5ea;
	--jx-line-soft: #eeeef2;
	--jx-good: #1f7a52;
	--jx-warn: #b3261e;
	--jx-hold: #96690f;
	--jx-r-lg: 16px;
	--jx-r-md: 11px;

	box-sizing: border-box;
	color: var(--jx-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	max-width: 100%;
	-webkit-font-smoothing: antialiased;
}

.jpex-oe *,
.jpex-oe *::before,
.jpex-oe *::after {
	box-sizing: inherit;
}

.jpex-oe [hidden] {
	display: none !important;
}

.jpex-oe-sr {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.jpex-oe-nowrap {
	white-space: nowrap;
}

/* ---------------------------------------------------------------- header */

.jpex-oe-top {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	justify-content: space-between;
}

.jpex-oe-top h2 {
	font-size: 27px;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.15;
	margin: 0;
}

.jpex-oe-top__meta {
	color: var(--jx-muted);
	font-size: 13px;
	margin: 5px 0 0;
}

.jpex-oe-tabs {
	background: var(--jx-surface);
	border-radius: 999px;
	display: flex;
	gap: 2px;
	padding: 4px;
}

.jpex-oe-tab {
	background: none;
	border: 0;
	border-radius: 999px;
	color: var(--jx-muted);
	cursor: pointer;
	font: inherit;
	font-size: 13.5px;
	padding: 7px 18px;
	transition: background 0.15s ease, color 0.15s ease;
}

.jpex-oe-tab:hover {
	color: var(--jx-ink);
}

.jpex-oe-tab.is-active {
	background: var(--jx-paper);
	box-shadow: 0 1px 2px rgba(13, 13, 18, 0.12);
	color: var(--jx-ink);
	font-weight: 600;
}

/* ----------------------------------------------------------------- flash */

.jpex-oe-flash {
	background: var(--jx-accent-soft);
	border-radius: var(--jx-r-md);
	color: #8d1f56;
	font-size: 14px;
	margin-top: 16px;
	padding: 11px 16px;
}

.jpex-oe-flash.is-error {
	background: #fdecea;
	color: var(--jx-warn);
}

/* --------------------------------------------------------------- figures */

.jpex-oe-figures {
	background: var(--jx-surface);
	border-radius: var(--jx-r-lg);
	display: flex;
	flex-wrap: wrap;
	margin: 22px 0 0;
}

.jpex-oe-figure {
	border-right: 1px solid var(--jx-line);
	flex: 1 1 140px;
	min-width: 0;
	padding: 16px 20px;
}

.jpex-oe-figure:last-child {
	border-right: 0;
}

.jpex-oe-figure__value {
	display: block;
	font-size: clamp(19px, 1.7vw, 24px);
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	letter-spacing: -0.025em;
	line-height: 1.25;
}

.jpex-oe-figure__label {
	color: var(--jx-muted);
	display: block;
	font-size: 11px;
	letter-spacing: 0.09em;
	margin-top: 6px;
	text-transform: uppercase;
}

/* --------------------------------------------------------------- filters */

.jpex-oe-rail {
	align-items: flex-end;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 22px 0 0;
}

.jpex-oe-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.jpex-oe-field--grow {
	flex: 1 1 240px;
}

.jpex-oe-field--dates {
	flex-direction: row;
	gap: 8px;
}

.jpex-oe-field--money {
	flex: 0 0 124px;
}

.jpex-oe-field > span,
.jpex-oe-wide > span,
.jpex-oe-statuses legend,
.jpex-oe-chipset legend {
	color: var(--jx-muted);
	display: block;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.jpex-oe input[type="text"],
.jpex-oe input[type="search"],
.jpex-oe input[type="email"],
.jpex-oe input[type="url"],
.jpex-oe input[type="number"],
.jpex-oe input[type="date"],
.jpex-oe select,
.jpex-oe textarea {
	background: var(--jx-paper);
	border: 1px solid var(--jx-line);
	border-radius: var(--jx-r-md);
	color: var(--jx-ink);
	font: inherit;
	font-size: 14px;
	max-width: 100%;
	padding: 9px 12px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	width: 100%;
}

.jpex-oe textarea {
	line-height: 1.55;
	resize: vertical;
}

.jpex-oe input:focus,
.jpex-oe select:focus,
.jpex-oe textarea:focus {
	border-color: var(--jx-ink);
	box-shadow: 0 0 0 3px rgba(13, 13, 18, 0.08);
	outline: none;
}

.jpex-oe input::placeholder,
.jpex-oe textarea::placeholder {
	color: var(--jx-faint);
}

.jpex-oe-rail__actions {
	display: flex;
	gap: 8px;
}

/* ----------------------------------------------------------------- chips */

.jpex-oe-statuses,
.jpex-oe-chipset {
	border: 0;
	display: block;
	margin: 0;
	min-width: 0;
	padding: 16px 0 0;
}

.jpex-oe-statuses legend,
.jpex-oe-chipset legend {
	margin-bottom: 8px;
	padding: 0;
}

.jpex-oe-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.jpex-oe-chip {
	align-items: center;
	background: var(--jx-paper);
	border: 1px solid var(--jx-line);
	border-radius: 999px;
	cursor: pointer;
	display: inline-flex;
	font-size: 13px;
	gap: 7px;
	line-height: 1;
	padding: 8px 14px;
	transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
	user-select: none;
}

.jpex-oe-chip:hover {
	border-color: var(--jx-faint);
}

.jpex-oe-chip input {
	height: 13px;
	margin: 0;
	width: 13px;
}

.jpex-oe-chip.is-on {
	background: var(--jx-ink);
	border-color: var(--jx-ink);
	color: #fff;
}

.jpex-oe-chipset--columns .jpex-oe-chips {
	max-height: 260px;
	overflow-y: auto;
}

/* --------------------------------------------------------------- buttons */

.jpex-oe-btn {
	align-items: center;
	background: var(--jx-paper);
	border: 1px solid var(--jx-line);
	border-radius: 999px;
	color: var(--jx-ink);
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: 13.5px;
	font-weight: 500;
	gap: 6px;
	justify-content: center;
	line-height: 1;
	padding: 10px 16px;
	text-decoration: none;
	transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, opacity 0.14s ease;
	white-space: nowrap;
}

.jpex-oe-btn:hover {
	border-color: var(--jx-faint);
}

.jpex-oe-btn:focus-visible {
	box-shadow: 0 0 0 3px rgba(13, 13, 18, 0.12);
	outline: none;
}

.jpex-oe-btn:disabled,
.jpex-oe-btn[disabled] {
	cursor: not-allowed;
	opacity: 0.45;
}

.jpex-oe-btn--primary {
	background: var(--jx-ink);
	border-color: var(--jx-ink);
	color: #fff;
}

.jpex-oe-btn--primary:hover {
	background: #232330;
	border-color: #232330;
}

.jpex-oe-btn--accent {
	background: var(--jx-accent);
	border-color: var(--jx-accent);
	color: #fff;
}

.jpex-oe-btn--accent:hover {
	background: #b92a70;
	border-color: #b92a70;
}

.jpex-oe-btn--ghost {
	background: none;
	border-color: transparent;
	color: var(--jx-muted);
}

.jpex-oe-btn--ghost:hover {
	background: var(--jx-surface);
	border-color: transparent;
	color: var(--jx-ink);
}

.jpex-oe-btn--tiny {
	font-size: 12.5px;
	padding: 7px 12px;
}

/* --------------------------------------------------------------- toolbar */

.jpex-oe-bar {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	justify-content: space-between;
	margin: 24px 0 12px;
}

.jpex-oe-bar__left {
	align-items: baseline;
	color: var(--jx-muted);
	display: flex;
	flex-wrap: wrap;
	font-size: 13px;
	gap: 12px;
}

.jpex-oe-bar__right {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.jpex-oe-selected {
	color: var(--jx-accent);
	font-weight: 600;
}

/* ----------------------------------------------------------------- table */

.jpex-oe-tablewrap {
	border-top: 1px solid var(--jx-line);
	overflow-x: auto;
}

.jpex-oe-table {
	border-collapse: collapse;
	min-width: 1140px;
	width: 100%;
}

.jpex-oe-table th,
.jpex-oe-table td {
	padding: 13px 10px;
	text-align: left;
	vertical-align: top;
}

.jpex-oe-table thead th {
	border-bottom: 1px solid var(--jx-line);
	color: var(--jx-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	padding-bottom: 10px;
	padding-top: 14px;
	text-transform: uppercase;
	white-space: nowrap;
}

.jpex-oe-table tbody tr {
	border-bottom: 1px solid var(--jx-line-soft);
}

.jpex-oe-table tbody tr:hover {
	background: var(--jx-surface);
}

.jpex-oe-table tbody tr.is-picked {
	background: var(--jx-accent-soft);
}

.jpex-oe-table td:first-child,
.jpex-oe-table th:first-child {
	padding-left: 14px;
}

.jpex-oe-table td:last-child,
.jpex-oe-table th:last-child {
	padding-right: 14px;
}

/* A hairline spine carries the order status without shouting. The suffix match
   covers both "completed" and "wc-completed", since WooCommerce drops the
   prefix in get_status() but keeps it in the status list. */
.jpex-oe-table tbody tr[data-status] td:first-child {
	box-shadow: inset 3px 0 0 var(--jx-line);
}

.jpex-oe-table tbody tr[data-status$="completed"] td:first-child {
	box-shadow: inset 3px 0 0 var(--jx-good);
}

.jpex-oe-table tbody tr[data-status$="processing"] td:first-child {
	box-shadow: inset 3px 0 0 var(--jx-accent);
}

.jpex-oe-table tbody tr[data-status$="on-hold"] td:first-child {
	box-shadow: inset 3px 0 0 var(--jx-hold);
}

.jpex-oe-table tbody tr[data-status$="cancelled"] td:first-child,
.jpex-oe-table tbody tr[data-status$="failed"] td:first-child,
.jpex-oe-table tbody tr[data-status$="refunded"] td:first-child {
	box-shadow: inset 3px 0 0 var(--jx-warn);
}

.jpex-oe-col-pick {
	width: 40px;
}

.jpex-oe-col-date {
	white-space: nowrap;
	width: 108px;
}

.jpex-oe-col-cust {
	min-width: 190px;
}

.jpex-oe-col-do {
	width: 250px;
}

.jpex-oe-sort {
	cursor: pointer;
	user-select: none;
}

.jpex-oe-sort::after {
	color: var(--jx-faint);
	content: "";
	font-size: 10px;
	margin-left: 5px;
}

.jpex-oe-sort.is-sorted.is-desc::after {
	color: var(--jx-ink);
	content: "\2193";
}

.jpex-oe-sort.is-sorted.is-asc::after {
	color: var(--jx-ink);
	content: "\2191";
}

.jpex-oe-order {
	display: block;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.jpex-oe-order__status,
.jpex-oe-time,
.jpex-oe-cust__sub {
	color: var(--jx-muted);
	display: block;
	font-size: 12px;
	margin-top: 3px;
}

.jpex-oe-cust {
	display: block;
	font-weight: 500;
	max-width: 240px;
}

.jpex-oe-cust__sub {
	max-width: 240px;
}

.jpex-oe-num {
	font-variant-numeric: tabular-nums;
	text-align: right !important;
	white-space: nowrap;
}

.jpex-oe-inv {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	white-space: nowrap;
}

.jpex-oe-inv--none {
	color: var(--jx-faint);
	font-weight: 400;
}

.jpex-oe-rowdo {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.jpex-oe-empty td {
	color: var(--jx-muted);
	padding: 44px 14px;
	text-align: center;
}

.jpex-oe-app.is-busy .jpex-oe-tablewrap {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

/* ----------------------------------------------------------------- pager */

.jpex-oe-pager {
	align-items: center;
	display: flex;
	gap: 12px;
	justify-content: flex-end;
	padding: 16px 0 4px;
}

.jpex-oe-pager__label {
	color: var(--jx-muted);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------- settings */

.jpex-oe-settings {
	margin-top: 22px;
	max-width: 920px;
}

.jpex-oe-group {
	background: var(--jx-paper);
	border: 1px solid var(--jx-line);
	border-radius: var(--jx-r-lg);
	margin-bottom: 16px;
	padding: 20px 22px 22px;
}

.jpex-oe-group > h3 {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -0.01em;
	margin: 0 0 4px;
}

.jpex-oe-group__note {
	color: var(--jx-muted);
	font-size: 13px;
	margin: 0 0 16px;
}

.jpex-oe-grid {
	display: grid;
	gap: 14px 16px;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.jpex-oe-grid label,
.jpex-oe-wide {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.jpex-oe-grid label > span,
.jpex-oe-wide > span {
	color: var(--jx-muted);
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.jpex-oe-wide {
	grid-column: 1 / -1;
	margin-top: 14px;
}

.jpex-oe-toggle {
	align-items: center;
	cursor: pointer;
	display: flex;
	flex-direction: row !important;
	font-size: 14px;
	gap: 9px;
}

.jpex-oe-toggle input {
	height: 15px;
	margin: 0;
	width: 15px;
}

.jpex-oe-toggle > span {
	color: var(--jx-ink) !important;
	font-size: 14px !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
}

.jpex-oe-counter {
	align-items: flex-end;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 14px;
}

.jpex-oe-counter__set {
	flex: 0 0 150px;
}

.jpex-oe-save {
	align-items: center;
	display: flex;
	gap: 14px;
	padding: 4px 0 10px;
}

.jpex-oe-save__state {
	color: var(--jx-muted);
	font-size: 13px;
}

.jpex-oe-inline-action {
	background: none;
	border: 0;
	color: var(--jx-accent);
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	padding: 0;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.jpex-oe-hidden-form {
	display: none;
}

/* ------------------------------------------------------------------ gate */

.jpex-oe--gate .jpex-oe-gate {
	background: var(--jx-surface);
	border-radius: var(--jx-r-lg);
	color: var(--jx-ink-soft);
	font-size: 15px;
	padding: 34px 26px;
	text-align: center;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 860px) {
	.jpex-oe-figure {
		border-bottom: 1px solid var(--jx-line);
		border-right: 0;
		flex: 1 1 50%;
	}

	.jpex-oe-figure:nth-child(odd) {
		border-right: 1px solid var(--jx-line);
	}

	.jpex-oe-field--grow {
		flex: 1 1 100%;
	}

	.jpex-oe-bar {
		align-items: stretch;
		flex-direction: column;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jpex-oe * {
		transition: none !important;
	}
}

@media print {
	.jpex-oe-rail,
	.jpex-oe-bar__right,
	.jpex-oe-tabs,
	.jpex-oe-pager,
	.jpex-oe-col-do {
		display: none !important;
	}
}
