.tbo-cal {
	/* Vibrant Orange & Royal Purple Palette */
	--tbo-orange: #fa5001;
	--tbo-orange-hover: #e03e00;
	--tbo-orange-light: rgba(250, 80, 1, 0.09);
	--tbo-orange-border: rgba(250, 80, 1, 0.28);

	--tbo-purple: #8b5cf6;
	--tbo-purple-dark: #6d28d9;
	--tbo-purple-light: rgba(139, 92, 246, 0.12);
	--tbo-purple-border: rgba(139, 92, 246, 0.28);

	/* Master Primary & Gradients */
	--tbo-primary: #fa5001;
	--tbo-primary-hover: #e03e00;
	--tbo-primary-light: rgba(250, 80, 1, 0.09);
	--tbo-primary-border: rgba(250, 80, 1, 0.28);

	--tbo-gradient: linear-gradient(135deg, #fa5001 0%, #8b5cf6 100%);
	--tbo-gradient-hover: linear-gradient(135deg, #ff661a 0%, #7c3aed 100%);
	--tbo-gradient-subtle: linear-gradient(135deg, rgba(250, 80, 1, 0.07) 0%, rgba(139, 92, 246, 0.10) 100%);

	/* Midnight Amethyst Sidebar */
	--tbo-sidebar-bg: #160a26;
	--tbo-sidebar-bg-2: #22103d;
	--tbo-sidebar-border: rgba(168, 85, 247, 0.15);
	--tbo-sidebar-text: #faf5ff;
	--tbo-sidebar-muted: #ad9ebf;

	/* Clean panel palette */
	--tbo-panel-bg: #ffffff;
	--tbo-border: #e6e0ee;
	--tbo-border-hover: #d2c8df;
	--tbo-text: #170d28;
	--tbo-text-muted: #6e6280;
	--tbo-danger: #ef4444;
	--tbo-success: #10b981;
	--tbo-radius: 18px;
	--tbo-font: -apple-system, BlinkMacSystemFont, "Plus Jakarta Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	all: initial;
	font-family: var(--tbo-font);
	display: flex;
	max-width: 800px;
	margin: 0 auto;
	background: var(--tbo-panel-bg);
	border-radius: var(--tbo-radius);
	overflow: hidden;
	box-shadow: 0 20px 45px -15px rgba(22, 10, 38, 0.18), 0 0 0 1px rgba(139, 92, 246, 0.12);
	color: var(--tbo-text);
	box-sizing: border-box;
	min-height: 520px;
}
.tbo-cal *, .tbo-cal *::before, .tbo-cal *::after {
	box-sizing: border-box;
	font-family: inherit;
}

/* ---------- Sidebar ---------- */
.tbo-cal__sidebar {
	width: 250px;
	flex: 0 0 250px;
	background: linear-gradient(175deg, var(--tbo-sidebar-bg) 0%, var(--tbo-sidebar-bg-2) 100%);
	color: var(--tbo-sidebar-text);
	display: flex;
	flex-direction: column;
	padding: 24px 18px;
	border-right: 1px solid var(--tbo-sidebar-border);
	transition: width 200ms cubic-bezier(0.4, 0, 0.2, 1), flex-basis 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.tbo-cal[data-collapsed="1"] .tbo-cal__sidebar {
	width: 78px;
	flex-basis: 78px;
	padding: 24px 12px;
}

.tbo-cal__brand {
	display: flex;
	align-items: center;
	padding: 4px 8px 24px;
}
.tbo-cal__logo {
	height: 32px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
}

.tbo-cal__steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.tbo-cal__step {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border-radius: 12px;
	background: transparent;
	border: 1px solid transparent;
	transition: all 0.2s ease;
}
.tbo-cal__step.is-active {
	background: rgba(139, 92, 246, 0.14);
	border-color: rgba(168, 85, 247, 0.28);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.tbo-cal__step-icon {
	flex: 0 0 32px;
	width: 32px;
	height: 32px;
	border-radius: 9px;
	background: rgba(255, 255, 255, 0.08);
	color: var(--tbo-sidebar-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	transition: all 0.2s ease;
}
.tbo-cal__step.is-done .tbo-cal__step-icon {
	background: linear-gradient(135deg, #10b981, #059669);
	color: #fff;
	box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}
.tbo-cal__step.is-active .tbo-cal__step-icon {
	background: var(--tbo-gradient);
	color: #fff;
	box-shadow: 0 4px 14px rgba(250, 80, 1, 0.45);
}

.tbo-cal__step-info {
	min-width: 0;
	overflow: hidden;
}
.tbo-cal__step-title {
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--tbo-sidebar-text);
}
.tbo-cal__step-meta {
	font-size: 11.5px;
	color: var(--tbo-sidebar-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-top: 2px;
}

.tbo-cal[data-collapsed="1"] .tbo-cal__step-info,
.tbo-cal[data-collapsed="1"] .tbo-cal__collapse-label,
.tbo-cal[data-collapsed="1"] .tbo-cal__brand img {
	display: none;
}
.tbo-cal[data-collapsed="1"] .tbo-cal__collapse-icon {
	transform: rotate(180deg);
}

.tbo-cal__collapse {
	all: unset;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 14px;
	margin-top: 14px;
	border-top: 1px solid var(--tbo-sidebar-border);
	padding-top: 16px;
	font-size: 12.5px;
	font-weight: 500;
	color: var(--tbo-sidebar-muted);
	border-radius: 8px;
	transition: all 0.2s ease;
}
.tbo-cal__collapse:hover {
	color: var(--tbo-sidebar-text);
	background: rgba(139, 92, 246, 0.14);
}
.tbo-cal__collapse-icon {
	display: inline-flex;
	width: 24px;
	height: 24px;
	border-radius: 6px;
	background: rgba(139, 92, 246, 0.16);
	color: #c4b5fd;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	transition: transform 180ms ease;
}

/* ---------- Panel ---------- */
.tbo-cal__panel {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	background: var(--tbo-panel-bg);
}
.tbo-cal__panel-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 28px 36px;
	overflow-y: auto;
}

.tbo-cal__loading {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}
.tbo-cal__spinner {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 3px solid var(--tbo-border);
	border-top-color: var(--tbo-orange);
	border-right-color: var(--tbo-purple);
	animation: tbo-spin 650ms linear infinite;
}
@keyframes tbo-spin {
	to { transform: rotate(360deg); }
}

.tbo-cal__header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-bottom: 18px;
	margin-bottom: 22px;
	border-bottom: 1px solid var(--tbo-border);
}
.tbo-cal__back {
	all: unset;
	cursor: pointer;
	width: 32px;
	height: 32px;
	border-radius: 10px;
	border: 1px solid var(--tbo-border);
	background: #faf8fd;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--tbo-text-muted);
	flex: 0 0 auto;
	font-size: 15px;
	transition: all 0.15s ease;
}
.tbo-cal__back:hover {
	border-color: var(--tbo-purple);
	color: var(--tbo-purple-dark);
	background: var(--tbo-purple-light);
	transform: translateX(-1px);
}
.tbo-cal__title {
	font-size: 19px;
	font-weight: 700;
	color: var(--tbo-text);
	letter-spacing: -0.01em;
	margin: 0;
}

.tbo-cal__body { flex: 1; }

.tbo-cal__field { margin-bottom: 20px; }
.tbo-cal__label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 8px;
	color: var(--tbo-text);
}
.tbo-cal__label.is-required::before {
	content: "* ";
	color: var(--tbo-orange);
}

.tbo-cal__select, .tbo-cal__input {
	width: 100%;
	padding: 11px 14px;
	font-size: 14px;
	border: 1px solid var(--tbo-border);
	border-radius: 10px;
	background: #ffffff;
	color: var(--tbo-text);
	appearance: none;
	transition: all 0.2s ease;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5L6 6L10.5 1.5' stroke='%238b5cf6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
}
.tbo-cal__input { background-image: none; }
select.tbo-cal__select { padding-right: 36px; }
.tbo-cal__select:focus, .tbo-cal__input:focus {
	outline: none;
	border-color: var(--tbo-purple);
	box-shadow: 0 0 0 3.5px var(--tbo-purple-light), 0 0 0 1px rgba(250, 80, 1, 0.2);
}

.tbo-cal__phone-row { display: flex; gap: 10px; }
.tbo-cal__phone-row .tbo-cal__select { flex: 0 0 95px; }
.tbo-cal__phone-row .tbo-cal__input { flex: 1; }

.tbo-cal__error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
	padding: 12px 14px;
	border-radius: 10px;
	font-size: 13px;
	margin-bottom: 18px;
	display: flex;
	align-items: center;
	gap: 8px;
}

/* ---------- Calendar ---------- */
.tbo-cal__cal-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
}
.tbo-cal__cal-select { flex: 1; }
.tbo-cal__cal-nav {
	display: flex;
	gap: 6px;
}
.tbo-cal__nav-btn {
	all: unset;
	cursor: pointer;
	width: 34px;
	height: 34px;
	border: 1px solid var(--tbo-border);
	background: #faf8fd;
	border-radius: 9px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	color: var(--tbo-text);
	transition: all 0.15s ease;
}
.tbo-cal__nav-btn:hover {
	border-color: var(--tbo-purple);
	color: var(--tbo-purple-dark);
	background: var(--tbo-purple-light);
}
.tbo-cal__nav-btn[disabled] { opacity: 0.35; cursor: not-allowed; }

.tbo-cal__tz {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 500;
	color: var(--tbo-text-muted);
	background: #faf8fd;
	border: 1px solid var(--tbo-border);
	padding: 4px 12px;
	border-radius: 20px;
	margin-bottom: 14px;
}

.tbo-cal__weekdays, .tbo-cal__days {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 6px;
}
.tbo-cal__weekdays {
	margin-bottom: 8px;
}
.tbo-cal__weekday {
	text-align: center;
	font-size: 11.5px;
	font-weight: 700;
	color: var(--tbo-text-muted);
	padding: 4px 0;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.tbo-cal__day {
	all: unset;
	cursor: pointer;
	text-align: center;
	padding: 10px 0;
	border-radius: 10px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--tbo-text);
	border: 1px solid var(--tbo-border);
	background: #ffffff;
	transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.tbo-cal__day:hover:not([disabled]) {
	background: var(--tbo-gradient-subtle);
	border-color: var(--tbo-purple-border);
	color: var(--tbo-purple-dark);
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(139, 92, 246, 0.16);
}
.tbo-cal__day[disabled] {
	background: transparent;
	border-color: transparent;
	color: #d1c9db;
	cursor: not-allowed;
	font-weight: 400;
}
.tbo-cal__day.is-empty { visibility: hidden; }
.tbo-cal__day.is-selected {
	background: var(--tbo-gradient) !important;
	border-color: transparent !important;
	color: #ffffff !important;
	font-weight: 700;
	box-shadow: 0 4px 16px rgba(250, 80, 1, 0.4);
	transform: scale(1.02);
}
.tbo-cal__day.is-today:not(.is-selected) {
	border: 1.5px solid var(--tbo-orange);
	color: var(--tbo-orange);
	font-weight: 700;
}

.tbo-cal__slots-label {
	font-size: 14px;
	font-weight: 700;
	color: var(--tbo-text);
	margin: 22px 0 12px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.tbo-cal__slots {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	max-height: 220px;
	overflow-y: auto;
	padding-right: 4px;
}
.tbo-cal__slot {
	all: unset;
	cursor: pointer;
	text-align: center;
	padding: 11px 12px;
	border: 1.5px solid var(--tbo-border);
	background: #ffffff;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--tbo-text);
	transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.tbo-cal__slot:hover {
	border-color: var(--tbo-purple);
	background: var(--tbo-purple-light);
	color: var(--tbo-purple-dark);
	transform: translateY(-1px);
	box-shadow: 0 3px 10px rgba(139, 92, 246, 0.15);
}
.tbo-cal__slot.is-selected {
	background: var(--tbo-gradient);
	border-color: transparent;
	color: #ffffff;
	font-weight: 700;
	box-shadow: 0 4px 14px rgba(250, 80, 1, 0.35);
}
.tbo-cal__empty {
	color: var(--tbo-text-muted);
	background: #faf8fd;
	border: 1px dashed var(--tbo-border);
	border-radius: 10px;
	text-align: center;
	font-size: 13px;
	padding: 18px 12px;
}

/* ---------- Footer / buttons ---------- */
.tbo-cal__footer {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	padding-top: 22px;
	margin-top: 22px;
	border-top: 1px solid var(--tbo-border);
}
.tbo-cal__btn {
	all: unset;
	cursor: pointer;
	padding: 12px 28px;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.tbo-cal__btn-primary {
	background: var(--tbo-gradient);
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(250, 80, 1, 0.32);
}
.tbo-cal__btn-primary:hover:not([disabled]) {
	background: var(--tbo-gradient-hover);
	box-shadow: 0 6px 20px rgba(250, 80, 1, 0.42), 0 2px 8px rgba(139, 92, 246, 0.35);
	transform: translateY(-1px);
}
.tbo-cal__btn-primary[disabled] {
	background: #f8f6fb;
	color: #9f94ae;
	border: 1px solid var(--tbo-border);
	box-shadow: none;
	cursor: not-allowed;
	opacity: 0.75;
}
.tbo-cal__btn-secondary {
	background: #ffffff;
	color: var(--tbo-text);
	border: 1px solid var(--tbo-border);
}
.tbo-cal__btn-secondary:hover {
	border-color: var(--tbo-purple);
	color: var(--tbo-purple-dark);
	background: var(--tbo-purple-light);
}

/* ---------- Confirmation ---------- */
.tbo-cal__confirm {
	text-align: center;
	max-width: 400px;
	margin: 0 auto;
}
.tbo-cal__confirm-icon {
	font-size: 44px;
	margin-bottom: 8px;
	display: inline-block;
}
.tbo-cal__confirm-title {
	font-size: 22px;
	font-weight: 800;
	color: var(--tbo-text);
	margin: 4px 0 2px;
	letter-spacing: -0.02em;
}
.tbo-cal__confirm-id {
	color: var(--tbo-text-muted);
	font-size: 13px;
	margin-bottom: 24px;
}
.tbo-cal__summary {
	text-align: left;
	background: #faf8fd;
	border: 1px solid var(--tbo-border);
	border-radius: 12px;
	padding: 14px 18px;
	margin-bottom: 20px;
}
.tbo-cal__summary-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 0;
	font-size: 13.5px;
	border-bottom: 1px solid #f0ecf5;
}
.tbo-cal__summary-row:last-child {
	border-bottom: none;
}
.tbo-cal__summary-row dt { color: var(--tbo-text-muted); }
.tbo-cal__summary-row dd { margin: 0; font-weight: 600; text-align: right; color: var(--tbo-text); }

.tbo-cal__addcal-label {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--tbo-sidebar-text);
	margin-bottom: 12px;
}
.tbo-cal__addcal-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	box-sizing: border-box;
}
.tbo-cal__addcal-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 14px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none !important;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	user-select: none;
	cursor: pointer !important;
	box-sizing: border-box;
	text-align: center;
}

/* Sidebar dark buttons */
.tbo-cal__sidebar .tbo-cal__addcal-btn {
	background: rgba(139, 92, 246, 0.12);
	color: #ffffff !important;
	border: 1px solid rgba(168, 85, 247, 0.25);
}
.tbo-cal__sidebar .tbo-cal__addcal-btn:hover {
	background: var(--tbo-gradient);
	border-color: transparent;
	color: #ffffff !important;
	transform: translateY(-2px);
	box-shadow: 0 4px 14px rgba(250, 80, 1, 0.4);
}
.tbo-cal__sidebar .tbo-cal__addcal-btn:active {
	transform: translateY(0);
}

/* Confirmation panel buttons (light theme card) */
.tbo-cal__confirm-cal {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--tbo-border);
	text-align: center;
	width: 100%;
	box-sizing: border-box;
}
.tbo-cal__confirm-cal-title {
	font-size: 14px;
	font-weight: 700;
	color: var(--tbo-text);
	margin-bottom: 14px;
}
.tbo-cal__confirm-cal .tbo-cal__addcal-grid {
	max-width: 360px;
	margin: 0 auto;
}
.tbo-cal__confirm .tbo-cal__addcal-btn {
	background: #faf8fd;
	color: var(--tbo-text) !important;
	border: 1px solid var(--tbo-border);
}
.tbo-cal__confirm .tbo-cal__addcal-btn:hover {
	background: var(--tbo-gradient);
	border-color: transparent;
	color: #ffffff !important;
	transform: translateY(-2px);
	box-shadow: 0 4px 14px rgba(250, 80, 1, 0.35);
}
.tbo-cal__confirm .tbo-cal__addcal-btn:active {
	transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 680px) {
	.tbo-cal {
		flex-direction: column;
		max-width: 440px;
		border-radius: 14px;
	}
	.tbo-cal__sidebar {
		width: 100%;
		flex-basis: auto;
		flex-direction: row;
		align-items: center;
		padding: 16px 20px;
		gap: 12px;
		border-right: none;
		border-bottom: 1px solid var(--tbo-sidebar-border);
	}
	.tbo-cal__brand { padding: 0; }
	.tbo-cal__steps { flex-direction: row; flex: 1; overflow-x: auto; }
	.tbo-cal__step { padding: 6px 10px; }
	.tbo-cal__step-info { display: none; }
	.tbo-cal__collapse { display: none; }
	.tbo-cal__panel-body { padding: 20px 22px; }
	.tbo-cal__addcal-grid { grid-template-columns: 1fr; }
	.tbo-cal__slots { grid-template-columns: 1fr; }
}
