/* =========================================================================
   TableEngine admin — design tokens & shared components
   ========================================================================= */
.tableengine-admin {
	--tf-bg: #f6f4f1;
	--tf-surface: #ffffff;
	--tf-surface-2: #faf8f5;
	--tf-border: #e7e2db;
	--tf-border-strong: #d6cfc5;
	--tf-text: #1c1917;
	--tf-text-2: #57534e;
	--tf-muted: #8a827a;
	--tf-primary: #c2410c;
	--tf-primary-600: #a8380a;
	--tf-primary-50: #fff4ed;
	--tf-primary-100: #ffe4d1;
	--tf-green: #16a34a;
	--tf-green-50: #ecfdf3;
	--tf-amber: #d97706;
	--tf-amber-50: #fffbeb;
	--tf-red: #dc2626;
	--tf-red-50: #fef2f2;
	--tf-blue: #2563eb;
	--tf-blue-50: #eff6ff;
	--tf-violet: #7c3aed;
	--tf-violet-50: #f5f3ff;
	--tf-radius: 10px;
	--tf-radius-lg: 14px;
	--tf-shadow-sm: 0 1px 2px rgba(28, 25, 23, .05);
	--tf-shadow: 0 1px 3px rgba(28, 25, 23, .06), 0 4px 16px rgba(28, 25, 23, .05);
	--tf-shadow-lg: 0 10px 40px rgba(28, 25, 23, .16);
	--tf-ring: 0 0 0 3px rgba(194, 65, 12, .18);
	background: var(--tf-bg);
}

.tableengine-admin #wpcontent {
	padding-left: 0;
}

.tableengine-admin #wpbody-content {
	padding-bottom: 40px;
}

.tableengine-admin .notice,
.tableengine-admin .update-nag {
	margin-left: 24px !important;
	margin-right: 24px !important;
}

.tf-wrap {
	margin: 0 !important;
	color: var(--tf-text);
	font-size: 13px;
}

.tf-wrap *,
.tf-wrap *::before,
.tf-wrap *::after {
	box-sizing: border-box;
}

/* ---------- Top bar ----------
 * One row: brand + page | navigation (fits the space; extra links go into "More") | actions.
 * It gets narrower step by step (container queries on the bar itself, so the WordPress
 * menu's width counts): brand name hidden, secondary actions become icons, then links move
 * into "More" (assets/js/admin-topbar.js). Below 782px the navigation gets its own row.
 */
.tf-topbar {
	position: sticky;
	top: 32px;
	z-index: 50;
	container: tf-topbar / inline-size;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 0 20px 0 24px;
	height: 60px;
	background: rgba(255, 255, 255, .92);
	backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--tf-border);
}

.tf-brand {
	flex: none;
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.tf-logo {
	flex: none;
	display: block;
	width: 32px;
	height: 32px;
	border-radius: 7px;
	box-shadow: 0 2px 6px rgba(15, 27, 43, .3);
}

.tf-brand-name {
	font-weight: 700;
	font-size: 15px;
	letter-spacing: -.01em;
	white-space: nowrap;
}

.tf-sep {
	color: var(--tf-border-strong);
	font-size: 18px;
}

.tf-page-title {
	font-size: 15px !important;
	font-weight: 600 !important;
	margin: 0 !important;
	padding: 0 !important;
	color: var(--tf-text-2);
	white-space: nowrap;
}

/* Navigation: as wide as its links, shrinking when space runs out; overflow goes into "More". */
.tf-topnav {
	flex: 0 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 2px;
	margin-left: 4px;
	overflow: hidden;
	/* Without JavaScript: scroll sideways instead of overflowing. */
	scrollbar-width: none;
}

.tf-topnav::-webkit-scrollbar {
	display: none;
}

.no-js .tf-topnav {
	overflow-x: auto;
}

.tf-topnav a,
.tf-topnav-more-btn {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 34px;
	padding: 0 12px;
	border: 0;
	border-radius: 8px;
	background: none;
	text-decoration: none;
	color: var(--tf-text-2);
	font: inherit;
	font-weight: 500;
	white-space: nowrap;
	cursor: pointer;
	transition: background .15s, color .15s;
}

.tf-topnav a:hover,
.tf-topnav-more-btn:hover,
.tf-topnav-more-btn[aria-expanded="true"] {
	background: var(--tf-surface-2);
	color: var(--tf-text);
}

.tf-topnav a.is-active,
.tf-topnav-more-btn.is-active {
	background: var(--tf-primary-50);
	color: var(--tf-primary);
}

.tf-topnav a:focus-visible,
.tf-topnav-more-btn:focus-visible,
.tf-topnav-menu a:focus-visible {
	box-shadow: var(--tf-ring);
	outline: none;
}

.tf-topnav-more {
	flex: none;
	position: relative;
	margin-left: -14px; /* right after the visible links (the bar's gap is 16px) */
}

.tf-topnav-more[hidden] {
	display: none;
}

.tf-topnav-more-btn .dashicons {
	width: 14px;
	height: 14px;
	font-size: 14px;
	transition: transform .15s;
}

.tf-topnav-more-btn[aria-expanded="true"] .dashicons {
	transform: rotate(180deg);
}

.tf-topnav-menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 60;
	display: grid;
	gap: 2px;
	min-width: 200px;
	padding: 6px;
	background: var(--tf-surface);
	border: 1px solid var(--tf-border);
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(28, 25, 23, .14), 0 2px 6px rgba(28, 25, 23, .06);
}

