/* ==========================================================================
   MGMT Vehicle Hire — Availability calendar
   Used inline on single-vehicle pages and inside the booking dates popover.
   Dark theme for high visual weight — reads immediately as an availability panel.
   ========================================================================== */

.mgmt-cal {
	background: #15212d;
	color: #fff;
	border-radius: 2px;
	padding: 20px;
	font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.mgmt-cal__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	gap: 12px;
}
.mgmt-cal__nav {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.15);
	color: #fff;
	width: 36px;
	height: 36px;
	border-radius: 2px;
	font-size: 18px;
	cursor: pointer;
	font-family: inherit;
	transition: background 150ms ease-out;
}
.mgmt-cal__nav:hover { background: rgba(255, 255, 255, 0.08); }
.mgmt-cal__nav:focus-visible {
	outline: 2px solid var(--member-gold, #a88242);
	outline-offset: 2px;
}
.mgmt-cal__today {
	background: transparent;
	border: 0;
	color: rgba(255, 255, 255, 0.85);
	font-family: inherit;
	font-size: 13px;
	letter-spacing: 0.06em;
	cursor: pointer;
	padding: 8px 16px;
	text-transform: uppercase;
	font-weight: 500;
}
.mgmt-cal__today:hover { color: #fff; }

/* ---- Month grid layout ---- */
.mgmt-cal__body {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}
@media (max-width: 1024px) {
	.mgmt-cal__body { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
	.mgmt-cal__body { grid-template-columns: 1fr; }
}

.mgmt-cal__month-title {
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0.04em;
	padding: 0 0 8px;
	color: rgba(255, 255, 255, 0.9);
}

.mgmt-cal__grid { display: flex; flex-direction: column; }

.mgmt-cal__grid-header,
.mgmt-cal__grid-body {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 0;
}
.mgmt-cal__grid-header span {
	padding: 8px 0;
	text-align: center;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.85);
	background: #0a1720;
	letter-spacing: 0.08em;
}

/* ---- Day cells ---- */
.mgmt-cal__day {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	padding: 4px;
	font-size: 14px;
	font-weight: 500;
	font-family: inherit;
	border: 1px solid rgba(255, 255, 255, 0.05);
	background: transparent;
	color: #fff;
	line-height: 1;
	transition: background 150ms ease-out, transform 120ms ease-out;
}
.mgmt-cal__day--outside { color: rgba(255, 255, 255, 0.18); background: transparent; font-weight: 400; }
.mgmt-cal__day--past    { color: rgba(255, 255, 255, 0.3); background: transparent; font-weight: 400; }
.mgmt-cal__day--available { background: #2f7a4f; color: #fff; }
.mgmt-cal__day--booked    { background: #8b1f24; color: #fff; }
.mgmt-cal__day--buffer    {
	background: repeating-linear-gradient(45deg, #8a6a1e, #8a6a1e 4px, #6b521a 4px, #6b521a 8px);
	color: #fff;
}
.mgmt-cal__day--today::after {
	content: '';
	display: inline-block;
	width: 5px;
	height: 5px;
	background: #fff;
	border-radius: 50%;
	margin-left: 4px;
}

/* Picker-mode interactions */
.mgmt-cal--picker .mgmt-cal__day--available {
	cursor: pointer;
}
.mgmt-cal--picker .mgmt-cal__day--available:hover {
	background: #39946c;
}
.mgmt-cal--picker .mgmt-cal__day--available:focus-visible {
	outline: 2px solid var(--member-gold, #a88242);
	outline-offset: -2px;
}
.mgmt-cal__day--selected-from,
.mgmt-cal__day--selected-to {
	background: var(--navy, #164475) !important;
	color: #fff !important;
	font-weight: 700;
}
.mgmt-cal__day--in-range {
	background: rgba(22, 68, 117, 0.55) !important;
	color: #fff;
}

button.mgmt-cal__day {
	cursor: default;
}
button.mgmt-cal__day:disabled {
	cursor: not-allowed;
}

/* ---- Legend ---- */
.mgmt-cal__legend {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 20px;
	margin-top: 20px;
	font-size: 12px;
	letter-spacing: 0.04em;
	color: rgba(255, 255, 255, 0.75);
}
.mgmt-cal__legend-item { display: inline-flex; align-items: center; gap: 6px; }
.mgmt-cal__swatch {
	width: 14px;
	height: 14px;
	border-radius: 2px;
	display: inline-block;
}
.mgmt-cal__swatch--available { background: #2f7a4f; }
.mgmt-cal__swatch--booked    { background: #8b1f24; }
.mgmt-cal__swatch--buffer    {
	background: repeating-linear-gradient(45deg, #8a6a1e, #8a6a1e 3px, #6b521a 3px, #6b521a 6px);
}

/* ---- Loading / empty / error ---- */
.mgmt-cal__loading,
.mgmt-cal__empty,
.mgmt-cal__error {
	text-align: center;
	padding: 48px 16px;
	color: rgba(255, 255, 255, 0.7);
	font-size: 14px;
	grid-column: 1 / -1;
}
.mgmt-cal__error { color: #e4a1a4; }

/* ==========================================================================
   Booking-flow integration — the dropdown popover
   ========================================================================== */

.booking-calendar-wrap {
	margin-bottom: 24px;
}
.booking-calendar-button {
	margin-top: 4px;
}
.booking-calendar-button[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}
.booking-calendar-popover {
	margin-top: 16px;
	border-radius: 2px;
	overflow: hidden;
	box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.12);
}
.booking-calendar-popover[hidden] { display: none; }

/* Tighter calendar inside the popover */
.booking-calendar-popover .mgmt-cal { padding: 16px; }
