/* หน้าควบคุมข่าว (/hk-panel/) — ใช้งานง่าย ปุ่มใหญ่ ใช้บนมือถือได้ */
:root {
	--p-blue: #1d3fd8;
	--p-blue-2: #4fa3f7;
	--p-navy: #0b1b4d;
	--p-ink: #0f1a3a;
	--p-text: #3a4766;
	--p-muted: #6b7799;
	--p-line: #dce4f7;
	--p-soft: #eef3ff;
	--p-bg: #f3f7ff;
	--p-ok: #0f8a5f;
	--p-err: #c62f3a;
	--p-radius: 16px;
	--p-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
	box-sizing: border-box;
}

body.hkp {
	margin: 0;
	min-height: 100vh;
	background:
		radial-gradient(60vmax 40vmax at 0% 0%, rgba(108, 184, 255, 0.25), transparent 60%),
		radial-gradient(50vmax 40vmax at 100% 100%, rgba(29, 63, 216, 0.12), transparent 60%),
		var(--p-bg);
	color: var(--p-text);
	font-family: "Sarabun", "Nunito", sans-serif;
	font-size: 16px;
	line-height: 1.6;
}

h1, h2, h3,
.hkp-btn,
.hkp-title,
.hkp-brand strong {
	font-family: "Prompt", "Sarabun", sans-serif;
	color: var(--p-ink);
}

h1 {
	margin: 0 0 4px;
	font-size: 1.7rem;
	font-weight: 500;
}

h2 {
	margin: 0 0 14px;
	font-size: 1.1rem;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 10px;
}

h2 small {
	color: var(--p-muted);
	font-family: "Sarabun", sans-serif;
	font-size: 0.85rem;
	font-weight: 400;
}

a {
	color: var(--p-blue);
}

.hkp-sub {
	margin: 0;
	color: var(--p-muted);
}

/* --- ปุ่ม --- */
.hkp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 44px;
	padding: 0 18px;
	border: 1.5px solid var(--p-line);
	border-radius: 999px;
	background: #fff;
	color: var(--p-ink);
	font-size: 0.95rem;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.3s var(--p-ease), box-shadow 0.3s;
	white-space: nowrap;
}

.hkp-btn:hover {
	border-color: var(--p-blue-2);
	color: var(--p-blue);
}

.hkp-btn:active {
	transform: scale(0.97);
}

.hkp-btn.is-primary {
	border-color: transparent;
	background: linear-gradient(120deg, var(--p-blue), var(--p-blue-2));
	color: #fff;
	box-shadow: 0 10px 24px -12px rgba(29, 63, 216, 0.8);
}

.hkp-btn.is-primary:hover {
	color: #fff;
	box-shadow: 0 14px 28px -12px rgba(29, 63, 216, 0.95);
}

.hkp-btn.is-big {
	min-height: 52px;
	padding: 0 26px;
	font-size: 1.05rem;
}

.hkp-btn.is-block {
	width: 100%;
}

.hkp-btn.is-small {
	min-height: 36px;
	padding: 0 14px;
	font-size: 0.88rem;
}

.hkp-btn.is-ghost {
	background: transparent;
}

.hkp-btn.is-danger {
	color: var(--p-err);
	border-color: #f3c9cd;
	background: #fff;
}

.hkp-btn.is-danger:hover {
	background: var(--p-err);
	border-color: var(--p-err);
	color: #fff;
}

.hkp-link {
	color: var(--p-blue);
	text-decoration: none;
	font-size: 0.95rem;
}

.hkp-link:hover {
	text-decoration: underline;
}

/* --- แจ้งเตือน --- */
.hkp-toast {
	margin: 0 0 18px;
	padding: 12px 16px 12px 44px;
	border-radius: 12px;
	position: relative;
	font-size: 0.95rem;
	animation: hkp-in 0.4s var(--p-ease);
}

.hkp-toast::before {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 20px;
	height: 20px;
	border-radius: 50%;
	color: #fff;
	font-size: 0.75rem;
	line-height: 20px;
	text-align: center;
	font-weight: 700;
}

.hkp-toast.is-ok {
	background: #e6f6ef;
	color: #0b6b4a;
}

.hkp-toast.is-ok::before {
	content: "✓";
	background: var(--p-ok);
}

.hkp-toast.is-err {
	background: #fdecee;
	color: #a1222c;
}

