:root {
	color-scheme: light;
	--tc-font-sans: "Noto Sans Thai", "Leelawadee UI", "Segoe UI", Tahoma, sans-serif;
	--tc-bg: #f7f0e4;
	--tc-bg-accent: #fde4bc;
	--tc-surface: rgba(255, 255, 255, 0.72);
	--tc-surface-strong: rgba(255, 255, 255, 0.92);
	--tc-surface-soft: rgba(255, 255, 255, 0.58);
	--tc-border: rgba(255, 255, 255, 0.55);
	--tc-text: #21302b;
	--tc-muted: #5f6e69;
	--tc-primary: #1f9c9d;
	--tc-primary-soft: rgba(31, 156, 157, 0.16);
	--tc-secondary: #f09a45;
	--tc-success: #48b57b;
	--tc-danger: #e46868;
	--tc-warning: #edbc62;
	--tc-shadow: 0 24px 60px rgba(126, 98, 55, 0.18);
	--tc-shadow-soft: 0 16px 35px rgba(97, 76, 43, 0.12);
	--tc-shell: linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.1));
	--tc-banner: linear-gradient(135deg, #1f9c9d 0%, #15758d 100%);
}

[data-theme="dark"] {
	color-scheme: dark;
	--tc-bg: #11161c;
	--tc-bg-accent: #1c2e39;
	--tc-surface: rgba(15, 25, 33, 0.8);
	--tc-surface-strong: rgba(17, 29, 38, 0.94);
	--tc-surface-soft: rgba(20, 33, 43, 0.72);
	--tc-border: rgba(126, 165, 181, 0.16);
	--tc-text: #eef6f3;
	--tc-muted: #9ab0b9;
	--tc-primary: #5ed0cb;
	--tc-primary-soft: rgba(94, 208, 203, 0.16);
	--tc-secondary: #f3b15d;
	--tc-success: #69d59a;
	--tc-danger: #ff8e8e;
	--tc-warning: #ffd479;
	--tc-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
	--tc-shadow-soft: 0 16px 35px rgba(0, 0, 0, 0.22);
	--tc-shell: linear-gradient(135deg, rgba(29, 42, 51, 0.92), rgba(21, 28, 38, 0.72));
	--tc-banner: linear-gradient(135deg, #0c7b85 0%, #15455d 100%);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: var(--tc-font-sans);
	color: var(--tc-text);
	background:
		radial-gradient(circle at top left, rgba(240, 154, 69, 0.18), transparent 24%),
		radial-gradient(circle at top right, rgba(31, 156, 157, 0.16), transparent 22%),
		linear-gradient(180deg, var(--tc-bg-accent), var(--tc-bg));
	transition: background 0.35s ease, color 0.35s ease;
}

.dashboard-shell {
	padding: 1.25rem;
}

.glass-panel {
	background: var(--tc-shell);
	border: 1px solid var(--tc-border);
	border-radius: 32px;
	backdrop-filter: blur(22px);
	box-shadow: var(--tc-shadow);
}

.sidebar-panel {
	padding: 1.5rem;
	position: sticky;
	top: 1.25rem;
}

.brand-mark {
	width: 2.65rem;
	height: 2.65rem;
	border-radius: 1rem;
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, var(--tc-secondary), var(--tc-primary));
	color: white;
	box-shadow: var(--tc-shadow-soft);
}