.tf-topnav-menu[hidden] {
	display: none;
}

.tf-topnav-menu a {
	display: flex;
	align-items: center;
	min-height: 36px;
	padding: 0 12px;
	border-radius: 8px;
	text-decoration: none;
	color: var(--tf-text);
	font-weight: 500;
	white-space: nowrap;
}

.tf-topnav-menu a:hover {
	background: var(--tf-surface-2);
	color: var(--tf-text);
}

.tf-topnav-menu a.is-active {
	background: var(--tf-primary-50);
	color: var(--tf-primary);
}

/* Actions: never squeezed; secondary ones turn into icons when space is short. */
.tf-topbar-actions {
	flex: none;
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 8px;
}

.tf-topbar-actions .tf-btn .dashicons {
	flex: none;
}

@container tf-topbar (max-width: 1400px) {
	.tf-brand-name,
	.tf-sep {
		display: none;
	}
}

@container tf-topbar (max-width: 1320px) {
	/* Icon-only secondary actions (the label stays for screen readers and as a tooltip). */
	.tf-topbar-actions .tf-btn:not(.tf-btn-primary):has(.dashicons) {
		width: 36px;
		padding: 0;
		gap: 0;
		font-size: 0;
	}

	.tf-topbar-actions .tf-btn:not(.tf-btn-primary):has(.dashicons) .dashicons {
		width: 18px;
		height: 18px;
		font-size: 18px;
	}

	.tf-topbar-actions select {
		max-width: 150px;
	}
}

@media (max-width: 782px) {
	.tf-topbar {
		top: 46px;
		position: static;
		flex-wrap: wrap;
		height: auto;
		gap: 10px 12px;
		padding: 12px 16px 8px;
	}

	/* Brand and actions on the first row, navigation on its own row below. */
	.tf-topnav {
		order: 3;
		flex: 1 1 calc(100% - 110px); /* its own row, with room for "More" */
		margin-left: -8px;
	}

	.tf-topnav-more {
		order: 4;
	}

	.tf-topnav-menu {
		left: auto;
		right: 0;
	}

	/* Actions get their own row: icon buttons, then whatever stretches (e.g. a location picker), primary last. */
	.tf-topbar-actions {
		order: 2;
		flex: 1 1 100%;
		min-width: 0;
		margin-left: 0;
	}

	.tf-topbar-actions > form,
	.tf-topbar-actions > label {
		flex: 1 1 auto;
		min-width: 0;
	}

	.tf-topbar-actions select {
		width: 100%;
		min-width: 0;
		max-width: none;
	}

	.tf-topbar-actions .tf-btn-primary {
		margin-left: auto;
	}
}

@container tf-topbar (max-width: 520px) {
	/* Very narrow: the primary action becomes an icon too. */
	.tf-topbar-actions .tf-btn-primary:has(.dashicons) {
		width: 36px;
		padding: 0;
		gap: 0;
		font-size: 0;
	}

	.tf-topbar-actions .tf-btn-primary:has(.dashicons) .dashicons {
		width: 20px;
		height: 20px;
		font-size: 20px;
	}
}

/* ---------- Buttons ---------- */
.tf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 36px;
	padding: 0 14px;
	border-radius: 9px;
	border: 1px solid var(--tf-border-strong);
	background: var(--tf-surface);
	color: var(--tf-text);
	font: inherit;
	font-weight: 600;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
	box-shadow: var(--tf-shadow-sm);
	transition: background .15s, border-color .15s, box-shadow .15s, transform .05s, color .15s;
	white-space: nowrap;
}

.tf-btn:hover {
	background: var(--tf-surface-2);
	border-color: var(--tf-muted);
	color: var(--tf-text);
}

.tf-btn:active {
	transform: translateY(1px);
}

.tf-btn:focus-visible {
	outline: none;
	box-shadow: var(--tf-ring);
}

.tf-btn:disabled {
	opacity: .5;
	cursor: not-allowed;
}

.tf-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.tf-btn-primary {
	background: var(--tf-primary);
	border-color: var(--tf-primary);
	color: #fff;
}

.tf-btn-primary:hover {
	background: var(--tf-primary-600);
	border-color: var(--tf-primary-600);
	color: #fff;
}

.tf-btn-ghost {
	background: transparent;
	border-color: transparent;
	box-shadow: none;
	color: var(--tf-text-2);
}

.tf-btn-ghost:hover {
	background: rgba(28, 25, 23, .05);
	border-color: transparent;
}

.tf-btn-danger {
	background: var(--tf-red);
	border-color: var(--tf-red);
	color: #fff;
}