.hkp-toast.is-err::before {
	content: "!";
	background: var(--p-err);
}

@keyframes hkp-in {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: none; }
}

/* --- หน้าเข้าสู่ระบบ --- */
.hkp-login {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
}

.hkp-login-card {
	width: min(100%, 400px);
	padding: 34px 28px 26px;
	border-radius: 26px;
	background: #fff;
	box-shadow: 0 1px 0 rgba(29, 63, 216, 0.06), 0 30px 60px -30px rgba(11, 27, 77, 0.45);
	text-align: center;
}

.hkp-login-card .hkp-logo {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--p-soft);
	margin-bottom: 14px;
}

.hkp-login-card .hkp-sub {
	margin-bottom: 22px;
}

.hkp-field {
	display: block;
	margin-bottom: 14px;
	text-align: left;
}

.hkp-field > span:first-child {
	display: block;
	margin-bottom: 6px;
	font-size: 0.92rem;
	color: var(--p-ink);
}

.hkp-field input,
.hkp-input,
.hkp-filter input,
.hkp-filter select {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border: 1.5px solid var(--p-line);
	border-radius: 12px;
	background: #fff;
	color: var(--p-ink);
	font: inherit;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.hkp-field input:focus,
.hkp-input:focus,
.hkp-filter input:focus,
.hkp-filter select:focus,
.hkp-rich:focus {
	outline: none;
	border-color: var(--p-blue-2);
	box-shadow: 0 0 0 4px rgba(79, 163, 247, 0.18);
}

.hkp-pass {
	position: relative;
	display: block;
}

.hkp-pass input {
	padding-right: 70px;
}

.hkp-eye {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	border: 0;
	background: var(--p-soft);
	color: var(--p-blue);
	border-radius: 8px;
	padding: 6px 10px;
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
}

.hkp-back-site {
	display: inline-block;
	margin-top: 18px;
	color: var(--p-muted);
	font-size: 0.9rem;
	text-decoration: none;
}

/* --- แถบบน --- */
.hkp-top {
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px clamp(14px, 3vw, 32px);
	background: rgba(255, 255, 255, 0.95);
	box-shadow: 0 1px 0 var(--p-line);
}

.hkp-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	min-width: 0;
}

.hkp-brand .hkp-logo {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	flex: 0 0 auto;
}

.hkp-brand span {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
	min-width: 0;
}

.hkp-brand strong {
	font-weight: 500;
	font-size: 1rem;
}

.hkp-brand small {
	color: var(--p-muted);
	font-size: 0.78rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.hkp-top-actions {
	display: flex;
	gap: 8px;
}

.hkp-top-actions form {
	margin: 0;
}

/* --- เนื้อหาหลัก --- */
.hkp-main {
	max-width: 1080px;
	margin: 0 auto;
	padding: clamp(20px, 3vw, 36px) clamp(14px, 3vw, 32px) 120px;
}

.hkp-main.is-narrow {
	max-width: 820px;
}

.hkp-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
	flex-wrap: wrap;
}

.hkp-filter {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 18px;
	flex-wrap: wrap;
}

.hkp-filter input {
	flex: 1 1 260px;
	width: auto;
}

.hkp-filter select {
	flex: 0 1 220px;
	width: auto;
}

/* --- รายการข่าว --- */
.hkp-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.hkp-item {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr) auto;
	align-items: center;
	gap: 16px;
	padding: 12px;
	border-radius: var(--p-radius);
	background: #fff;
	box-shadow: 0 0 0 1px var(--p-line);
	transition: box-shadow 0.3s, transform 0.3s var(--p-ease);
}

.hkp-item:hover {
	box-shadow: 0 0 0 1px var(--p-blue-2), 0 14px 30px -20px rgba(29, 63, 216, 0.5);
}

.hkp-item.is-highlight {
	box-shadow: 0 0 0 2px var(--p-blue-2), 0 14px 30px -20px rgba(29, 63, 216, 0.5);
	animation: hkp-in 0.6s var(--p-ease);
}

.hkp-thumb {
	width: 88px;
	height: 66px;
	border-radius: 10px;
	overflow: hidden;
	background: var(--p-soft);
	display: flex;
	align-items: center;
	justify-content: center;
}

.hkp-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hkp-noimg {
	color: var(--p-muted);
	font-size: 0.78rem;
}

