/* ============================================================================
 *  Sidebar: เมนูหน้า (sidebar_menu() ใน function/fnc_show.php) + สถิติการเข้าใช้งาน
 *  ใช้กล่อง .card-default / .card-title เดิมของธีม แต่งเฉพาะเนื้อหาข้างใน
 * ========================================================================== */

.sp-sidebar { display: block; }
.sp-sidebar > .card-default:last-child { margin-bottom: 0; }

/* ---------- เมนูหน้า ---------- */
.sp-side-menu {
	list-style: none;
	margin: 10px 0 0;
	padding: 0;
}
.sp-side-menu li + li { margin-top: 2px; }
.sp-side-menu a {
	position: relative;
	display: block;
	padding: 9px 30px 9px 12px;
	border-radius: 8px;
	color: #3a4450;
	font-size: 15px;
	line-height: 1.45;
	text-decoration: none;
	transition: background-color .2s ease, color .2s ease, padding-left .2s ease;
}
/* ลูกศรด้านขวา วาดด้วย CSS ไม่พึ่งฟอนต์ไอคอน */
.sp-side-menu a::after {
	content: "";
	position: absolute;
	right: 12px;
	top: 50%;
	width: 7px;
	height: 7px;
	margin-top: -4px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
	opacity: .35;
	transition: opacity .2s ease, right .2s ease;
}
.sp-side-menu a:hover,
.sp-side-menu a:focus-visible {
	background: #eaf8fe;
	color: #0b7fae;
	padding-left: 16px;
	text-decoration: none;
}
.sp-side-menu a:hover::after,
.sp-side-menu a:focus-visible::after { opacity: .8; right: 10px; }
.sp-side-menu a:focus-visible { outline: 2px solid #27c2f2; outline-offset: 1px; }

.sp-side-menu a.is-active {
	background: linear-gradient(135deg, #33ccff 0%, #1aa3e0 100%);
	color: #fff;
	font-weight: 600;
	box-shadow: 0 3px 10px rgba(26, 163, 224, .3);
}
.sp-side-menu a.is-active::after { opacity: 1; }

/* ---------- สถิติการเข้าใช้งาน ---------- */
.sp-stat-today {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin: 12px 0 10px;
	padding: 12px 14px;
	border-radius: 10px;
	background: linear-gradient(135deg, #33ccff 0%, #1aa3e0 100%);
	color: #fff;
}
.sp-stat-today-label { font-size: 14px; opacity: .95; }
.sp-stat-today-value {
	font-size: 26px;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.sp-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	margin: 0;
}
.sp-stat {
	padding: 8px 10px;
	border-radius: 8px;
	background: #f3f8fb;
}
/* จำนวนช่องเป็นเลขคี่ ช่องสุดท้ายกว้างเต็มแถว */
.sp-stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
.sp-stat dt {
	margin: 0 0 2px;
	font-size: 12px;
	font-weight: 400;
	color: #6b7785;
}
.sp-stat dd {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #24303c;
	font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
	.sp-side-menu a, .sp-side-menu a::after { transition: none; }
}
