:root {
	--bg: #f3f7ff;
	--bg-2: #e8f1ff;
	--ink: #0b1b33;
	--muted: #5b6b86;
	--line: #d7e4fb;
	--card: #ffffff;
	--primary: #1d6ef5;
	--primary-2: #0b4ed1;
	--accent: #3ec6ff;
	--glow: rgba(29, 110, 245, 0.18);
	--success: #12b886;
	--warning: #f59f00;
	--danger: #e03131;
	--shadow: 0 18px 50px rgba(13, 54, 120, 0.10);
	--radius: 22px;
	--font: "IBM Plex Sans Thai", "Sarabun", "Segoe UI", sans-serif;
	--display: "Manrope", "IBM Plex Sans Thai", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	font-family: var(--font);
	color: var(--ink);
	background:
		radial-gradient(900px 420px at 8% -10%, rgba(62, 198, 255, 0.28), transparent 55%),
		radial-gradient(800px 380px at 100% 0%, rgba(29, 110, 245, 0.20), transparent 50%),
		radial-gradient(700px 400px at 50% 110%, rgba(29, 110, 245, 0.10), transparent 45%),
		linear-gradient(180deg, #f7faff 0%, var(--bg) 40%, #eef4ff 100%);
	min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }

.orb {
	position: fixed;
	border-radius: 50%;
	filter: blur(40px);
	pointer-events: none;
	z-index: 0;
}
.orb-a { width: 280px; height: 280px; background: rgba(62, 198, 255, 0.22); top: 80px; right: -80px; }
.orb-b { width: 220px; height: 220px; background: rgba(29, 110, 245, 0.16); bottom: 40px; left: -70px; }

.wrap { position: relative; z-index: 1; width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.wrap-sm { width: min(560px, calc(100% - 28px)); }

.brand {
	display: flex;
	align-items: center;
	gap: 12px;
	font-family: var(--display);
	font-weight: 800;
	letter-spacing: -0.03em;
	color: var(--ink);
}
.brand-mark {
	width: 42px; height: 42px;
	border-radius: 14px;
	background: linear-gradient(145deg, #3ec6ff, #1d6ef5 55%, #0b4ed1);
	box-shadow: 0 10px 24px rgba(29, 110, 245, 0.35);
	display: grid; place-items: center;
	color: #fff;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

.topbar {
	display: flex; align-items: center; justify-content: space-between;
	padding: 22px 0 10px;
}
.topbar-center {
	justify-content: center;
	text-align: center;
}
.card {
	background: rgba(255,255,255,0.86);
	backdrop-filter: blur(16px);
	border: 1px solid rgba(255,255,255,0.8);
	box-shadow: var(--shadow);
	border-radius: var(--radius);
}
.hero-card { padding: 28px 26px 30px; }
.center { text-align: center; }

.kicker {
	display: inline-flex; align-items: center; gap: 8px;
	background: #eaf2ff; color: var(--primary-2);
	border-radius: 999px; padding: 6px 12px;
	font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
}
.h1 { font-family: var(--display); font-size: 34px; line-height: 1.15; margin: 12px 0 8px; letter-spacing: -0.04em; }
.h2 { font-family: var(--display); font-size: 24px; margin: 0 0 8px; letter-spacing: -0.03em; }
.lead { color: var(--muted); margin: 0 0 22px; line-height: 1.7; }

.amount {
	font-family: var(--display);
	font-size: 42px; font-weight: 800;
	letter-spacing: -0.05em;
	background: linear-gradient(90deg, #0b4ed1, #1d6ef5 45%, #12b0ff);
	-webkit-background-clip: text; background-clip: text; color: transparent;
}
.meta { color: var(--muted); font-size: 14px; line-height: 1.7; }
.meta b { color: var(--ink); }

.qr-box {
	width: min(320px, 100%);
	margin: 18px auto;
	padding: 16px;
	background: #fff;
	border-radius: 24px;
	border: 1px solid var(--line);
	box-shadow: 0 12px 30px rgba(29, 110, 245, 0.12);
}
.qr-box img { display: block; width: 100%; border-radius: 12px; }
.qr-merchant {
	margin: -4px 0 14px;
	color: var(--ink);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.7;
}
.qr-merchant b {
	font-family: var(--display);
	letter-spacing: 0.02em;
}

.timer {
	display: flex; align-items: center; justify-content: center; gap: 16px;
	margin: 8px 0 18px;
}
.ring { width: 74px; height: 74px; }
.ring svg { transform: rotate(-90deg); }
.ring-track { fill: none; stroke: #e4edff; stroke-width: 7; }
.ring-bar { fill: none; stroke: url(#timerGrad); stroke-width: 7; stroke-linecap: round; }
.timer-copy { text-align: left; }
.timer-copy .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.timer-copy .time {
	font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -0.04em; color: var(--primary-2);
}

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 8px; }
.step {
	background: #f6f9ff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 10px;
	font-size: 13px; color: var(--muted);
}
.step b { display: block; color: var(--ink); margin-bottom: 4px; }

.pay-steps {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0;
	margin: 6px 0 16px;
	padding: 16px 10px 14px;
	background: rgba(255,255,255,0.78);
	border: 1px solid rgba(255,255,255,0.9);
	box-shadow: var(--shadow);
	border-radius: 20px;
}
.pay-step {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-align: center;
	padding: 0 8px;
	min-width: 0;
}
.pay-step:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 15px;
	left: calc(50% + 18px);
	width: calc(100% - 36px);
	height: 2px;
	background: #d7e4fb;
	z-index: 0;
}
.pay-step.is-done:not(:last-child)::after {
	background: linear-gradient(90deg, #1d6ef5, #8bb6ff);
}
.pay-step-num {
	position: relative;
	z-index: 1;
	width: 30px; height: 30px;
	border-radius: 50%;
	display: grid; place-items: center;
	background: #eef4ff;
	color: var(--muted);
	font-family: var(--display);
	font-size: 13px; font-weight: 800;
	border: 2px solid #d7e4fb;
}
.pay-step.is-current .pay-step-num {
	background: linear-gradient(145deg, #3ec6ff, #1d6ef5);
	color: #fff;
	border-color: #1d6ef5;
	box-shadow: 0 8px 16px rgba(29, 110, 245, 0.28);
}
.pay-step.is-done .pay-step-num {
	background: #e6fff4;
	color: #087f5b;
	border-color: #12b886;
}
.pay-step-label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--muted);
	max-width: 100%;
}
.pay-step.is-current .pay-step-label { color: var(--ink); }
.pay-step.is-done .pay-step-label { color: #087f5b; }
.pay-steps.is-interactive .pay-step.is-done,
.pay-steps.is-interactive .pay-step.is-current {
	cursor: pointer;
}

.pay-panel[hidden] { display: none !important; }
.step-head { text-align: center; }
.step-head .h2 { margin-top: 0; }
.btn-stack { display: grid; gap: 8px; margin-top: 4px; }
.btn-stack .btn { width: 100%; }
.pay-summary {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	background: #f4f8ff; border: 1px solid var(--line); border-radius: 14px;
	padding: 12px 14px; margin: 0 0 16px; font-size: 14px; color: var(--muted);
}
.pay-summary b { color: var(--primary-2); font-family: var(--display); font-size: 16px; }
[hidden] { display: none !important; }
.dropzone {
	position: relative;
	border: 1.5px dashed #9dbcf0;
	border-radius: 18px;
	padding: 22px 18px;
	background:
		linear-gradient(180deg, rgba(247,250,255,0.95), rgba(238,244,255,0.9));
	text-align: center;
	color: var(--muted);
	cursor: pointer;
	transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.dropzone:hover,
.dropzone.is-dragover {
	border-color: #1d6ef5;
	background: linear-gradient(180deg, #f3f8ff, #eaf2ff);
	box-shadow: 0 0 0 4px rgba(29,110,245,.12);
}
.dropzone.is-dragover {
	border-style: solid;
	transform: scale(1.01);
}
.dropzone.is-filled {
	cursor: default;
	border-style: solid;
	border-color: #b7d0f8;
	background: #fff;
	padding: 14px;
}
.dropzone.is-filled:hover {
	transform: none;
	box-shadow: none;
	border-color: #b7d0f8;
	background: #fff;
}
.dropzone.is-filled.is-dragover {
	border-color: #1d6ef5;
	box-shadow: 0 0 0 4px rgba(29,110,245,.12);
	background: linear-gradient(180deg, #f3f8ff, #eaf2ff);
}
.dropzone.is-error {
	border-color: #f08c8c;
	background: #fff8f8;
	box-shadow: 0 0 0 4px rgba(224,49,49,.08);
}
.dropzone-input {
	position: absolute;
	width: 1px; height: 1px;
	opacity: 0;
	pointer-events: none;
}
.dropzone-icon {
	width: 56px; height: 56px;
	margin: 0 auto 12px;
	border-radius: 16px;
	display: grid; place-items: center;
	color: #1d6ef5;
	background: linear-gradient(180deg, #ffffff, #eaf2ff);
	border: 1px solid #d5e4ff;
	box-shadow: 0 8px 18px rgba(29,110,245,.12);
}
.dropzone.is-dragover .dropzone-icon {
	background: linear-gradient(145deg, #3ec6ff, #1d6ef5);
	color: #fff;
	border-color: #1d6ef5;
}
.dropzone-title {
	color: var(--ink);
	font-weight: 800;
	font-size: 16px;
	letter-spacing: -0.02em;
}
.dropzone-sub {
	margin: 4px 0 14px;
	font-size: 13px;
	line-height: 1.5;
}
.dropzone-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 0 16px;
	border-radius: 999px;
	background: #1d6ef5;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	box-shadow: 0 8px 16px rgba(29,110,245,.22);
}
.dropzone-meta {
	margin-top: 12px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.01em;
}
.dropzone-preview {
	display: grid;
	gap: 12px;
	justify-items: center;
}
.dropzone-thumb {
	width: min(220px, 100%);
	background: #f4f8ff;
	border: 1px solid var(--line);
	border-radius: 14px;
	overflow: hidden;
}
.dropzone-thumb img {
	display: block;
	width: 100%;
	max-height: 220px;
	object-fit: contain;
	background: #fff;
}
.dropzone-file {
	min-width: 0;
	max-width: 100%;
}
.dropzone-file strong {
	display: block;
	color: var(--ink);
	font-size: 14px;
	word-break: break-all;
}
.dropzone-file span {
	display: block;
	margin-top: 2px;
	color: #087f5b;
	font-size: 12px;
	font-weight: 700;
}
.dropzone-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: center;
}
.dropzone-change,
.dropzone-remove {
	appearance: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	border-radius: 999px;
	padding: 8px 14px;
}
.dropzone-change {
	background: #eef4ff;
	color: var(--primary-2);
	border: 1px solid #d5e4ff;
}
.dropzone-remove {
	background: #fff1f1;
	color: var(--danger);
}
.dropzone-error {
	margin-top: 10px;
	color: #c92a2a;
	font-size: 13px;
	font-weight: 700;
}
.confirm-list {
	background: #f7faff; border: 1px solid var(--line); border-radius: 16px;
	padding: 4px 16px; margin-bottom: 14px;
}
.confirm-row {
	display: flex; justify-content: space-between; gap: 12px;
	padding: 12px 0; border-bottom: 1px solid #e8effb; font-size: 14px;
}
.confirm-row:last-child { border-bottom: 0; }
.confirm-row span { color: var(--muted); flex: 0 0 auto; }
.confirm-row b { text-align: right; word-break: break-word; }
.confirm-amount { color: var(--primary-2); font-family: var(--display); }
.confirm-slip-preview {
	margin: 0 0 16px; padding: 10px; background: #fff;
	border: 1px solid var(--line); border-radius: 16px; text-align: center;
}
.confirm-slip-preview img { max-height: 220px; border-radius: 10px; }

.btn {
	appearance: none; border: 0; cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	border-radius: 14px; padding: 13px 18px;
	font-family: inherit; font-weight: 700; font-size: 15px;
	transition: .18s ease;
}
.btn-primary {
	width: 100%; color: #fff;
	background: linear-gradient(180deg, #3b82f6, #1d6ef5 55%, #1558d6);
	box-shadow: 0 12px 24px rgba(29, 110, 245, 0.28);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-line {
	width: 100%; color: #fff;
	background: linear-gradient(180deg, #06c755, #05a847);
	box-shadow: 0 12px 24px rgba(6, 199, 85, 0.22);
}
.btn-ghost {
	background: #eef4ff; color: var(--primary-2); border: 1px solid #d5e4ff;
	text-decoration: none;
}
.btn-danger { background: #fff1f1; color: var(--danger); }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; width: auto; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row form { display: inline; margin: 0; }

.field { margin-bottom: 14px; text-align: left; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field .req { color: var(--danger); }
.field input, .field textarea, .field select {
	width: 100%; border: 1px solid #d7e3f7; background: #fff;
	border-radius: 12px; padding: 12px 13px; font: inherit; color: var(--ink);
	outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus {
	border-color: #8bb6ff; box-shadow: 0 0 0 4px rgba(29,110,245,.12);
}
.field input.is-invalid,
.field textarea.is-invalid {
	border-color: #f08c8c;
	box-shadow: 0 0 0 4px rgba(224,49,49,.08);
}
.field-error {
	margin-top: 6px;
	color: #c92a2a;
	font-size: 12px;
	font-weight: 700;
}
.alert {
	border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; font-size: 14px;
}
.alert-error { background: #fff1f1; color: #c92a2a; }
.alert-ok { background: #e8fff4; color: #087f5b; }
.alert-info { background: #eef5ff; color: #1c4e9b; }

.txn {
	margin: 18px 0;
	padding: 18px 16px 16px;
	border-radius: 18px;
	background: linear-gradient(180deg, #fff8db, #fff3bf);
	border: 2px solid #f5c006;
	box-shadow: 0 10px 24px rgba(245, 159, 0, 0.18);
}
.txn span {
	display: block;
	font-size: 13px;
	color: #9c6b00;
	font-weight: 800;
	letter-spacing: 0.04em;
}
.txn b {
	display: block;
	margin-top: 10px;
	font-family: var(--display);
	font-size: 32px;
	font-weight: 800;
	letter-spacing: 0.08em;
	color: #0b4ed1;
	line-height: 1.3;
	word-break: break-all;
	background: #fff;
	border-radius: 12px;
	padding: 12px 10px;
	box-shadow: inset 0 -8px 0 rgba(255, 224, 102, 0.9);
	user-select: all;
	-webkit-user-select: all;
}

.check {
	width: 72px; height: 72px; margin: 0 auto 12px;
	border-radius: 50%;
	display: grid; place-items: center;
	background: linear-gradient(145deg, #3ec6ff, #1d6ef5);
	color: #fff; box-shadow: 0 12px 28px rgba(29,110,245,.28);
}

.footer-note { text-align: center; color: var(--muted); font-size: 12px; padding: 22px 0 28px; }

/* Admin */
.admin-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side {
	background: linear-gradient(180deg, #0b1b33 0%, #10284d 55%, #0d2140 100%);
	color: #d7e6ff; padding: 22px 16px;
}
.side .brand { color: #fff; margin: 6px 8px 28px; }
.side .brand small { color: #8fb0e8; }
.nav a {
	display: flex; align-items: center; justify-content: space-between;
	color: #c9dbf8; padding: 11px 12px; border-radius: 12px; margin-bottom: 6px; font-weight: 600;
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,0.08); color: #fff; }
.nav .count {
	background: #1d6ef5; color: #fff; border-radius: 999px; min-width: 22px;
	text-align: center; font-size: 11px; padding: 2px 6px;
}
.main { padding: 22px 24px 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.page-head h1 { margin: 0; font-family: var(--display); font-size: 28px; letter-spacing: -0.04em; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { padding: 16px 16px 14px; }
.stat .n { font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: -0.04em; }
.stat .t { color: var(--muted); font-size: 13px; font-weight: 600; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid #e8effb; font-size: 14px; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.badge {
	display: inline-flex; align-items: center; border-radius: 999px;
	padding: 4px 10px; font-size: 12px; font-weight: 700;
}
.badge-pending { background: #eef4ff; color: #1d6ef5; }
.badge-review { background: #fff4db; color: #c27b00; }
.badge-paid { background: #e6fff4; color: #087f5b; }
.badge-expired { background: #f1f3f5; color: #495057; }
.badge-rejected { background: #ffe3e3; color: #c92a2a; }
.badge-cancelled { background: #f1f3f5; color: #868e96; }
.badge-multi { background: #efe7ff; color: #5f3dc4; }

.switch-card {
	display: flex; align-items: flex-start; gap: 12px;
	border: 1px solid var(--line); border-radius: 16px;
	padding: 14px 16px; background: #f7faff; cursor: pointer;
}
.switch-card input { width: auto; margin-top: 3px; flex: 0 0 auto; }
.switch-card b { display: block; margin-bottom: 2px; }
.switch-card:has(input:checked) {
	border-color: #1d6ef5;
	box-shadow: 0 0 0 4px rgba(29,110,245,.12);
	background: #f4f8ff;
}

.packages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pkg {
	border: 1px solid var(--line); border-radius: 16px; padding: 14px;
	background: #fff; cursor: pointer; position: relative;
}
.pkg input { position: absolute; opacity: 0; }
.pkg b { display: block; font-family: var(--display); font-size: 20px; }
.pkg.active, .pkg:has(input:checked) {
	border-color: #1d6ef5;
	box-shadow: 0 0 0 4px rgba(29,110,245,.12);
	background: #f4f8ff;
}

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); padding: 28px 26px 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.slip-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; }
.copy-box {
	display: flex; gap: 8px; align-items: center;
	background: #f6f9ff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px;
}
.copy-box input { border: 0; background: transparent; width: 100%; font: inherit; color: var(--ink); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters a { padding: 7px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 700; }
.filters a.on { background: #1d6ef5; color: #fff; border-color: #1d6ef5; }

@media (max-width: 900px) {
	.admin-shell { grid-template-columns: 1fr; }
	.side { padding-bottom: 8px; }
	.nav { display: flex; gap: 6px; overflow: auto; }
	.nav a { white-space: nowrap; }
	.stats, .packages, .detail-grid, .steps, .grid-2 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
	.h1 { font-size: 28px; }
	.amount { font-size: 34px; }
	.txn b { font-size: 24px; letter-spacing: 0.04em; }
	.stats, .packages, .detail-grid, .steps, .grid-2 { grid-template-columns: 1fr; }
	.main { padding: 16px 14px 32px; }
	.pay-steps { padding: 14px 6px 12px; }
	.pay-step { padding: 0 4px; }
	.pay-step-label { font-size: 11px; }
}