.hkp-title {
	display: block;
	color: var(--p-ink);
	font-weight: 500;
	text-decoration: none;
	line-height: 1.4;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.hkp-title:hover {
	color: var(--p-blue);
}

.hkp-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 12px;
	margin-top: 4px;
	font-size: 0.85rem;
	color: var(--p-muted);
}

.hkp-status {
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 0.8rem;
}

.hkp-status.is-live {
	background: #e6f6ef;
	color: #0b6b4a;
}

.hkp-status.is-draft {
	background: #fff4e0;
	color: #8a5a00;
}

.hkp-status.is-future {
	background: var(--p-soft);
	color: var(--p-blue);
}

.hkp-cats {
	color: var(--p-blue);
}

.hkp-actions {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.hkp-actions form {
	margin: 0;
}

.hkp-empty {
	padding: 48px 20px;
	border-radius: var(--p-radius);
	background: #fff;
	text-align: center;
	box-shadow: 0 0 0 1px var(--p-line);
}

.hkp-pages {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 24px;
}

.hkp-pages a,
.hkp-pages span {
	min-width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 10px;
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 0 0 1px var(--p-line);
	text-decoration: none;
	color: var(--p-ink);
}

.hkp-pages .is-current {
	background: linear-gradient(120deg, var(--p-blue), var(--p-blue-2));
	color: #fff;
	box-shadow: none;
}

.hkp-pages .hkp-dots {
	box-shadow: none;
	background: none;
}

/* --- ฟอร์มเพิ่ม/แก้ไข --- */
.hkp-back {
	display: inline-block;
	margin-bottom: 10px;
}

.hkp-form h1 + * {
	margin-top: 0;
}

.hkp-card {
	margin: 16px 0;
	padding: clamp(18px, 3vw, 26px);
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 0 0 1px var(--p-line), 0 18px 36px -30px rgba(29, 63, 216, 0.5);
}

.hkp-step {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: linear-gradient(120deg, var(--p-blue), var(--p-blue-2));
	color: #fff;
	font-size: 0.9rem;
	flex: 0 0 auto;
}

.hkp-input.is-title {
	font-size: 1.15rem;
	font-family: "Prompt", "Sarabun", sans-serif;
}

.hkp-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.hkp-chip input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.hkp-chip span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 42px;
	padding: 0 16px;
	border-radius: 999px;
	border: 1.5px solid var(--p-line);
	background: #fff;
	cursor: pointer;
	user-select: none;
	transition: all 0.2s;
}

.hkp-chip span::before {
	content: "";
	width: 16px;
	height: 16px;
	border-radius: 5px;
	border: 1.5px solid #b7c4e8;
	transition: all 0.2s;
}

.hkp-chip input:checked + span {
	border-color: var(--p-blue);
	background: var(--p-soft);
	color: var(--p-blue);
}

.hkp-chip input:checked + span::before {
	border-color: var(--p-blue);
	background: var(--p-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") no-repeat center / 12px;
}

.hkp-chip input:focus-visible + span {
	box-shadow: 0 0 0 4px rgba(79, 163, 247, 0.25);
}

.hkp-more {
	margin-top: 12px;
}

.hkp-more summary {
	cursor: pointer;
	color: var(--p-blue);
	margin-bottom: 10px;
	font-size: 0.92rem;
}

/* พื้นที่วางรูป */
.hkp-drop {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 150px;
	padding: 18px;
	border: 2px dashed #b7c9f0;
	border-radius: 16px;
	background: #f7faff;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.2s, background-color 0.2s;
}

.hkp-drop:hover,
.hkp-drop.is-over {
	border-color: var(--p-blue-2);
	background: var(--p-soft);
}

.hkp-drop input[type="file"] {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

.hkp-drop-hint {
	color: var(--p-muted);
	font-size: 0.92rem;
}

.hkp-drop-hint strong {
	display: block;
	color: var(--p-blue);
	font-family: "Prompt", sans-serif;
	font-weight: 500;
	font-size: 1rem;
}

.hkp-drop-hint::before {
	content: "";
	display: block;
	width: 44px;
	height: 44px;
	margin: 0 auto 8px;
	border-radius: 14px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d3fd8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='9' cy='10' r='1.6'/%3E%3Cpath d='M21 16l-5-5-8 8'/%3E%3C/svg%3E") no-repeat center / 24px;
	box-shadow: 0 6px 16px -10px rgba(29, 63, 216, 0.6);
}

.hkp-drop.is-cover.has-image .hkp-drop-hint::before {
	display: none;
}

.hkp-drop-preview {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	pointer-events: none;
}

.hkp-drop-preview:empty {
	display: none;
}

.hkp-drop.is-cover .hkp-drop-preview img {
	max-width: 100%;
	max-height: 260px;
	border-radius: 12px;
	object-fit: cover;
}

.hkp-drop[data-preview="multi"] .hkp-drop-preview img {
	width: 84px;
	height: 84px;
	border-radius: 10px;
	object-fit: cover;
}

.hkp-note {
	margin: 10px 0 0;
	color: var(--p-muted);
	font-size: 0.86rem;
}

.hkp-check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
	color: var(--p-err);
	font-size: 0.92rem;
	cursor: pointer;
}

.hkp-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	gap: 8px;
	margin: 8px 0 14px;
}

