/* Shared centered portal popup (replaces alert/confirm) */
.portal-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(15, 23, 42, 0.45);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.18s ease, visibility 0.18s ease;
}
.portal-popup-overlay.is-open {
	opacity: 1;
	visibility: visible;
}
.portal-popup-card {
	width: 100%;
	max-width: 400px;
	background: #fff;
	border-radius: 18px;
	border: 1px solid #e5e9f2;
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
	padding: 28px 24px 20px;
	text-align: center;
	transform: translateY(10px) scale(0.98);
	transition: transform 0.2s ease;
	font-family: 'Noto Sans Thai', 'Inter', 'DM Sans', sans-serif;
}
.portal-popup-overlay.is-open .portal-popup-card {
	transform: translateY(0) scale(1);
}
.portal-popup-icon {
	width: 52px;
	height: 52px;
	margin: 0 auto 14px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
	line-height: 1;
}
.portal-popup-icon.success { background: #e8f8ef; color: #0d7a4e; }
.portal-popup-icon.error { background: #fdecec; color: #c0392b; }
.portal-popup-icon.warning { background: #fff6e5; color: #c47d00; }
.portal-popup-icon.info { background: #eef2ff; color: #1e46d4; }
.portal-popup-title {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 700;
	color: #1c2340;
}
.portal-popup-msg {
	margin: 0 0 22px;
	font-size: 14px;
	line-height: 1.55;
	color: #4a5270;
	white-space: pre-wrap;
	word-break: break-word;
}
.portal-popup-actions {
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
}
.portal-popup-btn {
	min-width: 96px;
	padding: 10px 18px;
	border-radius: 10px;
	border: 1px solid transparent;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.portal-popup-btn:active { transform: translateY(1px); }
.portal-popup-btn.primary {
	background: #1e46d4;
	color: #fff;
}
.portal-popup-btn.primary:hover { background: #1535a8; }
.portal-popup-btn.danger {
	background: #dc2626;
	color: #fff;
}
.portal-popup-btn.danger:hover { background: #b91c1c; }
.portal-popup-btn.ghost {
	background: #fff;
	color: #4a5270;
	border-color: #d8dce8;
}
.portal-popup-btn.ghost:hover {
	background: #f5f7fb;
	border-color: #c5cad8;
}

html[data-theme="dark"] .portal-popup-card {
	background: #1e2433;
	border-color: #2f374a;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .portal-popup-title { color: #f1f5f9; }
html[data-theme="dark"] .portal-popup-msg { color: #a8b0c4; }
html[data-theme="dark"] .portal-popup-btn.ghost {
	background: #262d3d;
	color: #cbd5e1;
	border-color: #3a4458;
}
html[data-theme="dark"] .portal-popup-btn.ghost:hover {
	background: #323a4d;
}
html[data-theme="dark"] .portal-popup-icon.success { background: rgba(13, 122, 78, 0.2); }
html[data-theme="dark"] .portal-popup-icon.error { background: rgba(192, 57, 43, 0.22); }
html[data-theme="dark"] .portal-popup-icon.warning { background: rgba(196, 125, 0, 0.22); }
html[data-theme="dark"] .portal-popup-icon.info { background: rgba(30, 70, 212, 0.22); }
