/**
 * Unified Booking list takeover — presentation parity only.
 * Reuses native .cwb-booking-card grid/typography from caribico-ui.css.
 * Unified-owned OPEN sizing: Hotel (.cwb-view-booking) and Transfer
 * (.cwb-un-open-booking) share identical compact button metrics.
 * Transfer keeps .cwb-un-open-booking (not .cwb-view-booking) so WebBeds
 * loadBookingDetail click handler does not fire.
 * Compact 30px / 0 20px / 10px beats WebBeds responsive (40px on ≤760/coarse).
 *
 * v0.3.20 — real remaining cause of the visual mismatch: <button> and <a>
 * use different default font-family in every browser. Form controls
 * (button/input/select/textarea) do NOT inherit font-family from the page
 * per the UA stylesheet — they render in the OS/browser's default UI font
 * unless a rule explicitly overrides it. .caribico-wb-btn never sets
 * font-family. So Hotel's <button> was rendering in the system UI font
 * while Transfer's <a> (which DOES inherit) rendered in the page's Inter
 * stack — same font-size/font-weight number, visibly different letterforms
 * and perceived weight. All previous box-model fixes (height/padding/width)
 * were correct but could never fix this, because font-family is a separate
 * property none of them touched.
 */
.cwb-agent-bookings .cwb-booking-card-actions .cwb-view-booking,
.cwb-agent-bookings .cwb-booking-card-actions .cwb-un-open-booking {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-width: 72px !important;
	min-height: 30px !important;
	height: 30px !important;
	padding: 0 20px !important;
	font-family: inherit !important;
	font-size: 10px !important;
	font-weight: 700 !important;
	letter-spacing: 0.03em !important;
	text-transform: uppercase !important;
	text-decoration: none;
	line-height: 1.2 !important;
	border-radius: 8px !important;
}

@media (max-width: 800px) {
	.cwb-agent-bookings .cwb-booking-card-actions .cwb-view-booking,
	.cwb-agent-bookings .cwb-booking-card-actions .cwb-un-open-booking {
		width: 100% !important;
	}
}

/* Override WebBeds responsive.css OPEN growth — stay compact for both sources */
@media (max-width: 760px), (pointer: coarse) {
	.cwb-agent-bookings .cwb-booking-card-actions .cwb-view-booking,
	.cwb-agent-bookings .cwb-booking-card .cwb-view-booking,
	.cwb-agent-bookings .cwb-booking-card-actions .cwb-un-open-booking,
	.cwb-agent-bookings .cwb-booking-card .cwb-un-open-booking {
		min-height: 30px !important;
		height: 30px !important;
		padding: 0 20px !important;
		font-family: inherit !important;
		font-size: 10px !important;
		line-height: 1.2 !important;
		box-sizing: border-box;
	}
}

@media (max-width: 760px) {
	.cwb-agent-bookings .cwb-booking-card-actions .cwb-view-booking,
	.cwb-agent-bookings .cwb-booking-card .cwb-view-booking,
	.cwb-agent-bookings .cwb-booking-card-actions .cwb-un-open-booking,
	.cwb-agent-bookings .cwb-booking-card .cwb-un-open-booking {
		min-height: 30px !important;
		height: 30px !important;
		padding: 0 20px !important;
		font-family: inherit !important;
		font-size: 10px !important;
		line-height: 1.2 !important;
		box-sizing: border-box;
	}
}

/* Unified two-row filter panel (ТЗ base + explicit wrap into 2 rows on request). */
.cwb-agent-bookings .cwb-bookings-toolbar.has-unified-filters {
	position: relative !important;
	display: flex !important;
	flex-direction: column !important;
	gap: 10px !important;
	padding: 8px 12px !important;
	background: #FFFFFF !important;
}

.cwb-agent-bookings .cwb-bookings-toolbar.has-unified-filters .cwb-bookings-toolbar-row {
	display: none !important;
}

.cwb-agent-bookings .cwb-un-filter-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-width: 0;
	min-height: 42px;
}

/* Row 2 ("when + actions") is shorter than row 1 — let its fields keep their
   intended widths and push Clear/Filter to sit right after them, no gap. */