.hkp-gimg {
	position: relative;
	aspect-ratio: 1;
	border-radius: 12px;
	overflow: hidden;
	cursor: pointer;
}

.hkp-gimg img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity 0.2s, filter 0.2s;
}

.hkp-gimg input {
	position: absolute;
	opacity: 0;
}

.hkp-gx {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: rgba(15, 26, 58, 0.75);
	color: #fff;
	font-size: 1rem;
	line-height: 26px;
	text-align: center;
}

.hkp-gimg input:checked ~ .hkp-gx {
	background: var(--p-err);
}

.hkp-gimg:has(input:checked) img {
	opacity: 0.3;
	filter: grayscale(1);
}

.hkp-gimg:has(input:checked)::after {
	content: "จะเอาออก";
	position: absolute;
	inset: auto 0 0 0;
	padding: 4px;
	background: var(--p-err);
	color: #fff;
	font-size: 0.75rem;
	text-align: center;
}

/* ตัวแก้ไขข้อความ */
.hkp-editor {
	border: 1.5px solid var(--p-line);
	border-radius: 14px;
	overflow: hidden;
}

.hkp-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 6px;
	background: #f7faff;
	border-bottom: 1px solid var(--p-line);
}

.hkp-toolbar button {
	min-width: 38px;
	height: 36px;
	padding: 0 10px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--p-ink);
	font: inherit;
	font-size: 0.9rem;
	cursor: pointer;
}

.hkp-toolbar button:hover {
	background: #fff;
	color: var(--p-blue);
	box-shadow: 0 0 0 1px var(--p-line);
}

.hkp-rich {
	min-height: 220px;
	padding: 14px 16px;
	font-size: 1rem;
	line-height: 1.8;
	color: var(--p-ink);
	border-radius: 0;
}

.hkp-rich:empty::before {
	content: attr(data-placeholder);
	color: #9aa6c4;
}

.hkp-rich img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

.hkp-rich h3 {
	font-size: 1.15rem;
}