.tf-btn-danger:hover {
	background: #b91c1c;
	border-color: #b91c1c;
	color: #fff;
}

.tf-btn-danger-ghost {
	color: var(--tf-red);
}

.tf-btn-danger-ghost:hover {
	background: var(--tf-red-50);
	border-color: #fecaca;
	color: var(--tf-red);
}

.tf-btn-sm {
	height: 30px;
	padding: 0 10px;
	font-size: 12px;
	border-radius: 8px;
}

.tf-icon-btn {
	display: inline-grid;
	place-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	border: 1px solid transparent;
	background: transparent;
	color: var(--tf-text-2);
	cursor: pointer;
}

.tf-icon-btn:hover {
	background: var(--tf-surface-2);
	border-color: var(--tf-border);
	color: var(--tf-text);
}

/* ---------- Switch ---------- */
.tf-switch {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	flex: none;
	width: 38px !important;
	height: 22px !important;
	margin: 0 !important;
	border-radius: 999px !important;
	background: #d6d3d1 !important;
	border: 0 !important;
	cursor: pointer;
	box-shadow: none !important;
	transition: background .2s;
}

.tf-switch::before {
	content: '' !important;
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px !important;
	height: 16px !important;
	margin: 0 !important;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
	transition: transform .2s cubic-bezier(.3, 1.4, .6, 1);
}

.tf-switch:checked {
	background: var(--tf-primary) !important;
}

.tf-switch:checked::before {
	transform: translateX(16px);
}

.tf-switch:focus-visible {
	box-shadow: var(--tf-ring) !important;
	outline: none;
}

.tf-switch-sm {
	width: 32px !important;
	height: 18px !important;
}

.tf-switch-sm::before {
	width: 12px !important;
	height: 12px !important;
}

.tf-switch-sm:checked::before {
	transform: translateX(14px);
}

/* ---------- Form controls ---------- */
.tf-wrap input[type="text"],
.tf-wrap input[type="email"],
.tf-wrap input[type="url"],
.tf-wrap input[type="number"],
.tf-wrap input[type="password"],
.tf-wrap input[type="search"],
.tf-wrap input[type="date"],
.tf-wrap input[type="time"],
.tf-wrap select,
.tf-wrap textarea,
.tf-modal input[type="text"],
.tf-modal input[type="email"],
.tf-modal input[type="number"],
.tf-modal input[type="date"],
.tf-modal input[type="time"],
.tf-modal select,
.tf-modal textarea,
.tf-drawer input,
.tf-drawer select,
.tf-drawer textarea {
	border: 1px solid var(--tf-border-strong);
	border-radius: 8px;
	background: #fff;
	color: var(--tf-text);
	min-height: 36px;
	padding: 6px 10px;
	font-size: 13px;
	box-shadow: none;
	max-width: 100%;
	transition: border-color .15s, box-shadow .15s;
}

.tf-wrap select,
.tf-modal select,
.tf-drawer select {
	padding-right: 28px;
}

.tf-wrap input:focus,
.tf-wrap select:focus,
.tf-wrap textarea:focus,
.tf-modal input:focus,
.tf-modal select:focus,
.tf-modal textarea:focus,
.tf-drawer input:focus,
.tf-drawer select:focus,
.tf-drawer textarea:focus {
	border-color: var(--tf-primary);
	box-shadow: var(--tf-ring);
	outline: none;
}

/* ---------- Generic ---------- */
.tf-card {
	background: var(--tf-surface);
	border: 1px solid var(--tf-border);
	border-radius: var(--tf-radius-lg);
	box-shadow: var(--tf-shadow-sm);
}

.tf-warn-text {
	color: var(--tf-amber);
	font-weight: 500;
}

.tf-muted {
	color: var(--tf-muted);
}

.tf-loading {
	display: grid;
	place-items: center;
	min-height: 50vh;
}

.tf-spinner {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 3px solid var(--tf-border);
	border-top-color: var(--tf-primary);
	animation: tf-spin .8s linear infinite;
	display: inline-block;
}

@keyframes tf-spin {
	to {
		transform: rotate(360deg);
	}
}

.tf-empty {
	text-align: center;
	padding: 60px 20px;
	color: var(--tf-text-2);
}

.tf-empty h3 {
	font-size: 16px;
	margin: 10px 0 4px;
	color: var(--tf-text);
}

.tf-empty .dashicons {
	font-size: 40px;
	width: 40px;
	height: 40px;
	color: var(--tf-border-strong);
}

kbd {
	background: var(--tf-surface-2);
	border: 1px solid var(--tf-border);
	border-bottom-width: 2px;
	border-radius: 5px;
	padding: 1px 6px;
	font-size: 11px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Pills ---------- */
.tf-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	height: 22px;
	padding: 0 9px;
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 600;
	white-space: nowrap;
	background: #f1efec;
	color: var(--tf-text-2);
}

.tf-pill::before {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
	opacity: .85;
}

.tf-pill-confirmed,
.tf-pill-paid,
.tf-pill-processed {
	background: var(--tf-green-50);
	color: #15803d;
}