.nav-link {
	color: var(--tc-muted);
	border-radius: 1rem;
	padding: 0.85rem 1rem;
	display: flex;
	align-items: center;
	gap: 0.85rem;
	font-weight: 500;
	transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.nav-link i {
	font-size: 1rem;
}

.nav-link:hover,
.nav-link.active {
	color: var(--tc-text);
	background: linear-gradient(135deg, var(--tc-primary), #44b8b5);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), var(--tc-shadow-soft);
	transform: translateX(2px);
}

.nav-link.active span,
.nav-link:hover span,
.nav-link.active i,
.nav-link:hover i {
	color: white;
}

.content-wrap {
	padding: 1.1rem;
}

.header-bar {
	padding: 0.85rem 1.35rem;
	position: sticky;
	top: 1.25rem;
	z-index: 100;
	flex-shrink: 0;
}

.section-card {
	background: var(--tc-surface);
	border: 1px solid var(--tc-border);
	border-radius: 26px;
	box-shadow: var(--tc-shadow-soft);
	height: 100%;
	padding: 1.35rem;
	transition: transform 0.25s ease, background-color 0.25s ease;
}

.section-card:hover {
	transform: translateY(-2px);
}

.eyebrow {
	font-size: 0.82rem;
	letter-spacing: 0.04em;
	color: var(--tc-muted);
}

.page-title {
	font-size: clamp(2rem, 3vw, 3rem);
	font-weight: 800;
	letter-spacing: -0.04em;
	margin: 0;
}

.search-box {
	background: var(--tc-surface-soft);
	border: 1px solid var(--tc-border);
	border-radius: 999px;
	min-width: min(100%, 260px);
	color: var(--tc-muted);
}

.search-box input {
	border: 0;
	background: transparent;
	color: var(--tc-text);
	padding: 0.85rem 0;
}

.search-box input:focus {
	outline: none;
	box-shadow: none;
}

.icon-button,
.theme-toggle {
	width: 2.85rem;
	height: 2.85rem;
	border: 1px solid var(--tc-border);
	background: var(--tc-surface-soft);
	color: var(--tc-text);
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--tc-shadow-soft);
}

.avatar {
	width: 2.85rem;
	height: 2.85rem;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, #262b32, #586472);
	color: white;
	font-weight: 700;
	box-shadow: var(--tc-shadow-soft);
}

.pill {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	background: var(--tc-primary-soft);
	color: var(--tc-primary);
	border-radius: 999px;
	padding: 0.42rem 0.75rem;
	font-size: 0.82rem;
	font-weight: 600;
}

.metric-value {
	font-size: clamp(1.8rem, 2vw, 2.5rem);
	line-height: 1;
	font-weight: 800;
	letter-spacing: -0.04em;
}

.club-badge {
	width: 3rem;
	height: 3rem;
	border-radius: 1rem;
	display: grid;
	place-items: center;
	font-weight: 800;
	color: white;
}

.club-badge.orange { background: linear-gradient(135deg, #f09a45, #f4bf72); }
.club-badge.teal { background: linear-gradient(135deg, #239f9f, #4fcbc0); }
.club-badge.red { background: linear-gradient(135deg, #d95d63, #ef8983); }

.timeline-dot {
	width: 0.7rem;
	height: 0.7rem;
	border-radius: 50%;
}

.progress-shell {
	height: 0.45rem;
	background: rgba(127, 145, 150, 0.16);
	border-radius: 999px;
	overflow: hidden;
}

.progress-line {
	height: 100%;
	border-radius: inherit;
}

.stat-tag {
	width: 2.15rem;
	height: 2.15rem;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--tc-primary-soft);
	color: var(--tc-primary);
}

.mini-card {
	min-height: 10.5rem;
}

.mini-card .metric-value {
	font-size: 2rem;
}

.data-table {
	margin-bottom: 0;
	--bs-table-bg: transparent;
	--bs-table-color: var(--tc-text);
	--bs-table-border-color: transparent;
}

.data-table thead th {
	color: var(--tc-muted);
	font-size: 0.78rem;
	text-transform: uppercase;
	font-weight: 700;
	letter-spacing: 0.05em;
	border-bottom: 1px solid rgba(127, 145, 150, 0.16);
	padding-bottom: 1rem;
}

.data-table tbody td {
	padding-top: 0.95rem;
	padding-bottom: 0.95rem;
	vertical-align: middle;
	border-bottom: 1px solid rgba(127, 145, 150, 0.11);
}

.rank {
	width: 2rem;
	height: 2rem;
	border-radius: 0.8rem;
	background: var(--tc-primary-soft);
	color: var(--tc-primary);
	display: inline-grid;
	place-items: center;
	font-size: 0.86rem;
	font-weight: 700;
}

.promo-card {
	background: var(--tc-banner);
	color: white;
	overflow: hidden;
	position: relative;
}

.promo-card::before,
.promo-card::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
}

.promo-card::before {
	width: 7rem;
	height: 7rem;
	right: -1rem;
	top: -1.25rem;
}

.promo-card::after {
	width: 5rem;
	height: 5rem;
	right: 4rem;
	bottom: -1.5rem;
}

.orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(2px);
	opacity: 0.9;
}

.orb.one {
	width: 1rem;
	height: 1rem;
	background: #a8ff6b;
	right: 4rem;
	top: 1.4rem;
}

.orb.two {
	width: 1.8rem;
	height: 1.8rem;
	background: #88d3ff;
	right: 1.2rem;
	top: 2.6rem;
}

.floating-card {
	position: absolute;
	right: 1.5rem;
	bottom: 1.25rem;
	width: 7.25rem;
	height: 4.75rem;
	border-radius: 1.25rem;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.18);
	transform: rotate(-11deg);
}

.btn-ghost-light {
	background: rgba(255, 255, 255, 0.16);
	color: white;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 999px;
	padding: 0.72rem 1.15rem;
	font-weight: 600;
}

.btn-red,
a.btn-red {
	background: linear-gradient(135deg, #f43f5e, #fb7185);
	color: white;
	border: none;
	border-radius: 1rem;
	padding: 0.9rem 1.5rem;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	box-shadow: 0 8px 20px rgba(244, 63, 94, 0.28);
	transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-red:hover,
a.btn-red:hover {
	opacity: 0.9;
	color: white;
	transform: translateY(-1px);
	box-shadow: 0 12px 28px rgba(244, 63, 94, 0.38);
	text-decoration: none;
}

.btn-red:active,
a.btn-red:active {
	transform: translateY(0);
	box-shadow: 0 4px 12px rgba(244, 63, 94, 0.22);
}

.btn-outline-red,
a.btn-outline-red {
	background: transparent;
	color: #f43f5e;
	border: 1.5px solid #f43f5e;
	border-radius: 1rem;
	padding: 0.9rem 1.5rem;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-outline-red:hover,
a.btn-outline-red:hover {
	background: linear-gradient(135deg, #f43f5e, #fb7185);
	color: white;
	border-color: transparent;
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(244, 63, 94, 0.28);
	text-decoration: none;
}

.btn-outline-red:active,
a.btn-outline-red:active {
	transform: translateY(0);
}

.btn-teal,
a.btn-teal {
	background: linear-gradient(135deg, var(--tc-primary), #44b8b5);
	color: white;
	border: none;
	border-radius: 1rem;
	padding: 0.9rem 1.5rem;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	box-shadow: 0 8px 20px rgba(31, 156, 157, 0.28);
	transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-teal:hover,
a.btn-teal:hover {
	opacity: 0.9;
	color: white;
	transform: translateY(-1px);
	box-shadow: 0 12px 28px rgba(31, 156, 157, 0.38);
	text-decoration: none;
}

.btn-teal:active,
a.btn-teal:active {
	transform: translateY(0);
	box-shadow: 0 4px 12px rgba(31, 156, 157, 0.22);
}

.btn-outline-teal,
a.btn-outline-teal {
	background: transparent;
	color: var(--tc-primary);
	border: 1.5px solid var(--tc-primary);
	border-radius: 1rem;
	padding: 0.9rem 1.5rem;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-outline-teal:hover,
a.btn-outline-teal:hover {
	background: linear-gradient(135deg, var(--tc-primary), #44b8b5);
	color: white;
	border-color: transparent;
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(31, 156, 157, 0.28);
	text-decoration: none;
}

.btn-outline-teal:active,
a.btn-outline-teal:active {
	transform: translateY(0);
}

.fade-up {
	animation: fadeUp 0.7s ease both;
}

.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }

@keyframes fadeUp {
	from {
		opacity: 0;
		transform: translateY(18px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.sidebar-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	z-index: 1045;
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}

.sidebar-overlay.active {
	display: block;
}

@media (max-width: 1199.98px) {
	.sidebar-col {
		height: 0;
		padding: 0 !important;
		overflow: visible;
		animation: none;
		transform: none;
	}

	.sidebar-panel {
		position: fixed;
		top: 0;
		left: -100%;
		width: min(300px, 85vw);
		height: 100vh;
		z-index: 1050;
		overflow-y: auto;
		border-radius: 0 32px 32px 0 !important;
		transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	}

	.sidebar-panel.sidebar-open {
		left: 0;
	}
}

@media (max-width: 767.98px) {
	.dashboard-shell {
		padding: 0.75rem;
	}

	.sidebar-panel,
	.header-bar,
	.content-wrap,
	.section-card {
		border-radius: 24px;
	}

	.page-title {
		font-size: 2rem;
	}
}

/* ===== Login Page ===== */
.page-action-bar {
	position: fixed;
	top: 1.25rem;
	right: 1.25rem;
	z-index: 10;
}

.login-page {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
}

.login-card {
	width: 100%;
	max-width: 440px;
	padding: 2.5rem;
}

.login-field {
	background: var(--tc-surface-soft);
	border: 1px solid var(--tc-border);
	border-radius: 1rem;
	color: var(--tc-text);
	padding: 0.85rem 1rem;
	width: 100%;
	font-family: inherit;
	font-size: 0.95rem;
	transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.login-field:focus {
	outline: none;
	border-color: var(--tc-primary);
	background: var(--tc-surface);
	box-shadow: 0 0 0 3px var(--tc-primary-soft);
}

.login-field::placeholder {
	color: var(--tc-muted);
}

.login-field-wrap {
	position: relative;
}

.login-field-icon {
	padding-right: 3rem;
}

.login-field-btn {
	position: absolute;
	right: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: none;
	color: var(--tc-muted);
	cursor: pointer;
	padding: 0.25rem;
	display: flex;
	align-items: center;
	transition: color 0.2s ease;
}

.login-field-btn:hover {
	color: var(--tc-text);
}

.btn-primary-tc {
	background: linear-gradient(135deg, var(--tc-primary), #44b8b5);
	color: white;
	border: none;
	border-radius: 1rem;
	padding: 0.9rem 1.5rem;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	width: 100%;
	cursor: pointer;
	box-shadow: var(--tc-shadow-soft);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-primary-tc:hover {
	opacity: 0.9;
	transform: translateY(-1px);
}

.btn-primary-tc:active {
	transform: translateY(0);
}


.login-error {
	background: rgba(228, 104, 104, 0.12);
	border: 1px solid rgba(228, 104, 104, 0.28);
	color: var(--tc-danger);
	border-radius: 1rem;
	padding: 0.75rem 1rem;
	font-size: 0.88rem;
}

@media (max-width: 767.98px) {
	.login-card {
		padding: 1.75rem;
	}
}

[x-cloak] { display: none !important; }

.transition { transition-property: color,background-color,border-color,opacity,transform; }
.ease-out { transition-timing-function: cubic-bezier(0,0,0.2,1); }
.ease-in  { transition-timing-function: cubic-bezier(0.4,0,1,1); }
.duration-200 { transition-duration: 200ms; }
.duration-150 { transition-duration: 150ms; }
.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }
.translate-y-1 { transform: translateY(4px); }
.translate-y-0 { transform: translateY(0); }