/* ตัวเลือกสถานะ */
.hkp-radios {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.hkp-radio input {
	position: absolute;
	opacity: 0;
}

.hkp-radio span {
	display: flex;
	flex-direction: column;
	gap: 2px;
	height: 100%;
	padding: 14px 16px 14px 46px;
	border: 1.5px solid var(--p-line);
	border-radius: 14px;
	cursor: pointer;
	position: relative;
	transition: all 0.2s;
}

.hkp-radio span::before {
	content: "";
	position: absolute;
	left: 16px;
	top: 18px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid #b7c4e8;
}

.hkp-radio strong {
	font-family: "Prompt", sans-serif;
	font-weight: 500;
	color: var(--p-ink);
}

.hkp-radio small {
	color: var(--p-muted);
}

.hkp-radio input:checked + span {
	border-color: var(--p-blue);
	background: var(--p-soft);
}

.hkp-radio input:checked + span::before {
	border-color: var(--p-blue);
	background: radial-gradient(circle, var(--p-blue) 0 4px, transparent 5px);
}

/* แถบบันทึกติดด้านล่าง */
.hkp-savebar {
	position: sticky;
	bottom: 12px;
	z-index: 5;
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 20px;
	padding: 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 0 0 1px var(--p-line), 0 18px 40px -20px rgba(11, 27, 77, 0.5);
}

.hkp-uploading {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	background: rgba(243, 247, 255, 0.92);
	font-family: "Prompt", sans-serif;
	color: var(--p-ink);
}

.hkp-uploading[hidden] {
	display: none;
}

.hkp-spinner {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 4px solid var(--p-line);
	border-top-color: var(--p-blue);
	animation: hkp-spin 0.8s linear infinite;
}

@keyframes hkp-spin {
	to { transform: rotate(360deg); }
}

/* มือถือ */
@media (max-width: 720px) {
	.hkp-top-actions .hkp-btn {
		min-height: 38px;
		padding: 0 12px;
		font-size: 0.85rem;
	}

	.hkp-top-actions .hkp-btn[target] {
		display: none;
	}

	.hkp-item {
		grid-template-columns: 72px minmax(0, 1fr);
		gap: 12px;
	}

	.hkp-thumb {
		width: 72px;
		height: 56px;
	}

	.hkp-actions {
		grid-column: 1 / -1;
		justify-content: flex-start;
	}

	.hkp-radios {
		grid-template-columns: 1fr;
	}

	.hkp-head .hkp-btn.is-big {
		width: 100%;
	}

	.hkp-savebar {
		border-radius: 18px;
	}

	.hkp-savebar .hkp-btn {
		flex: 1 1 auto;
	}
}

/* ประกาศสำคัญ */
.hkp-status.is-pin {
	background: #e8efff;
	color: var(--p-blue);
}

.hkp-status.is-pin-off {
	background: #f1f2f6;
	color: var(--p-muted);
}

.hkp-btn.is-on {
	border-color: var(--p-blue);
	background: var(--p-soft);
	color: var(--p-blue);
}

.hkp-switch {
	display: block;
	cursor: pointer;
}

.hkp-switch input {
	position: absolute;
	opacity: 0;
}

.hkp-switch > span {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 14px 16px 14px 76px;
	border: 1.5px solid var(--p-line);
	border-radius: 14px;
	position: relative;
	transition: all 0.2s;
}

.hkp-switch > span::before {
	content: "";
	position: absolute;
	left: 16px;
	top: 50%;
	width: 44px;
	height: 26px;
	margin-top: -13px;
	border-radius: 999px;
	background: #cdd7ef;
	transition: background-color 0.25s;
}

.hkp-switch > span::after {
	content: "";
	position: absolute;
	left: 19px;
	top: 50%;
	width: 20px;
	height: 20px;
	margin-top: -10px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 6px rgba(11, 27, 77, 0.25);
	transition: transform 0.3s var(--p-ease);
}

.hkp-switch strong {
	font-family: "Prompt", sans-serif;
	font-weight: 500;
	color: var(--p-ink);
}

.hkp-switch small {
	color: var(--p-muted);
}

.hkp-switch input:checked + span {
	border-color: var(--p-blue);
	background: var(--p-soft);
}

.hkp-switch input:checked + span::before {
	background: var(--p-blue);
}

.hkp-switch input:checked + span::after {
	transform: translateX(18px);
}

.hkp-switch input:focus-visible + span {
	box-shadow: 0 0 0 4px rgba(79, 163, 247, 0.25);
}

.hkp-pin-until {
	margin-top: 14px;
}

.hkp-pin-until .hkp-field {
	max-width: 280px;
	margin-bottom: 0;
}

.hkp-card:has(.hkp-switch input:not(:checked)) .hkp-pin-until {
	display: none;
}

/* ===== แท็บเมนู + ใบสมัครเรียน ===== */
.hkp-top {
	flex-wrap: wrap;
}

.hkp-tabs {
	display: flex;
	gap: 4px;
	padding: 4px;
	border-radius: 999px;
	background: var(--p-soft);
	margin-right: auto;
	margin-left: 18px;
}

.hkp-tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 38px;
	padding: 0 18px;
	border-radius: 999px;
	color: var(--p-text);
	text-decoration: none;
	font-family: "Prompt", sans-serif;
	font-size: 0.95rem;
	transition: background-color 0.2s, color 0.2s;
}

.hkp-tab:hover {
	color: var(--p-blue);
}

.hkp-tab.is-active {
	background: #fff;
	color: var(--p-blue);
	box-shadow: 0 4px 12px -6px rgba(29, 63, 216, 0.4);
}

.hkp-tab-badge {
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--p-err);
	color: #fff;
	font-size: 0.75rem;
	line-height: 22px;
	text-align: center;
}