.cwb-agent-bookings .cwb-un-filter-row-2 {
	justify-content: flex-start;
}

.cwb-agent-bookings .cwb-un-filter-row .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Agency can still be force-hidden for non-Ops via [hidden]. Status is in the panel. */
.cwb-agent-bookings #cwb-bookings-agency[hidden],
.cwb-agent-bookings label[for="cwb-bookings-agency"][hidden] {
	display: none !important;
}

/* Icon field wrapper: icon left, control fills the rest, vertically centered. */
.cwb-agent-bookings .cwb-un-field {
	position: relative;
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	box-sizing: border-box;
	height: 38px;
}

.cwb-agent-bookings .cwb-un-field-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #6B7280;
	pointer-events: none;
	z-index: 1;
}

.cwb-agent-bookings .cwb-un-field-icon svg {
	width: 16px;
	height: 16px;
}

.cwb-agent-bookings .cwb-un-field:hover .cwb-un-field-icon,
.cwb-agent-bookings .cwb-un-field:focus-within .cwb-un-field-icon {
	color: #111827;
}

/* Widths per ТЗ, now as flex-grow proportions so the row stretches to fill
   the container instead of leaving dead space (min-width keeps a floor). */
.cwb-agent-bookings .cwb-un-field-100 { flex: 10 1 100px !important; width: auto !important; min-width: 100px !important; }
.cwb-agent-bookings .cwb-un-field-120 { flex: 12 1 120px !important; width: auto !important; min-width: 120px !important; }
.cwb-agent-bookings .cwb-un-field-checkinout,
.cwb-agent-bookings .cwb-un-field-fromto { flex: 0 0 auto !important; min-width: 0; }

.cwb-agent-bookings .cwb-un-filter-row #cwb-bookings-search,
.cwb-agent-bookings .cwb-un-filter-row select.cwb-bookings-filter-select,
.cwb-agent-bookings .cwb-un-filter-row .cwb-bookings-date-toggle {
	box-sizing: border-box;
	width: 100% !important;
	height: 38px !important;
	min-height: 36px !important;
	max-height: 40px !important;
	border: 1px solid #E5E7EB !important;
	border-radius: 8px !important;
	box-shadow: none !important;
	background: #FFFFFF !important;
	color: #1F2937 !important;
	font-family: 'Inter', inherit !important;
	font-size: 14px !important;
	line-height: 1.25 !important;
	padding: 0 12px 0 36px !important;
}

/* Date buttons already contain the calendar icon — do not add the 36px
   overlay inset used by Booking Number / selects. */
.cwb-agent-bookings .cwb-un-filter-row .cwb-bookings-date-toggle {
	padding: 0 10px 0 10px !important;
}

.cwb-agent-bookings .cwb-un-filter-row select.cwb-bookings-filter-select {
	appearance: none;
	-webkit-appearance: none;
	min-width: 0 !important;
	max-width: none !important;
	padding-right: 28px !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 10px center !important;
	background-size: 12px !important;
}

.cwb-agent-bookings .cwb-un-field-checkinout,
.cwb-agent-bookings .cwb-un-field-fromto {
	display: inline-flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 8px;
}

/* Check-in from / to — +10mm each, taken from All hotels on row 2. */
.cwb-agent-bookings .cwb-un-field-checkinout .cwb-bookings-date-toggle {
	flex: 0 0 calc(110px + 10mm) !important;
	min-width: calc(110px + 10mm) !important;
	max-width: calc(110px + 10mm) !important;
}

/* Created from / to — +10mm each, taken from All hotels on row 2. */
.cwb-agent-bookings .cwb-un-field-fromto .cwb-bookings-date-toggle {
	flex: 0 0 calc(100px + 10mm) !important;
	min-width: calc(100px + 10mm) !important;
	max-width: calc(100px + 10mm) !important;
}

.cwb-agent-bookings .cwb-un-filter-row-2 > .cwb-un-field-120 {
	flex: 1 1 calc(120px - 40mm) !important;
	min-width: 64px !important;
	width: auto !important;
}

.cwb-agent-bookings .cwb-un-filter-row-2 > .cwb-un-field-100 {
	flex: 1 1 100px !important;
	min-width: 88px !important;
	width: auto !important;
}

