.calendar-popup {
	display: none;
	position: absolute;
	background: white;
	border: 1px solid #ccc;
	border-radius: 8px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
	z-index: 999;
	margin-top: 8px;
	width: 280px;
	font-family: sans-serif;
	user-select: none;
}

.calendar-popup.show {
	display: block;
}

/* Mobile full screen */
@media ( max-width : 600px) {
	.calendar-popup {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		border-radius: 0;
		margin: 0;
		width: 100%;
		height: 100%;
	}
}

/* ===== Header ===== */
.calendar-popup .calendar-header {
	display: flex;
	justify-content: space-between !important;
	align-items: center;
	background: #f8f8f8;
	padding: 6px 8px;
	font-weight: bold;
}

.calendar-popup .calendar-title {
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 4px;
}

.calendar-popup .calendar-title:hover {
	background: #e0e0e0;
}

.calendar-popup .calendar-nav button {
	background: none;
	border: none;
	font-size: 16px;
	padding: 4px 8px;
	cursor: pointer;
	border-radius: 4px;
	color: #333;
}

.calendar-popup .calendar-nav button:hover {
	background: #ddd;
}

/* ===== Grid ===== */
.calendar-popup .calendar-grid {
	display: grid;
	gap: 4px;
	padding: 8px;
}

.calendar-popup .calendar-cell {
	text-align: center;
	padding: 6px 0;
	cursor: pointer;
	border-radius: 4px;
}

.calendar-popup .calendar-cell.calendar-prev-month, .calendar-popup .calendar-cell.calendar-next-month
	{
	color: #fff;
	background-color: #fff;
	cursor: default;
}

.calendar-popup .calendar-cell .stat {
	display: flex;
	justify-content: center;
	position: relative;
}

.calendar-popup .calendar-cell .stat .count {
	position: absolute;
	width: 0.3rem;
	height: 0.3rem;
	border-radius: 5rem;
	background: #ff9632;
	top: 0.01rem;
}

.calendar-popup .calendar-cell:hover {
	background: #f0f0f0;
}

.calendar-popup .calendar-cell.calendar-prev-month:hover,
	.calendar-popup .calendar-cell.calendar-next-month:hover {
	background: #fff;
}

.calendar-popup .calendar-today {
	background: #3056ef;
	color: white;
}

.calendar-popup .calendar-today .stat .count {
	background: #fff;
}

.calendar-popup .calendar-active {
	background: #007bff;
	color: #fff;
}

.calendar-popup .calendar-active .stat .count {
	background: #fff;
}

/* Weekday header */
.calendar-popup .calendar-weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	font-size: 12px;
	color: #888;
	padding: 0 8px;
	margin-bottom: 0;
}

.calendar-popup .calendar-weekdays div {
	text-align: center;
	padding: 4px 0;
}

/* Today button */
.calendar-popup .calendar-footer {
	padding: 6px;
	border-top: 1px solid #eee;
}

.calendar-popup .calendar-footer button {
	background: #3056ef;
	color: white;
	border: none;
	border-radius: 4px;
	padding: 6px 12px;
	cursor: pointer;
}

.calendar-popup .calendar-footer button:hover {
	background: #1f3fcf;
}

.calendar-container {
	display: block;
	position: relative;
	background: white;
	border: 1px solid #ccc;
	border-radius: 8px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
	margin-top: 8px;
	width: 100%;
	font-family: sans-serif;
	user-select: none;
}

/* ===== Header ===== */
.calendar-container .calendar-header {
	display: flex;
	justify-content: space-between !important;
	align-items: center;
	background: #f8f8f8;
	padding: 6px 8px;
	font-weight: bold;
}

.calendar-container .calendar-title {
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 4px;
}

.calendar-container .calendar-title:hover {
	background: #e0e0e0;
}

.calendar-container .calendar-nav button {
	background: none;
	border: none;
	font-size: 16px;
	padding: 4px 8px;
	cursor: pointer;
	border-radius: 4px;
}

.calendar-container .calendar-nav button:hover {
	background: #ddd;
}

/* ===== Grid ===== */
.calendar-container .calendar-grid {
	display: grid;
	gap: 1px;
	padding: 1px 0;
	background: #e5e5e5;
}

.calendar-container .calendar-cell {
	padding: 15px 0.4rem;
	cursor: pointer;
	background-color: #fff;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	align-items: center;
}

.calendar-container .calendar-cell .task {
	display: flex;
	font-size: 12px;
}

.calendar-container .calendar-cell .task>span {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	border-radius: 10px;
}

.calendar-container .calendar-cell .more {
	display: flex;
	font-size: 12px;
}

.calendar-container .calendar-cell .task .title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 1; /* 👈 จำกัด 2 บรรทัด (ปรับได้) */
	overflow: hidden;
	text-overflow: ellipsis;
	word-break: break-word;
	line-height: 1.4;
	max-height: calc(1.4em); /* คำนวณจาก line-height * จำนวนบรรทัด */
}

.calendar-container .calendar-cell .task .assignedTechnician {
	background-color: #ffffff;
	color: #333;
	border-radius: 5px;
	padding: 0 5px;
	width: fit-content;
}

.calendar-container .calendar-cell.calendar-prev-month,
	.calendar-container .calendar-cell.calendar-next-month {
	color: #ccc;
	background-color: #fff;
	cursor: default;
}

.calendar-container .calendar-cell .stat {
	display: flex;
	justify-content: center;
	position: relative;
}

.calendar-container .calendar-cell .stat .count {
	position: absolute;
	width: 0.3rem;
	height: 0.3rem;
	border-radius: 5rem;
	background: #ff9632;
	top: 0.01rem;
}

.calendar-container .calendar-cell:hover {
	background: #f8f8f8;
	color: #333;
}

.calendar-container .calendar-cell.calendar-prev-month:hover,
	.calendar-container .calendar-cell.calendar-next-month:hover {
	background: #fff;
	color: #ccc;
}

.calendar-container .calendar-today .stat .count {
	background: #fff;
}

.calendar-container .calendar-cell .date {
	border-radius: 50px;
	background-color: inherit;
	color: #333;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 400;
	margin: 0;
	align-self: flex-end;
}

.calendar-container .calendar-today .date {
	background: #3056ef;
	color: white;
}

.calendar-container .calendar-cell.calendar-prev-month .date,
	.calendar-container .calendar-cell.calendar-next-month .date {
	color: #ccc;
}

.calendar-container .calendar-cell.calendar-active .date {
	background-color: #007bff;
	color: #fff;
}

.calendar-container .calendar-active .stat .count {
	background: #fff;
}

/* Weekday header */
.calendar-container .calendar-weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	color: #888;
	padding: 0 8px;
}

.calendar-container .calendar-weekdays div {
	text-align: center;
	display: flex;
	flex-direction: column;
	padding: 0 0.4rem;
}

.calendar-container .calendar-weekdays div .day {
	margin: 0;
	align-self: flex-end;
	width: 28px;
}

/* Today button */
.calendar-container .calendar-footer {
	padding: 6px;
	border-top: 1px solid #eee;
}

.calendar-container .calendar-footer button {
	background: #3056ef;
	color: white;
	border: none;
	border-radius: 4px;
	padding: 6px 12px;
	cursor: pointer;
}

.calendar-container .calendar-footer button:hover {
	background: #1f3fcf;
}