.hkp-head-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.hkp-btn.is-primary-soft {
	border-color: transparent;
	background: var(--p-soft);
	color: var(--p-blue);
}

.hkp-btn.is-primary-soft:hover {
	background: var(--p-blue);
	color: #fff;
}

.hka-sum {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 8px;
	margin-bottom: 18px;
}

.hka-sum-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 14px;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 0 0 1px var(--p-line);
	text-decoration: none;
	color: var(--p-muted);
	font-size: 0.82rem;
	line-height: 1.3;
	transition: box-shadow 0.2s, transform 0.3s var(--p-ease);
}

.hka-sum-item strong {
	font-family: "Prompt", sans-serif;
	font-size: 1.5rem;
	font-weight: 500;
	color: var(--p-ink);
}

.hka-sum-item.is-new strong {
	color: var(--p-err);
}

.hka-sum-item.is-ok strong {
	color: var(--p-ok);
}

.hka-sum-item:hover {
	box-shadow: 0 0 0 1px var(--p-blue-2);
}

.hka-sum-item.is-current {
	box-shadow: 0 0 0 2px var(--p-blue);
	background: var(--p-soft);
}

.hka-item {
	grid-template-columns: 52px minmax(0, 1fr) auto;
}

.hka-item.is-new {
	box-shadow: 0 0 0 1px var(--p-line), inset 4px 0 0 var(--p-err);
}

.hka-avatar {
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: linear-gradient(135deg, #dce9ff, #eef3ff);
	color: var(--p-blue);
	font-family: "Prompt", sans-serif;
	font-size: 1.3rem;
	text-decoration: none;
}

.hka-no {
	font-family: "Prompt", sans-serif;
	color: var(--p-ink);
	font-variant-numeric: tabular-nums;
}

.hkp-title small {
	color: var(--p-muted);
	font-weight: 400;
}

.hkp-status.hka-st.is-new {
	background: #fdecee;
	color: #a1222c;
}

.hkp-status.hka-st.is-wait {
	background: #fff4e0;
	color: #8a5a00;
}

.hkp-status.hka-st.is-ok {
	background: #e6f6ef;
	color: #0b6b4a;
}

.hkp-status.hka-st.is-off {
	background: #f1f2f6;
	color: var(--p-muted);
}

/* รายละเอียดใบสมัคร */
.hka-view-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin: 6px 0 14px;
}

.hka-view-head h1 small {
	font-size: 0.7em;
	color: var(--p-muted);
	font-weight: 400;
}

.hka-view-head .hkp-status {
	flex: 0 0 auto;
	margin-top: 6px;
	font-size: 0.9rem;
	padding: 4px 14px;
}

.hka-view-no,
.hka-view-level {
	margin: 0;
	color: var(--p-muted);
}

.hka-view-level {
	color: var(--p-blue);
	font-family: "Prompt", sans-serif;
}

.hka-quick {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.hka-st-pick {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 14px;
}

.hka-st-opt input {
	position: absolute;
	opacity: 0;
}

.hka-st-opt span {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 16px;
	border-radius: 999px;
	border: 1.5px solid var(--p-line);
	cursor: pointer;
	transition: all 0.2s;
}

.hka-st-opt input:checked + span {
	border-color: var(--p-blue);
	background: var(--p-blue);
	color: #fff;
}

.hka-st-opt.is-new input:checked + span {
	border-color: var(--p-err);
	background: var(--p-err);
}

.hka-st-opt.is-ok input:checked + span {
	border-color: var(--p-ok);
	background: var(--p-ok);
}

.hka-st-opt.is-off input:checked + span {
	border-color: var(--p-muted);
	background: var(--p-muted);
}

.hka-st-opt input:focus-visible + span {
	box-shadow: 0 0 0 4px rgba(79, 163, 247, 0.25);
}

.hka-status-form .hkp-field {
	max-width: 560px;
}

.hka-data dl {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px 24px;
	margin: 0;
}

.hka-data dl div.is-wide {
	grid-column: 1 / -1;
}

.hka-data dt {
	color: var(--p-muted);
	font-size: 0.85rem;
}

.hka-data dd {
	margin: 2px 0 0;
	color: var(--p-ink);
	overflow-wrap: anywhere;
}

.hka-log ol {
	list-style: none;
	margin: 0;
	padding: 0 0 0 18px;
	border-left: 2px solid var(--p-line);
	display: grid;
	gap: 12px;
}

.hka-log li {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	font-size: 0.92rem;
}

.hka-log li::before {
	content: "";
	position: absolute;
	left: -25px;
	top: 6px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--p-blue);
	box-shadow: 0 0 0 3px #fff;
}