.tf-pill-pending,
.tf-pill-unpaid,
.tf-pill-processing {
	background: var(--tf-amber-50);
	color: #b45309;
}

.tf-pill-pending_payment {
	background: var(--tf-violet-50);
	color: var(--tf-violet);
}

.tf-pill-seated {
	background: var(--tf-blue-50);
	color: var(--tf-blue);
}

.tf-pill-completed {
	background: #f1f5f9;
	color: #475569;
}

.tf-pill-cancelled,
.tf-pill-failed,
.tf-pill-no_show {
	background: var(--tf-red-50);
	color: #b91c1c;
}

.tf-pill-expired,
.tf-pill-refunded,
.tf-pill-partially_refunded,
.tf-pill-unmatched,
.tf-pill-none {
	background: #f4f4f5;
	color: #71717a;
}

/* ---------- Toasts ---------- */
.tf-toasts {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 100100;
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: center;
	pointer-events: none;
}

.tf-toast {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 11px 16px;
	border-radius: 12px;
	background: #1c1917;
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	box-shadow: var(--tf-shadow-lg);
	opacity: 0;
	transform: translateY(10px) scale(.98);
	transition: opacity .25s, transform .25s cubic-bezier(.2, 1.2, .4, 1);
}

.tf-toast.is-in {
	opacity: 1;
	transform: none;
}

.tf-toast .dashicons {
	color: #4ade80;
}

.tf-toast-error .dashicons {
	color: #f87171;
}

/* ---------- Modal ---------- */
.tf-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100050;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(28, 25, 23, .45);
	backdrop-filter: blur(2px);
	opacity: 0;
	transition: opacity .18s;
}

.tf-modal-overlay.is-open {
	opacity: 1;
}

.tf-modal {
	width: 100%;
	max-width: 440px;
	background: #fff;
	border-radius: 16px;
	padding: 24px;
	box-shadow: var(--tf-shadow-lg);
	transform: translateY(8px) scale(.98);
	transition: transform .2s cubic-bezier(.2, 1.2, .4, 1);
	font-size: 13px;
	color: var(--tf-text);
}

.tf-modal-overlay.is-open .tf-modal {
	transform: none;
}

.tf-modal h3 {
	margin: 0 0 8px;
	font-size: 17px;
}

.tf-modal-body {
	color: var(--tf-text-2);
	line-height: 1.55;
}

.tf-modal-body p {
	margin: 0 0 10px;
}

.tf-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 20px;
}

/* =========================================================================
   Settings
   ========================================================================= */
.tf-settings {
	display: grid;
	grid-template-columns: 240px minmax(0, 1fr);
	gap: 28px;
	padding: 28px 24px 0;
	max-width: 1180px;
}

@media (max-width: 960px) {
	.tf-settings {
		grid-template-columns: 1fr;
	}
}

