/**
 * Master Tickets — Event Organiser Portal
 * Self-contained, theme-agnostic SaaS styling with dark-mode support.
 * Everything is scoped under .mt-portal / .mt-portal-standalone.
 */

.mt-portal-standalone {
	margin: 0;
	padding: 0;
}

.mt-portal,
.mt-portal *,
.mt-portal *::before,
.mt-portal *::after,
.mt-p-login,
.mt-p-login * {
	box-sizing: border-box;
}

.mt-portal,
.mt-p-login {
	--mtp-primary: var(--mt-primary, #4f46e5);
	--mtp-accent: var(--mt-accent, #16a34a);
	--mtp-bg: #f5f6fb;
	--mtp-surface: #ffffff;
	--mtp-surface-2: #f2f4fa;
	--mtp-border: #e6e8ef;
	--mtp-text: #111827;
	--mtp-muted: #6b7280;
	--mtp-sidebar-bg: #0f172a;
	--mtp-sidebar-text: #c7d2e0;
	--mtp-sidebar-muted: #8695ad;
	--mtp-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
	--mtp-radius: 14px;
	--mtp-radius-sm: 10px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--mtp-text);
	line-height: 1.5;
}

[data-theme="dark"] .mt-portal,
[data-theme="dark"] .mt-p-login {
	--mtp-bg: #0b1020;
	--mtp-surface: #131c30;
	--mtp-surface-2: #0f1728;
	--mtp-border: #243350;
	--mtp-text: #e6eaf2;
	--mtp-muted: #94a3b8;
	--mtp-sidebar-bg: #0a1120;
	--mtp-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
}

/* ---------- Layout ---------- */

.mt-portal {
	display: flex;
	min-height: 100vh;
	background: var(--mtp-bg);
}

.mt-p-sidebar {
	position: sticky;
	top: 0;
	align-self: flex-start;
	width: 256px;
	min-width: 256px;
	height: 100vh;
	background: var(--mtp-sidebar-bg);
	color: var(--mtp-sidebar-text);
	display: flex;
	flex-direction: column;
	padding: 20px 16px;
	z-index: 40;
}

.mt-p-main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.mt-p-content {
	padding: 24px;
	max-width: 1280px;
	width: 100%;
	margin: 0 auto;
}

/* ---------- Brand + nav ---------- */

.mt-p-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 10px 18px;
}

.mt-p-brand__mark {
	display: inline-grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 9px;
	background: var(--mtp-primary);
	color: #fff;
	font-weight: 700;
	font-size: 13px;
	letter-spacing: .5px;
}

.mt-p-brand__name {
	font-weight: 600;
	color: #fff;
	font-size: 15px;
}

.mt-p-brand__logo {
	max-height: 34px;
	max-width: 160px;
	width: auto;
	height: auto;
	display: block;
	border-radius: 6px;
}

.mt-p-nav {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 6px;
}

.mt-p-navlink {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 12px;
	border-radius: 10px;
	color: var(--mtp-sidebar-text);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: background .15s ease, color .15s ease;
}

.mt-p-navlink:hover {
	background: rgba(255, 255, 255, .07);
	color: #fff;
}

.mt-p-navlink.is-active {
	background: rgba(255, 255, 255, .12);
	color: #fff;
}

.mt-p-navlink .mt-p-ico {
	opacity: .9;
	flex: 0 0 auto;
}

.mt-p-sidebar__foot {
	margin-top: auto;
	padding-top: 16px;
	border-top: 1px solid rgba(255, 255, 255, .08);
}

.mt-p-logout {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 12px;
	border-radius: 10px;
	color: var(--mtp-sidebar-text);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
}

.mt-p-logout:hover {
	background: rgba(255, 255, 255, .07);
	color: #fff;
}

/* ---------- Topbar ---------- */

.mt-p-topbar {
	position: sticky;
	top: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 24px;
	background: color-mix(in srgb, var(--mtp-surface) 88%, transparent);
	backdrop-filter: saturate(140%) blur(8px);
	border-bottom: 1px solid var(--mtp-border);
}

.mt-p-topbar__title {
	font-size: 18px;
	font-weight: 700;
	margin: 0;
	color: var(--mtp-text);
}

.mt-p-topbar__right {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 12px;
}

.mt-p-user {
	font-size: 14px;
	font-weight: 500;
	color: var(--mtp-muted);
}

.mt-p-iconbtn {
	display: inline-grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	border: 1px solid var(--mtp-border);
	background: var(--mtp-surface);
	color: var(--mtp-text);
	cursor: pointer;
}

.mt-p-iconbtn:hover {
	background: var(--mtp-surface-2);
}

.mt-p-menu-toggle {
	display: none;
}

/* ---------- Cards ---------- */