.hka-log time {
	color: var(--p-muted);
}

.hka-log b {
	color: var(--p-ink);
	font-weight: 500;
}

.hka-log span {
	flex-basis: 100%;
	color: var(--p-text);
}

.hka-delete {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 26px;
	color: var(--p-muted);
	font-size: 0.85rem;
}

@media (max-width: 900px) {
	.hka-sum {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 720px) {
	.hkp-tabs {
		order: 3;
		width: 100%;
		margin: 6px 0 0;
	}

	.hkp-tab {
		flex: 1;
		justify-content: center;
	}

	.hka-sum {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.hka-item {
		grid-template-columns: 44px minmax(0, 1fr);
	}

	.hka-avatar {
		width: 44px;
		height: 44px;
	}

	.hka-data dl {
		grid-template-columns: 1fr;
	}

	.hka-view-head {
		flex-direction: column;
	}
}

/* พิมพ์ใบสมัคร */
@media print {
	body.hkp {
		background: #fff;
	}

	.hkp-top,
	.hkp-back,
	.hka-quick,
	.hka-status-form,
	.hka-delete,
	.hkp-toast {
		display: none !important;
	}

	.hkp-main {
		padding: 0;
	}

	.hkp-card {
		box-shadow: none;
		border: 1px solid #ccc;
		break-inside: avoid;
		padding: 12px 16px;
		margin: 10px 0;
	}
}

.hka-data dl .hka-data-sub {
	margin-top: 6px;
	padding-top: 12px;
	border-top: 1px dashed var(--p-line);
	color: var(--p-blue);
	font-family: "Prompt", sans-serif;
	font-weight: 500;
}

.hka-data dl .hka-data-sub:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

/* ===== หน้าภาพรวม ===== */
.hkp-main.is-wide {
	max-width: 1240px;
}

.hkp-dash-hello {
	margin-bottom: 20px;
}

.hkp-dash {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 22px;
	align-items: start;
}

.hkp-dash-col {
	position: relative;
	padding: clamp(20px, 2.6vw, 30px);
	border-radius: 24px;
	background: #fff;
	box-shadow: 0 0 0 1px var(--p-line), 0 24px 48px -36px rgba(29, 63, 216, 0.55);
	overflow: hidden;
}

.hkp-dash-col::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--p-blue), var(--p-blue-2));
}

.hkp-dash-col.is-apps::before {
	background: linear-gradient(90deg, #0f8a5f, #4cc9a0);
}

.hkp-dash-head {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 18px;
}

.hkp-dash-head h2 {
	margin: 0;
	font-size: 1.3rem;
}

.hkp-dash-head p {
	margin: 0;
	color: var(--p-muted);
	font-size: 0.9rem;
}

.hkp-dash-icon {
	width: 52px;
	height: 52px;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 16px;
	background: var(--p-soft);
	font-size: 1.5rem;
}

.is-apps .hkp-dash-icon {
	background: #e8f7f0;
}

.hkp-dash-stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
	margin-bottom: 16px;
}

.hkp-dash-stats a {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px;
	border-radius: 14px;
	background: #f7faff;
	text-decoration: none;
	color: var(--p-muted);
	font-size: 0.8rem;
	line-height: 1.3;
	transition: background-color 0.2s, box-shadow 0.2s;
}

.hkp-dash-stats a:hover {
	background: var(--p-soft);
	box-shadow: 0 0 0 1px var(--p-blue-2);
}

.hkp-dash-stats strong {
	font-family: "Prompt", sans-serif;
	font-size: 1.6rem;
	font-weight: 500;
	color: var(--p-ink);
}

.hkp-dash-stats a.is-alert strong {
	color: var(--p-err);
}

.hkp-dash-stats a.is-good strong {
	color: var(--p-ok);
}

.hkp-dash-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 22px;
}

.hkp-dash-sub {
	margin: 0 0 8px;
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--p-muted);
}

.hkp-dash-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 4px;
}

.hkp-dash-list a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: 12px;
	text-decoration: none;
	color: inherit;
	transition: background-color 0.2s;
}

.hkp-dash-list a:hover {
	background: #f4f8ff;
}