.cwb-agent-bookings .cwb-un-field-checkinout .cwb-bookings-date-group-sep,
.cwb-agent-bookings .cwb-un-field-fromto .cwb-bookings-date-group-sep {
	color: #6B7280;
}

/* Clear / Filter never grow — always exactly 32x32. Deliberately pinned to
   the right edge of row 2, with the empty space to their left (compact
   date fields, then a gap, then actions) — same margin-left:auto idea as
   the native button used, just under our own control this time. */
.cwb-agent-bookings .cwb-un-filter-row-2 #cwb-bookings-clear-filters {
	flex: 0 0 32px !important;
	margin-left: auto !important;
}

.cwb-agent-bookings .cwb-un-filter-row-2 #cwb-bookings-apply-filters {
	flex: 0 0 32px !important;
	margin-left: 8px !important;
}

.cwb-agent-bookings .cwb-un-filter-row #cwb-bookings-search:focus,
.cwb-agent-bookings .cwb-un-filter-row select.cwb-bookings-filter-select:focus,
.cwb-agent-bookings .cwb-un-filter-row .cwb-bookings-date-toggle:focus-visible {
	outline: 3px solid rgba(27, 90, 122, 0.14) !important;
	border-color: #1B5A7A !important;
}

/* Clear / Filter — 32x32 icon buttons, inline right after the date fields
   (native .cwb-bookings-clear class, if reused, brings margin-left:auto — we
   overwrite the class entirely and force margin-left:0 here regardless). */
.cwb-agent-bookings .cwb-un-icon-btn {
	margin-left: 0 !important;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	box-sizing: border-box;
	border: 1px solid #E5E7EB;
	border-radius: 8px;
	background: #FFFFFF;
	color: #6B7280;
	cursor: pointer;
	padding: 0;
	margin: 0;
}

.cwb-agent-bookings .cwb-un-icon-btn svg {
	width: 16px;
	height: 16px;
}

.cwb-agent-bookings .cwb-un-icon-btn:hover,
.cwb-agent-bookings .cwb-un-icon-btn:focus-visible,
.cwb-agent-bookings .cwb-un-icon-btn.is-active {
	color: #111827;
	border-color: #98A2B3;
}

.cwb-agent-bookings .cwb-un-icon-btn-filter {
	background: #111827 !important;
	border-color: #111827 !important;
	color: #FFFFFF !important;
}

.cwb-agent-bookings .cwb-un-icon-btn-filter:hover,
.cwb-agent-bookings .cwb-un-icon-btn-filter:focus-visible {
	background: #000000 !important;
	border-color: #000000 !important;
	color: #FFFFFF !important;
}

@media (max-width: 767px) {
	.cwb-agent-bookings .cwb-booking-card-actions .cwb-view-booking,
	.cwb-agent-bookings .cwb-booking-card .cwb-view-booking,
	.cwb-agent-bookings .cwb-booking-card-actions .cwb-un-open-booking,
	.cwb-agent-bookings .cwb-booking-card .cwb-un-open-booking {
		min-height: 44px !important;
		height: auto !important;
		font-size: 12px !important;
		padding: 10px 16px !important;
	}

	.cwb-agent-bookings .cwb-un-filter-row,
	.cwb-agent-bookings .cwb-un-filter-row-2 {
		flex-direction: column;
		align-items: stretch;
		min-height: 0;
	}

	.cwb-agent-bookings .cwb-un-field,
	.cwb-agent-bookings .cwb-un-field-100,
	.cwb-agent-bookings .cwb-un-field-120,
	.cwb-agent-bookings .cwb-un-field-checkinout,
	.cwb-agent-bookings .cwb-un-field-fromto {
		flex: 1 1 auto !important;
		width: 100% !important;
		min-width: 0 !important;
		height: auto;
	}

	.cwb-agent-bookings .cwb-un-field-checkinout,
	.cwb-agent-bookings .cwb-un-field-fromto {
		display: flex;
		flex-wrap: wrap;
		width: 100%;
	}

	.cwb-agent-bookings .cwb-un-field-checkinout .cwb-bookings-date-toggle,
	.cwb-agent-bookings .cwb-un-field-fromto .cwb-bookings-date-toggle {
		flex: 1 1 140px !important;
		min-width: 0 !important;
		max-width: none !important;
		width: auto !important;
		height: 44px !important;
		min-height: 44px !important;
		max-height: none !important;
		font-size: 16px !important;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.cwb-agent-bookings .cwb-un-filter-row #cwb-bookings-search,
	.cwb-agent-bookings .cwb-un-filter-row select.cwb-bookings-filter-select {
		height: 44px !important;
		min-height: 44px !important;
		max-height: none !important;
		font-size: 16px !important;
	}

	.cwb-agent-bookings .cwb-un-filter-row-2 #cwb-bookings-clear-filters,
	.cwb-agent-bookings .cwb-un-filter-row-2 #cwb-bookings-apply-filters,
	.cwb-agent-bookings .cwb-un-icon-btn {
		width: 44px !important;
		height: 44px !important;
		min-width: 44px !important;
		min-height: 44px !important;
		flex: 0 0 44px !important;
	}

	.cwb-agent-bookings .cwb-un-filter-row-2 #cwb-bookings-clear-filters {
		margin-left: 0 !important;
		align-self: flex-end;
	}
}