.tf-settings-nav {
	position: sticky;
	top: 112px;
	align-self: start;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

@media (max-width: 960px) {
	.tf-settings-nav {
		position: static;
		flex-direction: row;
		flex-wrap: wrap;
	}

	.tf-settings-search {
		width: 100%;
	}
}

.tf-settings-search {
	position: relative;
	margin-bottom: 10px;
}

.tf-settings-search .dashicons {
	position: absolute;
	left: 10px;
	top: 9px;
	color: var(--tf-muted);
	font-size: 18px;
}

.tf-settings-search input {
	width: 100%;
	padding-left: 34px !important;
	border-radius: 10px !important;
}

.tf-upsell {
	margin-top: 16px;
	padding: 14px;
	border: 1px solid var(--tf-border);
	border-radius: var(--tf-radius);
	background: var(--tf-surface);
	font-size: 12.5px;
	color: var(--tf-text-2);
}

.tf-upsell strong {
	display: block;
	color: var(--tf-text);
	font-size: 13px;
}

.tf-upsell p {
	margin: 4px 0 10px;
	line-height: 1.45;
}

@media (max-width: 960px) {
	.tf-upsell {
		display: none;
	}
}

.tf-settings-tab {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	border-radius: 9px;
	color: var(--tf-text-2);
	text-decoration: none;
	font-weight: 500;
	font-size: 13.5px;
	transition: background .15s, color .15s;
}

.tf-settings-tab .dashicons {
	font-size: 17px;
	width: 17px;
	height: 17px;
	color: var(--tf-muted);
	transition: color .15s;
}

.tf-settings-tab:hover {
	background: rgba(28, 25, 23, .04);
	color: var(--tf-text);
}

.tf-settings-tab.is-active {
	background: #fff;
	color: var(--tf-text);
	box-shadow: var(--tf-shadow-sm), inset 0 0 0 1px var(--tf-border);
	font-weight: 600;
}

.tf-settings-tab.is-active .dashicons {
	color: var(--tf-primary);
}

.tf-settings-tab:focus {
	outline: none;
	box-shadow: var(--tf-ring);
}

.tf-settings-tab.is-match::after {
	content: '';
	width: 6px;
	height: 6px;
	margin-left: auto;
	border-radius: 50%;
	background: var(--tf-primary);
}

.tf-settings-panel {
	display: none;
	animation: tf-fade .2s ease;
}

.tf-settings-panel.is-active,
.tf-settings.is-searching .tf-settings-panel {
	display: block;
}

.tf-settings.is-searching .tf-panel-head {
	display: none;
}

@keyframes tf-fade {
	from {
		opacity: 0;
		transform: translateY(4px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

.tf-panel-head h2 {
	font-size: 22px;
	font-weight: 700;
	margin: 2px 0 18px;
	letter-spacing: -.02em;
}

.tf-settings-panel .tf-card {
	margin-bottom: 18px;
	overflow: hidden;
}

.tf-card-head {
	padding: 18px 22px 0;
}

.tf-card-head h3 {
	margin: 0;
	font-size: 14.5px;
	font-weight: 650;
}

.tf-card-head p {
	margin: 4px 0 0;
	color: var(--tf-muted);
	font-size: 12.5px;
	line-height: 1.5;
}

.tf-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px 24px;
	padding: 18px 22px 22px;
}

@media (max-width: 680px) {
	.tf-fields {
		grid-template-columns: 1fr;
	}
}

.tf-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.tf-field.is-wide,
.tf-field-toggle {
	grid-column: 1 / -1;
}

.tf-field.is-hidden-by-dep,
.tf-field.is-search-hidden {
	display: none;
}

.tf-card.is-search-hidden {
	display: none;
}

.tf-label {
	font-weight: 600;
	font-size: 12.5px;
	color: var(--tf-text);
}

.tf-help {
	margin: 0;
	color: var(--tf-muted);
	font-size: 12px;
	line-height: 1.5;
}

.tf-control input[type="text"],
.tf-control input[type="email"],
.tf-control input[type="url"],
.tf-control input[type="password"],
.tf-control select,
.tf-control textarea {
	width: 100%;
}

.tf-control input[type="number"] {
	width: 140px;
}

.tf-control textarea {
	line-height: 1.5;
	resize: vertical;
}

.tf-control textarea.tf-code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 12px;
	background: #fbfaf8;
}

.tf-toggle-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 14px;
	margin: 0 -14px;
	border-radius: 10px;
	cursor: pointer;
	transition: background .15s;
}

.tf-toggle-row:hover {
	background: var(--tf-surface-2);
}

.tf-label-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.tf-field-toggle+.tf-field-toggle {
	margin-top: -14px;
}

.tf-input-affix {
	display: inline-flex;
	align-items: stretch;
}

.tf-input-affix span {
	display: grid;
	place-items: center;
	padding: 0 10px;
	border: 1px solid var(--tf-border-strong);
	border-right: 0;
	border-radius: 8px 0 0 8px;
	background: var(--tf-surface-2);
	color: var(--tf-muted);
	font-weight: 600;
	font-size: 12px;
}

.tf-input-affix input {
	border-radius: 0 8px 8px 0 !important;
}

.tf-secret {
	position: relative;
}

.tf-secret input {
	padding-right: 80px !important;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tf-secret-state {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 11px;
	font-weight: 600;
	color: var(--tf-muted);
	background: #f4f4f5;
	padding: 2px 8px;
	border-radius: 999px;
}

.tf-secret-state.is-set {
	color: #15803d;
	background: var(--tf-green-50);
}

.tf-control .wp-picker-container .wp-color-result.button {
	height: 32px;
	border-radius: 8px;
}

/* Weekly hours */
.tf-hours {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--tf-border);
	border-radius: 12px;
	overflow: hidden;
}

.tf-hours-row {
	display: grid;
	grid-template-columns: 150px 1fr auto;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	border-top: 1px solid var(--tf-border);
	background: #fff;
}

.tf-hours-row:first-child {
	border-top: 0;
}

.tf-hours-row.is-closed {
	background: var(--tf-surface-2);
}

.tf-hours-day {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
	cursor: pointer;
}

.tf-hours-ranges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tf-hours-closed {
	display: none;
	color: var(--tf-muted);
	font-style: italic;
}

.tf-hours-row.is-closed .tf-hours-ranges,
.tf-hours-row.is-closed [data-hours-add] {
	display: none;
}

.tf-hours-row.is-closed .tf-hours-closed {
	display: block;
}

.tf-range {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px;
	border: 1px solid var(--tf-border);
	border-radius: 10px;
	background: var(--tf-surface-2);
}

.tf-range input[type="time"] {
	min-height: 30px !important;
	padding: 2px 6px !important;
	border: 0 !important;
	background: transparent !important;
	width: 104px;
}

.tf-range input[type="time"]:focus {
	box-shadow: var(--tf-ring) !important;
}

.tf-range-sep {
	color: var(--tf-muted);
}

.tf-range .tf-icon-btn {
	width: 24px;
	height: 24px;
}

.tf-range .tf-icon-btn .dashicons {
	font-size: 15px;
	width: 15px;
	height: 15px;
}

@media (max-width: 680px) {
	.tf-hours-row {
		grid-template-columns: 1fr auto;
	}

	.tf-hours-ranges,
	.tf-hours-closed {
		grid-column: 1 / -1;
	}
}

/* Webhook */
.tf-webhook {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px;
	border-radius: 12px;
	background: var(--tf-surface-2);
	border: 1px dashed var(--tf-border-strong);
}

.tf-copy {
	display: flex;
	gap: 8px;
	align-items: center;
}

.tf-copy code {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding: 8px 10px;
	border-radius: 8px;
	background: #fff;
	border: 1px solid var(--tf-border);
	font-size: 12px;
}

.tf-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.tf-chip {
	padding: 3px 8px !important;
	border-radius: 6px;
	background: #fff !important;
	border: 1px solid var(--tf-border);
	font-size: 11.5px !important;
}

.tf-webhook-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.tf-test-ok {
	color: #15803d;
	font-weight: 600;
}

.tf-test-err {
	color: var(--tf-red);
	font-weight: 600;
}

.tf-events summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--tf-text-2);
}