.hkp-dash-thumb {
	width: 56px;
	height: 42px;
	flex: 0 0 auto;
	border-radius: 8px;
	overflow: hidden;
	background: var(--p-soft);
}

.hkp-dash-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hkp-dash-list .hka-avatar {
	width: 42px;
	height: 42px;
	font-size: 1.05rem;
}

.hkp-dash-txt {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.hkp-dash-txt b {
	font-weight: 500;
	color: var(--p-ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.hkp-dash-txt small {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	color: var(--p-muted);
	font-size: 0.8rem;
}

.hkp-dash-txt .hkp-status {
	font-size: 0.72rem;
	padding: 1px 8px;
}

.hkp-dash-empty {
	padding: 18px;
	border-radius: 14px;
	background: #f7faff;
	color: var(--p-muted);
	font-size: 0.92rem;
}

/* วันที่ลงข่าว */
.hkp-date {
	margin-bottom: 18px;
}

.hkp-date .hkp-input {
	max-width: 300px;
}

.hkp-date .hkp-note {
	display: block;
	margin-top: 6px;
}

.hkp-date-quick {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

@media (max-width: 960px) {
	.hkp-dash {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 520px) {
	.hkp-dash-stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.hkp-dash-actions .hkp-btn {
		flex: 1 1 auto;
	}
}

.hkp-dash-list a {
	min-width: 0;
}

.hkp-dash-txt {
	flex: 1 1 auto;
	overflow: hidden;
}

.hkp-dash-col,
.hkp-dash-list li {
	min-width: 0;
}

/* ===== วันนัด ===== */
.hka-visit-chip {
	padding: 1px 10px;
	border-radius: 999px;
	background: #e6f6ef;
	color: #0b6b4a;
	font-size: 0.8rem;
}

.hka-view-visit {
	display: inline-block;
	margin: 8px 0 0;
	padding: 6px 14px;
	border-radius: 12px;
	background: #e6f6ef;
	color: #0b6b4a;
}

.hka-view-visit strong {
	font-weight: 500;
}

.hka-move .hkp-input {
	max-width: 260px;
}

.hka-set-range {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	margin-bottom: 18px;
}

.hka-set-closed {
	min-height: 140px;
	font-family: ui-monospace, Consolas, monospace;
	font-size: 0.92rem;
	resize: vertical;
}

.hka-holidays {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 6px 20px;
}

.hka-holidays li {
	display: flex;
	gap: 10px;
	padding: 6px 0;
	border-bottom: 1px dashed var(--p-line);
	font-size: 0.9rem;
}

.hka-holidays time {
	flex: 0 0 120px;
	color: var(--p-blue);
}

.hkp-dash-date {
	width: 46px;
	height: 46px;
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	background: #e6f6ef;
	color: #0b6b4a;
	line-height: 1.1;
}

.hkp-dash-date b {
	font-family: "Prompt", sans-serif;
	font-size: 1.1rem;
	font-weight: 500;
}

.hkp-dash-date small {
	font-size: 0.66rem;
}

.hkp-dash-date.is-today {
	background: #0f8a5f;
	color: #fff;
}

@media (max-width: 720px) {
	.hka-set-range,
	.hka-holidays {
		grid-template-columns: 1fr;
	}
}

/* ล้างข้อมูลใบสมัคร */
.hka-purge-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

.hka-purge-table th,
.hka-purge-table td {
	padding: 10px 8px;
	border-bottom: 1px solid var(--p-line);
	text-align: left;
}

.hka-purge-table th {
	color: var(--p-muted);
	font-weight: 500;
	font-size: 0.85rem;
}

.hka-purge {
	border: 1.5px solid #f3c9cd;
}

.hka-purge .hkp-field,
.hka-purge .hkp-radios {
	margin-bottom: 16px;
}

.hka-purge select.hkp-input {
	max-width: 280px;
}

.hka-purge-confirm .hkp-input {
	max-width: 200px;
}

/* เปลี่ยนรหัสผ่าน */
.hkp-pass-form {
	max-width: 480px;
	margin: 0 auto;
	display: grid;
	gap: 14px;
}

.hkp-pass-form h1 {
	margin: 0;
	font-size: 1.4rem;
}

.hkp-pass-actions {
	display: flex;
	gap: 10px;
	margin-top: 4px;
}

.hkp-pass-warn a {
	color: inherit;
	font-weight: 600;
}