/* Neutral list-row chrome only. Status attributes stay for icons / muted cancelled text. */
.cwb-agent-bookings .cwb-bookings-list .cwb-booking-card,
.cwb-agent-bookings .cwb-bookings-list .cwb-booking-card[data-status-tone],
.cwb-agent-bookings .cwb-bookings-list .cwb-booking-card[data-status-tone="confirmed"],
.cwb-agent-bookings .cwb-bookings-list .cwb-booking-card[data-status-tone="payment-pending"],
.cwb-agent-bookings .cwb-bookings-list .cwb-booking-card[data-status-tone="manual-request"],
.cwb-agent-bookings .cwb-bookings-list .cwb-booking-card[data-status-tone="cancelled-free"],
.cwb-agent-bookings .cwb-bookings-list .cwb-booking-card[data-status-tone="cancelled-penalty"],
.cwb-agent-bookings .cwb-bookings-list .cwb-booking-card[data-status-tone="manual-request-archived"],
.cwb-agent-bookings .cwb-bookings-list .cwb-booking-card.is-urgent,
.cwb-agent-bookings .cwb-bookings-list .cwb-booking-card.is-auto-cancellation {
	background: #ffffff !important;
	border-color: #E4E9ED !important;
	box-shadow: none !important;
}

.cwb-agent-bookings .cwb-bookings-list .cwb-booking-card:hover {
	background: #ffffff !important;
	border-color: #E4E9ED !important;
	box-shadow: none !important;
}

/* Agency column (ops/admin only): first grid track, plain text. */
.cwb-agent-bookings .cwb-bookings-table.has-agency-col .cwb-bookings-table-head,
.cwb-agent-bookings .cwb-bookings-table.has-agency-col .cwb-booking-card {
	grid-template-columns: minmax(68px, 0.36fr) minmax(88px, 0.42fr) minmax(300px, 2.45fr) minmax(128px, 1fr) minmax(78px, 0.52fr) 44px 44px 84px !important;
	gap: 8px !important;
}
.cwb-agent-bookings .cwb-bookings-table.has-agency-col .cwb-bookings-table-head > :nth-child(2),
.cwb-agent-bookings .cwb-bookings-table.has-agency-col .cwb-booking-card > .cwb-booking-property {
	margin-left: 0 !important;
	width: auto !important;
	max-width: none !important;
}
.cwb-agent-bookings .cwb-booking-card-agency {
	min-width: 0;
	max-width: 100%;
	overflow: hidden;
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	box-shadow: none;
}
.cwb-agent-bookings .cwb-booking-card-agency .cwb-booking-agency-line {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: 0.01em;
}
.cwb-agent-bookings .cwb-booking-card-agency .cwb-booking-agency-sub {
	display: block;
	margin: 3px 0 0;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--cwb-portal-secondary, #667085);
}
.cwb-agent-bookings .cwb-booking-card[data-status-bucket="cancelled"] .cwb-booking-card-agency {
	opacity: 0.55;
}