.tf-events table {
	width: 100%;
	margin-top: 8px;
	border-collapse: collapse;
	font-size: 12px;
}

.tf-events td {
	padding: 6px 4px;
	border-top: 1px solid var(--tf-border);
}

/* Save bar */
.tf-savebar {
	position: sticky;
	bottom: 0;
	z-index: 20;
	margin: 8px -4px 0;
	padding: 14px 4px 18px;
	background: linear-gradient(to bottom, rgba(246, 244, 241, 0), var(--tf-bg) 40%);
}

.tf-savebar-inner {
	display: flex;
	align-items: center;
	gap: 10px;
	justify-content: flex-end;
	padding: 10px 12px 10px 18px;
	background: #fff;
	border: 1px solid var(--tf-border);
	border-radius: 14px;
	box-shadow: var(--tf-shadow);
}

.tf-savebar-msg {
	margin-right: auto;
	color: var(--tf-muted);
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 6px;
}

.tf-savebar.is-dirty .tf-savebar-inner {
	border-color: var(--tf-primary-100);
	box-shadow: 0 0 0 3px var(--tf-primary-50), var(--tf-shadow);
}

.tf-savebar.is-dirty .tf-savebar-msg {
	color: var(--tf-primary);
}

.tf-saved-flash {
	color: #15803d;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	animation: tf-fade .3s;
}

.tf-btn.is-confirming {
	background: var(--tf-red-50);
	color: var(--tf-red);
	border-color: #fecaca;
}

/* =========================================================================
   Reservations dashboard
   ========================================================================= */
.tfr {
	padding: 24px;
	max-width: 1480px;
}

.tfr-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: 18px;
}

.tfr-datenav {
	display: flex;
	align-items: center;
	gap: 6px;
}

.tfr-datenav .tf-btn {
	padding: 0 10px;
}

.tfr-date-title {
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -.02em;
	margin: 0 6px;
	min-width: 0;
}

.tfr-date-title small {
	display: block;
	font-size: 12px;
	color: var(--tf-muted);
	font-weight: 500;
	letter-spacing: 0;
}

.tfr-range {
	display: inline-flex;
	padding: 3px;
	gap: 2px;
	border-radius: 10px;
	background: #ece8e2;
}

.tfr-range button {
	border: 0;
	background: transparent;
	padding: 6px 12px;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 600;
	font-size: 12.5px;
	color: var(--tf-text-2);
}

.tfr-range button.is-on {
	background: #fff;
	color: var(--tf-text);
	box-shadow: var(--tf-shadow-sm);
}

.tfr-spacer {
	flex: 1;
}

.tfr-search {
	position: relative;
}

.tfr-search .dashicons {
	position: absolute;
	left: 9px;
	top: 9px;
	color: var(--tf-muted);
	font-size: 18px;
}

.tfr-search input {
	padding-left: 32px !important;
	width: 240px;
	border-radius: 10px !important;
}

.tfr-stats {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 18px;
}

@media (max-width: 1100px) {
	.tfr-stats {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 600px) {
	.tfr-stats {
		grid-template-columns: repeat(2, 1fr);
	}
}

.tfr-stat {
	padding: 14px 16px;
	background: #fff;
	border: 1px solid var(--tf-border);
	border-radius: 14px;
	box-shadow: var(--tf-shadow-sm);
}

.tfr-stat-label {
	font-size: 12px;
	color: var(--tf-muted);
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 6px;
}

.tfr-stat-label .dashicons {
	font-size: 15px;
	width: 15px;
	height: 15px;
}

.tfr-stat-value {
	font-size: 24px;
	font-weight: 700;
	margin-top: 4px;
	letter-spacing: -.02em;
}

.tfr-stat-sub {
	font-size: 12px;
	color: var(--tf-muted);
	margin-top: 2px;
}

.tfr-meter {
	height: 6px;
	border-radius: 999px;
	background: #f1ede8;
	margin-top: 8px;
	overflow: hidden;
}

.tfr-meter span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--tf-primary), #f97316);
	transition: width .4s;
}

.tfr-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}