.mt-p-card {
	background: var(--mtp-surface);
	border: 1px solid var(--mtp-border);
	border-radius: var(--mtp-radius);
	box-shadow: var(--mtp-shadow);
	margin-bottom: 20px;
	overflow: hidden;
}

.mt-p-card__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 20px;
	border-bottom: 1px solid var(--mtp-border);
}

.mt-p-card__title {
	font-size: 15px;
	font-weight: 700;
	margin: 0;
}

.mt-p-card__actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.mt-p-card__body {
	padding: 18px 20px;
}

/* ---------- Stats ---------- */

.mt-p-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}

.mt-p-stat {
	background: var(--mtp-surface);
	border: 1px solid var(--mtp-border);
	border-radius: var(--mtp-radius);
	box-shadow: var(--mtp-shadow);
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	position: relative;
}

.mt-p-stat__icon {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 11px;
	margin-bottom: 6px;
	background: color-mix(in srgb, var(--mtp-primary) 14%, transparent);
	color: var(--mtp-primary);
}

.mt-p-stat--success .mt-p-stat__icon { background: rgba(22, 163, 74, .14); color: #16a34a; }
.mt-p-stat--warn .mt-p-stat__icon { background: rgba(217, 119, 6, .14); color: #d97706; }
.mt-p-stat--info .mt-p-stat__icon { background: rgba(2, 132, 199, .14); color: #0284c7; }

.mt-p-stat__value {
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -.5px;
}

.mt-p-stat__label {
	font-size: 13px;
	color: var(--mtp-muted);
	font-weight: 500;
}

.mt-p-grid-2 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 20px;
}

/* ---------- Tables ---------- */

.mt-p-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.mt-p-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.mt-p-table thead th {
	text-align: left;
	font-size: 11px;
	letter-spacing: .5px;
	text-transform: uppercase;
	color: var(--mtp-muted);
	font-weight: 600;
	padding: 10px 14px;
	border-bottom: 1px solid var(--mtp-border);
	white-space: nowrap;
}

.mt-p-table tbody td {
	padding: 13px 14px;
	border-bottom: 1px solid var(--mtp-border);
	vertical-align: middle;
}

.mt-p-table tbody tr:last-child td {
	border-bottom: 0;
}

.mt-p-table tbody tr:hover {
	background: var(--mtp-surface-2);
}

.mt-p-strong { font-weight: 600; }

.mt-p-code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12.5px;
	background: var(--mtp-surface-2);
	border: 1px solid var(--mtp-border);
	border-radius: 6px;
	padding: 2px 7px;
	display: inline-block;
}

.mt-p-actions__inner {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}

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

.mt-p-badge {
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	padding: 3px 10px;
	border-radius: 999px;
	white-space: nowrap;
}

.mt-p-badge--success { background: rgba(22, 163, 74, .14); color: #15803d; }
.mt-p-badge--danger { background: rgba(220, 38, 38, .12); color: #b91c1c; }
.mt-p-badge--warn { background: rgba(217, 119, 6, .14); color: #b45309; }
.mt-p-badge--info { background: rgba(2, 132, 199, .14); color: #0369a1; }
.mt-p-badge--muted { background: var(--mtp-surface-2); color: var(--mtp-muted); }

[data-theme="dark"] .mt-p-badge--success { color: #4ade80; }
[data-theme="dark"] .mt-p-badge--danger { color: #f87171; }
[data-theme="dark"] .mt-p-badge--warn { color: #fbbf24; }
[data-theme="dark"] .mt-p-badge--info { color: #38bdf8; }

/* ---------- Buttons ---------- */

.mt-p-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	font-size: 14px;
	font-weight: 600;
	min-height: 40px;
	padding: 9px 16px;
	border-radius: 10px;
	border: 1px solid transparent;
	background: var(--mtp-surface-2);
	color: var(--mtp-text);
	cursor: pointer;
	text-decoration: none;
	transition: background .15s ease, box-shadow .15s ease, opacity .15s ease;
	line-height: 1.1;
	box-sizing: border-box;
	white-space: nowrap;
}

.mt-p-btn:hover { background: var(--mtp-border); }

.mt-p-btn--primary {
	background: var(--mtp-primary);
	color: #fff;
}

.mt-p-btn--primary:hover {
	background: color-mix(in srgb, var(--mtp-primary) 88%, #000);
}

.mt-p-btn--ghost {
	background: transparent;
	border-color: var(--mtp-border);
	color: var(--mtp-text);
}

.mt-p-btn--ghost:hover { background: var(--mtp-surface-2); }

.mt-p-btn--sm {
	font-size: 12.5px;
	min-height: 34px;
	padding: 6px 11px;
	border-radius: 8px;
}

.mt-p-btn--danger {
	background: transparent;
	border-color: color-mix(in srgb, var(--mtp-danger, #dc2626) 45%, transparent);
	color: var(--mtp-danger, #dc2626);
}

.mt-p-btn--danger:hover {
	background: color-mix(in srgb, var(--mtp-danger, #dc2626) 12%, transparent);
	border-color: var(--mtp-danger, #dc2626);
}

.mt-p-btn--block {
	width: 100%;
	padding: 12px 16px;
}

.mt-p-btn .mt-p-ico { width: 16px; height: 16px; }

.mt-p-inline-form { display: inline; margin: 0; }

/* ---------- Filters ---------- */

.mt-p-filters,
.mt-p-quicksearch {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 16px;
	align-items: center;
}

.mt-p-filter { position: relative; }

.mt-p-filter--search,
.mt-p-quicksearch { position: relative; flex: 1 1 220px; }

.mt-p-input-ico {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--mtp-muted);
	pointer-events: none;
}

.mt-p-filters input[type="search"],
.mt-p-filters input[type="date"],
.mt-p-filters select,
.mt-p-quicksearch input[type="search"] {
	width: 100%;
	font-size: 16px;
	min-height: 44px;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid var(--mtp-border);
	background: var(--mtp-surface);
	color: var(--mtp-text);
	box-sizing: border-box;
}

.mt-p-filter--search input[type="search"],
.mt-p-quicksearch input[type="search"] { padding-left: 38px; }

.mt-p-quicksearch input[type="search"] { min-width: 0; }

/* ---------- Lists (dashboard) ---------- */

.mt-p-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mt-p-list li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 11px 0;
	border-bottom: 1px solid var(--mtp-border);
	flex-wrap: wrap;
}

.mt-p-list li:last-child { border-bottom: 0; }

.mt-p-li-main { font-weight: 600; font-size: 14px; }
.mt-p-li-sub { color: var(--mtp-muted); font-size: 13px; }
.mt-p-li-time { margin-left: auto; color: var(--mtp-muted); font-size: 13px; white-space: nowrap; }

/* ---------- Empty + notices ---------- */

.mt-p-empty {
	text-align: center;
	color: var(--mtp-muted);
	padding: 36px 16px;
}

.mt-p-empty .mt-p-ico {
	width: 30px;
	height: 30px;
	opacity: .5;
	margin-bottom: 8px;
}

.mt-p-notice {
	border-radius: var(--mtp-radius-sm);
	padding: 12px 16px;
	font-size: 14px;
	font-weight: 500;
	margin-bottom: 18px;
	border: 1px solid transparent;
}

.mt-p-notice--success { background: rgba(22, 163, 74, .1); color: #15803d; border-color: rgba(22, 163, 74, .25); }
.mt-p-notice--error { background: rgba(220, 38, 38, .09); color: #b91c1c; border-color: rgba(220, 38, 38, .25); }
.mt-p-notice--info { background: rgba(2, 132, 199, .09); color: #0369a1; border-color: rgba(2, 132, 199, .25); }

/* ---------- Pagination ---------- */

.mt-p-pagination {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 16px;
}

.mt-p-page {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	padding: 7px 13px;
	border-radius: 9px;
	border: 1px solid var(--mtp-border);
	background: var(--mtp-surface);
	color: var(--mtp-text);
	text-decoration: none;
}

.mt-p-page .mt-p-ico { width: 14px; height: 14px; }
.mt-p-page.is-disabled { opacity: .45; }
.mt-p-page-info { font-size: 13px; color: var(--mtp-muted); }

/* ---------- Details ---------- */

.mt-p-details {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2px;
}

.mt-p-drow {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 11px 0;
	border-bottom: 1px solid var(--mtp-border);
	font-size: 14px;
}

.mt-p-drow:last-child { border-bottom: 0; }
.mt-p-dlabel { color: var(--mtp-muted); font-weight: 500; }
.mt-p-dvalue { font-weight: 600; text-align: right; }
.mt-p-detail-actions { margin-top: 16px; display: flex; gap: 8px; }
.mt-p-subhead { font-size: 14px; font-weight: 700; margin: 18px 0 6px; }

/* ---------- Forms ---------- */

.mt-p-form { max-width: 640px; }

.mt-p-field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.mt-p-field label { font-size: 13px; font-weight: 600; color: var(--mtp-text); }

.mt-p-field input,
.mt-p-field select,
.mt-p-field textarea,
.mt-p-textarea {
	font-size: 16px;
	min-height: 44px;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid var(--mtp-border);
	background: var(--mtp-surface);
	color: var(--mtp-text);
	width: 100%;
	box-sizing: border-box;
}

.mt-p-field textarea,
.mt-p-textarea { min-height: 120px; line-height: 1.5; }

.mt-p-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.mt-p-form-actions { display: flex; gap: 10px; margin-top: 8px; }
.mt-p-lead { color: var(--mtp-muted); margin: 0 0 16px; font-size: 14px; }

/* ---------- Check-in embed ---------- */

.mt-p-checkin { min-height: 0; }

/* ---------- Overlay (mobile) ---------- */

.mt-p-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(2, 6, 23, .5);
	z-index: 39;
}

/* ---------- Login ---------- */

.mt-portal-login-body { margin: 0; }

.mt-p-login {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background:
		radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--mtp-primary) 22%, transparent), transparent),
		var(--mtp-bg);
	padding: 24px;
}

.mt-p-login__card {
	width: 100%;
	max-width: 400px;
	background: var(--mtp-surface);
	border: 1px solid var(--mtp-border);
	border-radius: 18px;
	box-shadow: var(--mtp-shadow);
	padding: 30px;
}

.mt-p-login__brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 4px;
	margin-bottom: 22px;
}

.mt-p-login__brand .mt-p-brand__mark { width: 44px; height: 44px; font-size: 15px; margin-bottom: 8px; }
.mt-p-login__brand .mt-p-brand__logo { max-height: 56px; max-width: 220px; margin-bottom: 10px; }
.mt-p-login__title { font-size: 18px; font-weight: 700; }
.mt-p-login__subtitle { font-size: 13px; color: var(--mtp-muted); }

.mt-p-login__row--center { justify-content: center; margin-top: 12px; margin-bottom: 0; }

.mt-p-login__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 4px 0 18px;
	gap: 10px;
	flex-wrap: wrap;
}

.mt-p-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mtp-muted); cursor: pointer; }
.mt-p-link { font-size: 13px; color: var(--mtp-primary); text-decoration: none; font-weight: 600; }
.mt-p-link:hover { text-decoration: underline; }
.mt-p-login__foot { margin-top: 18px; font-size: 12px; color: var(--mtp-muted); }
.mt-p-standalone-msg { max-width: 420px; margin: 60px auto; text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; }

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

@media (max-width: 980px) {
	.mt-p-sidebar {
		position: fixed;
		left: 0;
		top: 0;
		transform: translateX(-100%);
		transition: transform .22s ease;
		box-shadow: 0 0 40px rgba(0, 0, 0, .3);
	}

	.mt-portal.is-open .mt-p-sidebar { transform: translateX(0); }
	.mt-portal.is-open .mt-p-overlay { display: block; }
	.mt-p-menu-toggle { display: inline-grid; }
}

@media (max-width: 768px) {
	.mt-p-content { padding: 16px; }
	.mt-p-topbar { padding: 12px 16px; }

	.mt-p-table thead { display: none; }

	.mt-p-table tbody td {
		display: flex;
		justify-content: space-between;
		gap: 16px;
		padding: 9px 14px;
		border-bottom: 1px solid var(--mtp-border);
	}

	.mt-p-table tbody td::before {
		content: attr(data-label);
		font-size: 12px;
		font-weight: 600;
		color: var(--mtp-muted);
		flex: 0 0 auto;
	}

	.mt-p-table tbody tr {
		display: block;
		padding: 8px 0;
		border-bottom: 8px solid var(--mtp-bg);
		background: var(--mtp-surface);
	}

	.mt-p-table tbody td.mt-p-actions .mt-p-actions__inner { justify-content: flex-end; }
	.mt-p-field-row { grid-template-columns: 1fr; }
	.mt-p-drow { flex-direction: column; gap: 3px; }
	.mt-p-dvalue { text-align: left; }
}

@media (prefers-color-scheme: dark) {
	html:not([data-theme="light"]) .mt-portal,
	html:not([data-theme="light"]) .mt-p-login {
		--mtp-bg: #0b1020;
		--mtp-surface: #131c30;
		--mtp-surface-2: #0f1728;
		--mtp-border: #243350;
		--mtp-text: #e6eaf2;
		--mtp-muted: #94a3b8;
		--mtp-sidebar-bg: #0a1120;
	}
}

/* ============================================================
   v1.4.0 — Portal UI/UX polish
   ============================================================ */

/* ---- Task 8: prevent iOS input zoom everywhere (>=16px) ---- */
.mt-portal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.mt-portal select,
.mt-portal textarea,
.mt-p-login input,
.mt-p-login select {
	font-size: 16px;
}

/* ---- Task 1: logo-only brand + logout safe-area on mobile ---- */
.mt-p-brand--logo-only { justify-content: center; }
.mt-p-brand--logo-only .mt-p-brand__logo { max-height: 40px; max-width: 180px; }
.mt-p-brand--logo-only .mt-p-brand__mark { margin: 0 auto; }

/* ---- Task 2: Quick Ticket Search ---- */
.mt-p-card .mt-p-quicksearch {
	display: flex;
	flex: none;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 10px;
	margin: 0;
}
.mt-p-quicksearch__field { position: relative; flex: 1 1 260px; min-width: 0; }
.mt-p-quicksearch__field input[type="search"] {
	width: 100%;
	font-size: 16px;
	min-height: 46px;
	padding: 10px 12px 10px 40px;
	border-radius: 10px;
	border: 1px solid var(--mtp-border);
	background: var(--mtp-surface);
	color: var(--mtp-text);
	box-sizing: border-box;
}
.mt-p-quicksearch .mt-p-btn { min-height: 46px; flex: 0 0 auto; padding-inline: 22px; }

/* ---- Task 9: table action cells / touch targets ---- */
.mt-p-actions__inner { gap: 8px; }
.mt-p-actions .mt-p-btn { min-height: 36px; }
.mt-p-actions .mt-p-inline-form { display: inline-flex; }

/* ---- Task 5: dark-mode icon visibility (icons follow text colour) ---- */
.mt-p-ico { color: currentColor; }
.mt-p-btn .mt-p-ico,
.mt-p-navlink .mt-p-ico,
.mt-p-iconbtn .mt-p-ico,
.mt-p-table .mt-p-ico { color: currentColor; }
[data-theme="dark"] .mt-p-btn--ghost { color: var(--mtp-text); }
[data-theme="dark"] .mt-p-btn--ghost .mt-p-ico { color: var(--mtp-text); }
[data-theme="dark"] .mt-p-iconbtn { color: var(--mtp-text); }
[data-theme="dark"] .mt-p-input-ico { color: var(--mtp-muted); }

/* ---- Task 4/5/6: slide-over panel ---- */
body.mt-p-noscroll { overflow: hidden; }
.mt-p-slideover { position: fixed; inset: 0; z-index: 100000; }
.mt-p-slideover[hidden] { display: none; }
.mt-p-slideover__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, .5);
	opacity: 0;
	transition: opacity .2s ease;
}
.mt-p-slideover.is-open .mt-p-slideover__backdrop { opacity: 1; }
.mt-p-slideover__panel {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: min(460px, 100%);
	background: var(--mtp-surface);
	border-left: 1px solid var(--mtp-border);
	box-shadow: -12px 0 40px rgba(15, 23, 42, .18);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform .22s ease;
}
.mt-p-slideover.is-open .mt-p-slideover__panel { transform: translateX(0); }
.mt-p-slideover__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px;
	border-bottom: 1px solid var(--mtp-border);
}
.mt-p-slideover__title { font-size: 16px; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.mt-p-slideover__body { padding: 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.mt-p-panel-loading { color: var(--mtp-muted); text-align: center; padding: 40px 0; }

/* Large QR in the ticket panel */
.mt-p-qr {
	display: flex;
	justify-content: center;
	padding: 14px;
	background: #fff;
	border: 1px solid var(--mtp-border);
	border-radius: 14px;
	margin-bottom: 16px;
}
.mt-p-qr svg { width: 220px; height: 220px; max-width: 100%; }

/* Ticket lists inside panels */
.mt-p-list--tickets li { align-items: flex-start; flex-wrap: wrap; }
.mt-p-tline { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.mt-p-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* ---- Task 3: media picker ---- */
.mt-p-media { display: flex; flex-direction: column; gap: 10px; }
.mt-p-media__thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.mt-p-media__thumbs:empty { display: none; }
.mt-p-thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--mtp-border); background: var(--mtp-surface-2); }
.mt-p-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mt-p-thumb__remove {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 22px;
	height: 22px;
	border: none;
	border-radius: 50%;
	background: rgba(15, 23, 42, .72);
	color: #fff;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.mt-p-thumb__remove .mt-p-ico { width: 13px; height: 13px; }
.mt-p-media__add { align-self: flex-start; }

/* ---- Task 3: ticket-type iPhone toggles ---- */
.mt-p-help { font-size: 12.5px; color: var(--mtp-muted); margin: 0 0 6px; }
.mt-p-tt-list { display: flex; flex-direction: column; gap: 10px; }
.mt-p-tt {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border: 1px solid var(--mtp-border);
	border-radius: 12px;
	background: var(--mtp-surface);
}
.mt-p-tt__label { font-weight: 600; flex: 1 1 auto; }
.mt-p-tt__price { display: none; align-items: center; gap: 6px; flex: 0 0 auto; }
.mt-p-tt.is-on { border-color: color-mix(in srgb, var(--mtp-primary) 45%, var(--mtp-border)); }
.mt-p-tt.is-on .mt-p-tt__price { display: inline-flex; }
.mt-p-tt__cur { color: var(--mtp-muted); font-size: 14px; }
.mt-p-tt__price input { width: 92px; min-height: 40px; font-size: 16px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--mtp-border); background: var(--mtp-surface); color: var(--mtp-text); box-sizing: border-box; }

/* Switch */
.mt-p-switch { position: relative; display: inline-flex; flex: 0 0 auto; }
.mt-p-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.mt-p-switch__track {
	width: 46px;
	height: 28px;
	border-radius: 999px;
	background: var(--mtp-border);
	transition: background .18s ease;
	display: inline-block;
	position: relative;
}
.mt-p-switch__thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0,0,0,.25);
	transition: transform .18s ease;
}
.mt-p-switch input:checked + .mt-p-switch__track { background: var(--mtp-primary); }
.mt-p-switch input:checked + .mt-p-switch__track .mt-p-switch__thumb { transform: translateX(18px); }
.mt-p-switch input:focus-visible + .mt-p-switch__track { outline: 2px solid var(--mtp-primary); outline-offset: 2px; }

/* ---- Task 3: advanced + editor ---- */
.mt-p-advanced-wrap { margin: 6px 0 4px; }
.mt-p-advanced-toggle { margin-bottom: 6px; }
.mt-p-advanced {
	border: 1px dashed var(--mtp-border);
	border-radius: 12px;
	padding: 14px 16px 2px;
	background: var(--mtp-surface-2);
}
.mt-p-check--inline { color: var(--mtp-text); }
.mt-p-editor .wp-editor-wrap { border-radius: 10px; }
.mt-p-editor textarea { font-size: 16px; }

/* ---- Task 7: check-in embed styling + hide kiosk logout ---- */
/* Embed the kiosk exactly like the standalone Admin check-in page — same dark
   styling, tabs, padding and proportions — the only differences being those the
   portal itself requires (its own header/logout instead of the kiosk's). */
.mt-p-checkin .mt-kiosk {
	min-height: 72vh;
	padding: 20px;
	gap: 20px;
	border-radius: 18px;
}
.mt-p-checkin .mt-kiosk-header { display: none; }

/* ---- Task 9: empty + hover polish ---- */
.mt-p-empty { text-align: center; color: var(--mtp-muted); padding: 26px 10px; }
.mt-p-table tbody tr { transition: background .12s ease; }
.mt-p-table tbody tr:hover { background: var(--mtp-surface-2); }
.mt-p-navlink { transition: background .12s ease, color .12s ease; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
	/* Quick search: full-width stack */
	.mt-p-card .mt-p-quicksearch { flex-direction: column; align-items: stretch; }
	.mt-p-quicksearch .mt-p-btn { width: 100%; }

	/* Task 5: date filters no longer overlap — each on its own row */
	.mt-p-filters { flex-direction: column; align-items: stretch; gap: 10px; }
	.mt-p-filters .mt-p-filter,
	.mt-p-filters .mt-p-filter--search { width: 100%; flex: 1 1 auto; }

	/* Tasks 3-6: action buttons wrap into comfortable, tappable targets */
	.mt-p-table tbody td.mt-p-actions .mt-p-actions__inner { flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
	.mt-p-actions .mt-p-btn,
	.mt-p-actions .mt-p-inline-form { flex: 1 1 calc(50% - 8px); }
	.mt-p-actions .mt-p-inline-form .mt-p-btn { width: 100%; }
	.mt-p-actions .mt-p-btn { min-height: 44px; }
	.mt-p-actions .mt-p-btn--primary { flex-basis: 100%; }

	/* Slide-over becomes a bottom sheet-ish full panel */
	.mt-p-slideover__panel { width: 100%; }

	.mt-p-field-row { grid-template-columns: 1fr; }
	.mt-p-tt__price input { width: 110px; }
}

/* ---- Task 5: logout stays pinned to the bottom, clear of the iOS bar ---- */
@media (max-width: 980px) {
	.mt-p-sidebar__foot {
		margin-top: auto;
		padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	}
}

/* ============================================================
   v1.4.1 — search var, stacked customer cell, mobile fit
   ============================================================ */

/* ---- Task 2: Tickets "Customer" column — name stacked over email ---- */
.mt-p-cust { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mt-p-cust__name { font-weight: 600; color: var(--mtp-text); }
.mt-p-cust__email,
.mt-p-wrap { color: var(--mtp-muted); font-size: 12.5px; overflow-wrap: anywhere; word-break: break-word; }

/* ---- Tasks 1 & 6: no horizontal scroll on mobile ---- */
@media (max-width: 768px) {
	/* Let stacked cells wrap long values (emails, codes) instead of overflowing */
	.mt-p-table tbody td { flex-wrap: wrap; align-items: flex-start; }
	.mt-p-table tbody td > * { min-width: 0; max-width: 100%; }
	.mt-p-table tbody td .mt-p-cust { align-items: flex-start; text-align: left; }

	.mt-p-code { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
	.mt-p-cust__email { font-size: 13px; }

	/* Guard: the content column never forces the page wider than the screen */
	.mt-p-content { overflow-x: hidden; }

	/* Quick Ticket Search: guaranteed full-width, no overlap */
	.mt-p-card .mt-p-quicksearch { flex-direction: column; align-items: stretch; gap: 10px; }
	.mt-p-quicksearch__field { flex: 1 1 auto; width: 100%; min-width: 0; }
	.mt-p-quicksearch__field input[type="search"] { width: 100%; }
	.mt-p-quicksearch .mt-p-btn { width: 100%; }
}

/* ============================================================
   v1.5.0 — Event Editor cards, switch rows, selects
   ============================================================ */

/* ---- Task 4/7: Event Editor sections as modern cards ---- */
.mt-p-event-form .mt-p-form-section {
	background: var(--mtp-surface);
	border: 1px solid var(--mtp-border);
	border-radius: 14px;
	padding: 18px;
	margin-bottom: 16px;
}
.mt-p-event-form .mt-p-form-section > .mt-p-subhead {
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--mtp-border);
	font-size: 14px;
	font-weight: 700;
}
.mt-p-event-form .mt-p-field:last-child { margin-bottom: 0; }

.mt-p-textarea--sm { min-height: 64px; }

/* Native select, matched to inputs */
.mt-p-select {
	width: 100%;
	font-size: 16px;
	min-height: 44px;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid var(--mtp-border);
	background: var(--mtp-surface);
	color: var(--mtp-text);
	box-sizing: border-box;
}

/* ---- iPhone-style toggle rows (Show Remaining / Show Map) ---- */
.mt-p-switch-row {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 14px;
	border: 1px solid var(--mtp-border);
	border-radius: 12px;
	background: var(--mtp-surface-2);
	margin-bottom: 14px;
}
.mt-p-switch-row:last-child { margin-bottom: 0; }
.mt-p-switch-row__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mt-p-switch-row__label { font-weight: 600; color: var(--mtp-text); }
.mt-p-switch-row .mt-p-help { margin: 0; }

/* ---- Task 7: mobile ---- */
@media (max-width: 768px) {
	.mt-p-event-form .mt-p-form-section { padding: 14px; }
	.mt-p-event-form .mt-p-form-actions { flex-wrap: wrap; }
	.mt-p-event-form .mt-p-form-actions .mt-p-btn { flex: 1 1 100%; }
}

/* ============================================================
   v1.5.2 — date/time fields, ticket-type rows, filter polish
   ============================================================ */

/* ---- Tasks 1 & 2: date & time inputs match every other field ---- */
.mt-p-datefield { position: relative; width: 100%; }
.mt-p-datefield > input[type="date"],
.mt-p-datefield > input[type="time"] {
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

/* Icon placeholder shown until a value is chosen (JS + SSR set .is-empty) */
.mt-p-datefield.is-empty > input,
.mt-p-datefield.is-empty > input::-webkit-datetime-edit { color: transparent; }
.mt-p-datefield.is-empty::before {
	content: attr(data-ph);
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--mtp-muted);
	font-size: 15px;
	line-height: 1;
	pointer-events: none;
	white-space: nowrap;
	overflow: hidden;
	max-width: calc(100% - 42px);
	text-overflow: ellipsis;
}
.mt-p-datefield.is-empty:focus-within > input,
.mt-p-datefield.is-empty:focus-within > input::-webkit-datetime-edit { color: var(--mtp-text); }
.mt-p-datefield.is-empty:focus-within::before { opacity: 0; }

/* Native picker indicator: tidy size, and visible in dark mode */
.mt-p-datefield input::-webkit-calendar-picker-indicator { opacity: .75; cursor: pointer; margin-left: 4px; }
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1) brightness(1.4); }

/* ---- Task 2: date filters — equal heights, no overlap ---- */
.mt-p-filters .mt-p-datefield { flex: 1 1 auto; }
.mt-p-filters .mt-p-datefield > input[type="date"] { min-height: 44px; }

/* ---- Task 3: ticket-type rows (toggle left, price right) ---- */
.mt-p-tt {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	min-height: 56px;
}
.mt-p-tt__label { flex: 1 1 auto; min-width: 0; }
.mt-p-tt__price { flex: 0 0 auto; }
.mt-p-tt__price input {
	width: 110px;
	max-width: 40vw;
	min-height: 40px;
	box-sizing: border-box;
}

@media (max-width: 560px) {
	/* Stack the price neatly under the toggle, aligned past the switch */
	.mt-p-tt__price {
		flex: 1 1 100%;
		margin-top: 8px;
		padding-left: 58px;
		box-sizing: border-box;
	}
	.mt-p-tt__price input { width: 100%; max-width: 200px; }
}

/* ============================================================
   v1.6.1 — shared responsive form system
   Root cause of the mobile overflow: grid/flex items default to
   min-width:auto, so an intrinsically-wide native control (date,
   time, select) forces its 1fr track wider than the container.
   Fixing the shared wrappers corrects every affected section at
   once (Event Editor date/time, Orders date filters, selects).
   ============================================================ */
.mt-p-field { min-width: 0; }
.mt-p-filter { min-width: 0; }

/* No control may exceed the width of its field. */
.mt-p-field input,
.mt-p-field select,
.mt-p-field textarea,
.mt-p-select,
.mt-p-textarea,
.mt-p-datefield > input[type="date"],
.mt-p-datefield > input[type="time"] { max-width: 100%; }

/* Date/time + filter wrappers span the full field width. */
.mt-p-datefield { max-width: 100%; }
.mt-p-filter > .mt-p-datefield { width: 100%; }
.mt-p-filters .mt-p-datefield > input[type="date"] { width: 100%; box-sizing: border-box; }

/* ============================================================
   v1.7.7 — share toast
   ============================================================ */
.mt-p-toast {
	position: fixed;
	left: 50%;
	bottom: calc( 20px + env( safe-area-inset-bottom ) );
	transform: translate( -50%, 12px );
	z-index: 10000;
	max-width: calc( 100vw - 32px );
	padding: 12px 18px;
	border-radius: 12px;
	background: var(--mtp-text, #1a1a1a);
	color: var(--mtp-surface, #ffffff);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	box-shadow: 0 8px 30px rgba( 0, 0, 0, 0.28 );
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.mt-p-toast.is-visible {
	opacity: 1;
	transform: translate( -50%, 0 );
}

@media (prefers-reduced-motion: reduce) {
	.mt-p-toast {
		transition: opacity 0.25s ease;
		transform: translate( -50%, 0 );
	}
}

/* ============================================================
   v1.7.8 — desktop: keep event Actions on one row
   ============================================================ */
@media (min-width: 769px) {
	.mt-p-actions__inner {
		flex-wrap: nowrap;
		gap: 5px;
	}

	/* Slightly more compact so all actions (incl. Share) fit one line
	   within the same column width — no wider column, no page scroll. */
	.mt-p-actions .mt-p-btn {
		min-height: 34px;
		padding: 5px 8px;
		font-size: 12px;
		gap: 5px;
	}

	.mt-p-actions .mt-p-btn .mt-p-ico {
		width: 14px;
		height: 14px;
	}
}

/* ============================================================
   v1.8.0 — custom event image uploader
   ============================================================ */
.mt-p-thumb__replace {
	position: absolute;
	top: 4px;
	left: 4px;
	width: 22px;
	height: 22px;
	border: none;
	border-radius: 50%;
	background: rgba( 15, 23, 42, .72 );
	color: #fff;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.mt-p-thumb__replace .mt-p-ico { width: 13px; height: 13px; }
.mt-p-thumb__replace:hover { background: var(--mtp-primary); }
.mt-p-thumb__remove:hover { background: var(--mtp-danger, #dc2626); }

.mt-p-uploader {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-align: center;
	padding: 26px 18px;
	border: 2px dashed var(--mtp-border);
	border-radius: 14px;
	background: var(--mtp-surface-2);
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease;
}
.mt-p-uploader:hover,
.mt-p-uploader:focus-visible,
.mt-p-uploader.is-dragover {
	border-color: var(--mtp-primary);
	background: var(--mtp-surface);
	outline: none;
}
.mt-p-uploader__icon {
	display: inline-flex;
	width: 46px;
	height: 46px;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: var(--mtp-surface);
	color: var(--mtp-primary);
	border: 1px solid var(--mtp-border);
}
.mt-p-uploader__icon .mt-p-ico { width: 22px; height: 22px; }
.mt-p-uploader__title { font-weight: 600; color: var(--mtp-text); }
.mt-p-uploader__hint { font-size: 12.5px; color: var(--mtp-muted); }
.mt-p-uploader__btn { margin-top: 4px; pointer-events: none; }
.mt-p-uploader__progress {
	height: 6px;
	border-radius: 999px;
	background: var(--mtp-surface-2);
	border: 1px solid var(--mtp-border);
	overflow: hidden;
}
.mt-p-uploader__bar {
	display: block;
	height: 100%;
	width: 0;
	background: var(--mtp-primary);
	transition: width .15s ease;
}
.mt-p-uploader__error { margin: 0; font-size: 13px; color: var(--mtp-danger, #dc2626); }

@media (prefers-reduced-motion: reduce) {
	.mt-p-uploader,
	.mt-p-uploader__bar { transition: none; }
}