.tfr-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 30px;
	padding: 0 12px;
	border-radius: 999px;
	border: 1px solid var(--tf-border);
	background: #fff;
	cursor: pointer;
	font-weight: 600;
	font-size: 12px;
	color: var(--tf-text-2);
}

.tfr-chip:hover {
	border-color: var(--tf-border-strong);
}

.tfr-chip.is-on {
	background: var(--tf-text);
	color: #fff;
	border-color: var(--tf-text);
}

.tfr-chip b {
	font-weight: 700;
	opacity: .65;
}

.tfr-board {
	background: #fff;
	border: 1px solid var(--tf-border);
	border-radius: 16px;
	box-shadow: var(--tf-shadow-sm);
	overflow: hidden;
}

.tfr-table {
	width: 100%;
	border-collapse: collapse;
}

.tfr-table th {
	text-align: left;
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--tf-muted);
	font-weight: 600;
	padding: 12px 14px;
	background: var(--tf-surface-2);
	border-bottom: 1px solid var(--tf-border);
	white-space: nowrap;
}

.tfr-table td {
	padding: 12px 14px;
	border-bottom: 1px solid #f1ede8;
	vertical-align: middle;
}

.tfr-table tbody tr {
	cursor: pointer;
	transition: background .12s;
}

.tfr-table tbody tr:hover {
	background: #fdfbf9;
}

.tfr-table tbody tr.is-open {
	background: var(--tf-primary-50);
}

.tfr-table tbody tr:last-child td {
	border-bottom: 0;
}

.tfr-group-row td {
	background: var(--tf-surface-2);
	font-weight: 700;
	font-size: 12px;
	color: var(--tf-text-2);
	padding: 8px 14px;
	cursor: default;
}

.tfr-time {
	font-weight: 700;
	font-size: 14px;
	white-space: nowrap;
}

.tfr-time small {
	display: block;
	color: var(--tf-muted);
	font-weight: 500;
	font-size: 11.5px;
}

.tfr-guest {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.tfr-avatar {
	flex: none;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-weight: 700;
	font-size: 12.5px;
	color: #fff;
}

.tfr-guest-name {
	font-weight: 600;
	color: var(--tf-text);
}

.tfr-guest-meta {
	color: var(--tf-muted);
	font-size: 12px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 240px;
}

.tfr-party {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-weight: 700;
}

.tfr-party .dashicons {
	font-size: 15px;
	width: 15px;
	height: 15px;
	color: var(--tf-muted);
}

.tfr-table-tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	border-radius: 7px;
	background: #f4f1ed;
	font-weight: 600;
	font-size: 12px;
}

.tfr-table-tag.is-none {
	background: transparent;
	color: var(--tf-muted);
	font-weight: 500;
}

.tfr-flags {
	display: flex;
	gap: 4px;
	color: var(--tf-muted);
}

.tfr-flags .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.tfr-quick {
	display: flex;
	gap: 4px;
	justify-content: flex-end;
	opacity: .0;
	transition: opacity .15s;
}

.tfr-table tbody tr:hover .tfr-quick,
.tfr-table tbody tr:focus-within .tfr-quick {
	opacity: 1;
}

@media (hover: none) {
	.tfr-quick {
		opacity: 1;
	}
}

.tfr-ref {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 11.5px;
	color: var(--tf-muted);
}

@media (max-width: 900px) {
	.tfr-hide-md {
		display: none;
	}
}

@media (max-width: 640px) {
	.tfr-hide-sm {
		display: none;
	}

	.tfr-search input {
		width: 100%;
	}

	.tfr-search {
		flex: 1;
	}
}

/* Drawer */
.tf-drawer-overlay {
	position: fixed;
	inset: 0;
	z-index: 100040;
	background: rgba(28, 25, 23, .3);
	opacity: 0;
	transition: opacity .2s;
}

.tf-drawer-overlay.is-open {
	opacity: 1;
}

.tf-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 100045;
	width: min(480px, 100vw);
	background: #fff;
	box-shadow: var(--tf-shadow-lg);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform .28s cubic-bezier(.2, .9, .3, 1);
	font-size: 13px;
	color: var(--tf-text);
}

.tf-drawer.is-open {
	transform: none;
}

.tf-drawer-head {
	padding: 20px 22px 16px;
	border-bottom: 1px solid var(--tf-border);
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.tf-drawer-head h2 {
	margin: 0;
	font-size: 18px;
	letter-spacing: -.01em;
}

.tf-drawer-head .tfr-ref {
	display: block;
	margin-top: 4px;
}

.tf-drawer-close {
	margin-left: auto;
}

.tf-drawer-body {
	flex: 1;
	overflow: auto;
	padding: 18px 22px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.tf-drawer-foot {
	padding: 14px 22px;
	border-top: 1px solid var(--tf-border);
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	background: var(--tf-surface-2);
}

.tf-drawer-foot .tf-btn-primary {
	margin-left: auto;
}

.tf-status-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.tf-status-btn {
	border: 1px solid var(--tf-border);
	background: #fff;
	border-radius: 999px;
	padding: 6px 12px;
	cursor: pointer;
	font-weight: 600;
	font-size: 12px;
	color: var(--tf-text-2);
}

.tf-status-btn:hover {
	border-color: var(--tf-border-strong);
	color: var(--tf-text);
}

.tf-status-btn.is-on {
	background: var(--tf-text);
	border-color: var(--tf-text);
	color: #fff;
}

.tf-dl {
	display: grid;
	grid-template-columns: 110px 1fr;
	gap: 8px 12px;
	margin: 0;
}

.tf-dl dt {
	color: var(--tf-muted);
	font-weight: 500;
}

.tf-dl dd {
	margin: 0;
	font-weight: 500;
	word-break: break-word;
}

.tf-section-title {
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--tf-muted);
	font-weight: 700;
	margin: 0 0 10px;
}

.tf-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.tf-form-grid .is-wide {
	grid-column: 1 / -1;
}

.tf-form-grid label {
	display: flex;
	flex-direction: column;
	gap: 5px;
	font-weight: 600;
	font-size: 12px;
}

.tf-form-grid input,
.tf-form-grid select,
.tf-form-grid textarea {
	width: 100%;
}

.tf-check-inline {
	display: flex !important;
	flex-direction: row !important;
	align-items: center;
	gap: 8px;
	font-weight: 500 !important;
}

.tf-pay-box {
	padding: 14px;
	border-radius: 12px;
	border: 1px solid var(--tf-border);
	background: var(--tf-surface-2);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tf-pay-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.tf-amount {
	font-size: 18px;
	font-weight: 700;
}

.tf-timeline {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 12px;
}

.tf-timeline li {
	display: flex;
	gap: 8px;
	align-items: center;
	color: var(--tf-text-2);
}

.tf-timeline code {
	font-size: 11px;
}

.tf-notes-internal {
	white-space: pre-wrap;
	background: var(--tf-amber-50);
	border: 1px solid #fde68a;
	padding: 10px 12px;
	border-radius: 10px;
}

.tf-field-error {
	color: var(--tf-red);
	font-size: 12px;
	font-weight: 500;
}

.tf-alert {
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--tf-amber-50);
	color: #92400e;
	border: 1px solid #fde68a;
}

.tf-alert.is-error {
	background: var(--tf-red-50);
	color: #991b1b;
	border-color: #fecaca;
}

/* Timeline view */
.tfr-timeline {
	overflow-x: auto;
}

.tfr-tl {
	position: relative;
	min-width: 900px;
}

.tfr-tl-head,
.tfr-tl-row {
	display: grid;
	grid-template-columns: 120px 1fr;
}

.tfr-tl-head {
	position: sticky;
	top: 0;
	background: var(--tf-surface-2);
	border-bottom: 1px solid var(--tf-border);
	z-index: 2;
}

.tfr-tl-hours {
	position: relative;
	height: 34px;
}

.tfr-tl-hours span {
	position: absolute;
	top: 9px;
	transform: translateX(-50%);
	font-size: 11px;
	color: var(--tf-muted);
	font-weight: 600;
}

.tfr-tl-label {
	padding: 8px 14px;
	font-weight: 600;
	font-size: 12px;
	border-right: 1px solid var(--tf-border);
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.tfr-tl-label small {
	color: var(--tf-muted);
	font-weight: 500;
}

.tfr-tl-row {
	border-bottom: 1px solid #f1ede8;
	min-height: 46px;
}

.tfr-tl-lane {
	position: relative;
	background-image: linear-gradient(to right, #f3efe9 1px, transparent 1px);
}

.tfr-tl-block {
	position: absolute;
	top: 6px;
	bottom: 6px;
	border-radius: 8px;
	padding: 4px 8px;
	overflow: hidden;
	cursor: pointer;
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1.25;
	color: #14532d;
	background: #dcfce7;
	border: 1px solid #86efac;
	white-space: nowrap;
	text-overflow: ellipsis;
	transition: transform .1s, box-shadow .1s;
}

.tfr-tl-block:hover {
	box-shadow: var(--tf-shadow);
	transform: translateY(-1px);
	z-index: 1;
}

.tfr-tl-block small {
	display: block;
	font-weight: 500;
	opacity: .8;
}

.tfr-tl-block.s-pending {
	background: #fef3c7;
	border-color: #fcd34d;
	color: #78350f;
}

.tfr-tl-block.s-pending_payment {
	background: #ede9fe;
	border-color: #c4b5fd;
	color: #4c1d95;
}

.tfr-tl-block.s-seated {
	background: #dbeafe;
	border-color: #93c5fd;
	color: #1e3a8a;
}

.tfr-tl-block.s-completed {
	background: #f1f5f9;
	border-color: #cbd5e1;
	color: #334155;
}

.tfr-tl-now {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 2px;
	background: var(--tf-red);
	z-index: 3;
	pointer-events: none;
}

.tfr-tl-now::before {
	content: '';
	position: absolute;
	top: -4px;
	left: -4px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--tf-red);
}

.tfr-pager {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	padding: 14px;
	border-top: 1px solid var(--tf-border);
}