/*
 * Module tracnghiem trên theme gdnn_thi (lõi NukeViet tự nạp tệp này trên các trang của module).
 * Trang thông tin thí sinh, màn hình làm bài (phiếu trả lời trái - đề phải, co giãn theo màn hình), hộp thoại.
 */

.tn-inline {
	display: inline;
	margin: 0;
}

.tn-btn-lg {
	padding: 11px 26px;
	font-size: 16px;
}

/* ------------------------------------------------------------------ THÔNG TIN THÍ SINH */

.tn-info {
	max-width: 980px;
	margin: 0 auto;
}

.tn-info-grid {
	display: grid;
	margin: 6px 0 16px;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 8px 16px;
}

.tn-info-grid > div {
	padding: 8px 12px;
	border: 1px solid var(--gd-line);
	border-radius: 8px;
	background: var(--gd-green-soft);
}

.tn-info-grid dt {
	color: var(--gd-muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.tn-info-grid dd {
	margin: 2px 0 0;
	color: var(--gd-ink);
	font-size: 15px;
}

.tn-left {
	color: var(--gd-red);
	font-variant-numeric: tabular-nums;
}

.tn-info .tn-actions {
	margin-top: 16px;
}

/* ------------------------------------------------------------------ MÀN HÌNH LÀM BÀI */

.tn-exam-page .gd-breadcrumbs {
	display: none;
}

.tn-exam-head {
	display: flex;
	margin-bottom: 16px;
	padding: 14px 18px;
	align-items: center;
	gap: 16px;
}

.tn-exam-info {
	flex: 1 1 auto;
	margin: 0;
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tn-exam-info > div {
	padding: 6px 10px;
}

.tn-exam-info dd {
	overflow-wrap: anywhere;
}

.tn-exam-side {
	display: flex;
	flex: 0 0 auto;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	min-width: 190px;
}

.tn-timer {
	padding: 6px 14px 8px;
	border: 1px solid #fecaca;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 6px 18px -10px rgba(220, 38, 38, 0.5);
	text-align: center;
}

.tn-timer-label {
	display: block;
	color: var(--gd-muted);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
}

.tn-timer-value {
	color: var(--gd-red);
	font-size: 30px;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	line-height: 1.15;
}

.tn-timer.is-low {
	animation: tn-pulse 1s ease-in-out infinite;
}

@keyframes tn-pulse {
	50% {
		box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.25);
	}
}

.tn-save-state {
	min-height: 18px;
	color: var(--gd-muted);
	font-size: 12px;
	text-align: center;
}

.tn-save-state.ok {
	color: var(--gd-green);
}

.tn-save-state.err {
	color: var(--gd-red);
	font-weight: 600;
}

.tn-exam-body {
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}

/* Phiếu trả lời: dính khi cuộn (như jquery.sticky của bản cũ) */
.tn-sheet {
	position: sticky;
	top: 12px;
	transition: top 0.2s ease;
}

.tn-exam.has-pin .tn-sheet {
	top: calc(var(--tn-pin-h, 0px) + 12px);
}

.tn-exam.has-pin .tn-sheet-in {
	max-height: calc(100vh - var(--tn-pin-h, 0px) - 24px);
}

.tn-sheet-in {
	display: flex;
	max-height: calc(100vh - 24px);
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--gd-line);
	border-radius: var(--gd-radius);
	background: #fff;
}

.tn-sheet-title {
	position: relative;
	margin: 0;
	padding: 10px 14px 9px 18px;
	background: linear-gradient(90deg, var(--gd-green), var(--gd-green-mid));
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
}

.tn-sheet-title::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 4px;
	background: var(--gd-yellow);
}

.tn-sheet-count {
	margin: 0;
	padding: 7px 14px 9px;
	border-bottom: 1px solid var(--gd-line);
	background: var(--gd-green-soft);
	font-size: 13px;
}

.tn-sheet-count p {
	margin: 0 0 5px;
}

.tn-sheet-grid {
	position: relative;
	overflow-y: auto;
	padding: 4px 6px 8px;
}

.tn-sheet-row {
	display: flex;
	padding: 2px 4px;
	align-items: center;
	gap: 4px;
	border-radius: 6px;
}

/* Dòng của câu đang xem trên đề */
.tn-sheet-row.is-current {
	background: var(--gd-green-light);
	box-shadow: inset 3px 0 0 var(--gd-green);
}

/* Câu đánh dấu xem lại: chấm cam cuối dòng */
.tn-sheet-row.is-flag::after {
	content: "";
	width: 8px;
	height: 8px;
	margin-left: auto;
	flex: 0 0 auto;
	border-radius: 50%;
	background: var(--gd-orange);
	box-shadow: 0 0 0 2px #fde7d1;
}

.tn-sheet-row:nth-child(5n) {
	border-bottom: 1px dashed var(--gd-line);
}

.tn-sheet-n {
	width: 34px;
	color: var(--gd-red);
	font-size: 13px;
	font-weight: 700;
	text-align: right;
	padding-right: 4px;
}

.tn-sheet-row.is-done .tn-sheet-n {
	color: var(--gd-green);
}

.tn-sheet-n:hover,
.tn-sheet-n:focus {
	text-decoration: underline;
}

.tn-bubble {
	position: relative;
	margin: 0;
	cursor: pointer;
}

.tn-bubble input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.tn-bubble span {
	display: inline-flex;
	width: 30px;
	height: 30px;
	align-items: center;
	justify-content: center;
	border: 1.6px solid var(--gd-green);
	border-radius: 50%;
	color: var(--gd-green-dark);
	font-size: 12px;
	font-weight: 700;
	transition: background-color 120ms ease;
}

.tn-bubble:hover span {
	background: var(--gd-green-light);
}

.tn-bubble input:checked + span {
	background: var(--gd-green);
	color: #fff;
}

.tn-bubble input:focus-visible + span,
.tn-opt input:focus-visible + .tn-opt-letter {
	outline: 3px solid var(--gd-orange);
	outline-offset: 2px;
}

/* Đề thi */
.tn-questions {
	min-width: 0;
}

.tn-q {
	margin: 0 0 14px;
	padding: 14px 16px;
	border: 1px solid var(--gd-line);
	border-left: 4px solid #f3c7a2;
	border-radius: var(--gd-radius);
	background: #fff;
	scroll-margin-top: calc(var(--tn-pin-h, 0px) + 14px);
}

.tn-q:focus {
	outline: none;
}

.tn-q.is-flag {
	border-left-color: var(--gd-orange);
	background: #fffaf4;
}

/* Nháy viền khi chuyển tới câu (từ phiếu trả lời / nút Câu chưa làm) */
.tn-q.is-flash {
	animation: tn-flash 1.4s ease-out;
}

@keyframes tn-flash {
	0%,
	35% {
		box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.6);
	}

	100% {
		box-shadow: 0 0 0 3px rgba(245, 158, 11, 0);
	}
}

.tn-q.is-done {
	border-left-color: var(--gd-green);
}

.tn-q-head {
	display: flex;
	margin-bottom: 6px;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.tn-q-title {
	margin: 0;
	font-size: 1em;
}

/* Nút đánh dấu xem lại (chỉ lưu trên máy thi) */
.tn-flag {
	display: inline-flex;
	flex: 0 0 auto;
	padding: 3px 10px;
	align-items: center;
	gap: 5px;
	border: 1px solid var(--gd-line);
	border-radius: 999px;
	background: #fff;
	color: var(--gd-muted);
	cursor: pointer;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.4;
}

.tn-flag svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.tn-flag:hover,
.tn-flag:focus-visible {
	border-color: #fdba74;
	color: var(--gd-orange-dark);
	outline: none;
}

.tn-flag[aria-pressed="true"] {
	border-color: #fdba74;
	background: #fff1e2;
	color: #c2410c;
}

.tn-flag[aria-pressed="true"] svg {
	fill: #fdba74;
}

.tn-q-n {
	color: var(--gd-orange-dark);
	font-weight: 700;
}

.tn-q-content {
	margin-bottom: 10px;
	font-weight: 600;
	overflow-wrap: anywhere;
}

.tn-q-content img,
.tn-opt-text img {
	max-width: 100%;
	height: auto;
}

.tn-q-content p,
.tn-opt-text p {
	margin: 0 0 4px;
}

.tn-opts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 14px;
}

.tn-opt {
	display: flex;
	margin: 0;
	padding: 8px 10px;
	align-items: flex-start;
	gap: 10px;
	border: 1px solid transparent;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 400;
}

.tn-opt:hover {
	border-color: var(--gd-line);
	background: var(--gd-green-soft);
}

.tn-opt input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.tn-opt-letter {
	display: inline-flex;
	flex: 0 0 auto;
	width: 1.87em;
	height: 1.87em;
	align-items: center;
	justify-content: center;
	border: 1.6px solid var(--gd-green);
	border-radius: 50%;
	color: var(--gd-green-dark);
	font-size: 0.87em;
	font-weight: 700;
	text-transform: lowercase;
}

/* Màn hình làm bài: chữ hoa A/B/C/D trùng với phiếu trả lời */
.tn-exam .tn-opt-letter {
	text-transform: none;
}

.tn-opt input:checked + .tn-opt-letter {
	background: var(--gd-green);
	color: #fff;
}

.tn-opt:has(input:checked) {
	border-color: var(--gd-green);
	background: var(--gd-green-light);
}

.tn-opt-text {
	min-width: 0;
	padding-top: 3px;
	overflow-wrap: anywhere;
}

/* Hộp thoại xác nhận / thông báo mất kết nối */
.tn-modal {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: flex;
	padding: 16px;
	align-items: center;
	justify-content: center;
	background: rgba(6, 30, 18, 0.55);
}

.tn-modal[hidden] {
	display: none;
}

.tn-modal-box {
	width: 100%;
	max-width: 460px;
	padding: 22px 22px 18px;
	border-top: 4px solid var(--gd-orange);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.5);
}

.tn-modal-text {
	margin: 0 0 16px;
	font-size: 16px;
	font-weight: 600;
	white-space: pre-line;
}

.tn-modal-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
}

/* Số cột phương án A/B/C/D (Giao diện & hiển thị); màn hình hẹp luôn 1 cột */
.tn-exam.tn-cols-1 .tn-opts {
	grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 992px) {
	.tn-exam.tn-cols-4 .tn-opts {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* Không chọn trường thông tin nào: khối đầu trang chỉ còn đồng hồ, nút nộp, cỡ chữ trên một hàng */
.tn-exam.tn-head-compact .tn-exam-side {
	flex: 1 1 auto;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
}
/* Cỡ chữ đề thi (nút A- / A+, nhớ trên máy thi) */
.tn-questions {
	font-size: 15px;
}

.tn-exam.tn-fs-1 .tn-questions {
	font-size: 17px;
}

.tn-exam.tn-fs-2 .tn-questions {
	font-size: 19.5px;
}

.tn-fontsize {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	color: var(--gd-muted);
	font-size: 12px;
}

.tn-fontsize button {
	min-width: 34px;
	height: 26px;
	padding: 0 6px;
	border: 1px solid var(--gd-line);
	border-radius: 6px;
	background: #fff;
	color: var(--gd-green-dark);
	cursor: pointer;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
}

.tn-fontsize button:hover:not(:disabled),
.tn-fontsize button:focus-visible {
	border-color: var(--gd-green);
	background: var(--gd-green-light);
	outline: none;
}

.tn-fontsize button:disabled {
	cursor: default;
	opacity: 0.4;
}

/* Thanh tiến độ (số câu đã làm) */
.tn-progress {
	display: block;
	height: 6px;
	overflow: hidden;
	border-radius: 3px;
	background: #dcebe2;
}

.tn-progress i {
	display: block;
	width: 0;
	height: 100%;
	border-radius: 3px;
	background: linear-gradient(90deg, var(--gd-green), var(--gd-green-mid));
	transition: width 0.25s ease;
}

/* Chân phiếu trả lời: chú giải + nút câu chưa làm */
.tn-sheet-foot {
	display: flex;
	flex: 0 0 auto;
	padding: 8px 10px 10px;
	flex-direction: column;
	gap: 7px;
	border-top: 1px solid var(--gd-line);
	background: #fbfdfc;
}

.tn-legend {
	display: flex;
	margin: 0;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 12px;
	color: var(--gd-muted);
	font-size: 12px;
}

.tn-legend span::before {
	content: "";
	display: inline-block;
	width: 9px;
	height: 9px;
	margin-right: 5px;
	border-radius: 50%;
	vertical-align: 0;
}

.tn-lg-done::before {
	background: var(--gd-green);
}

.tn-lg-blank::before {
	border: 1.6px solid var(--gd-red);
}

.tn-lg-flag::before {
	background: var(--gd-orange);
}

.tn-sheet-foot .tn-btn {
	width: 100%;
}

.tn-exam.is-all-done .tn-sheet-foot .tn-btn {
	border-color: var(--gd-green);
	color: var(--gd-green);
}

/* Thanh ghim: họ tên, SBD, mã đề, tiến độ, câu chưa làm, đồng hồ, nộp bài - hiện khi khối thông tin cuộn khuất */
.tn-pin {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 1000;
	visibility: hidden;
	border-bottom: 3px solid var(--gd-green);
	background: rgba(255, 255, 255, 0.97);
	box-shadow: 0 8px 22px -12px rgba(6, 100, 58, 0.45);
	transform: translateY(-110%);
	transition: transform 0.2s ease, visibility 0.2s;
}

.tn-exam.has-pin .tn-pin {
	visibility: visible;
	transform: none;
}

.tn-exam.is-offline .tn-pin {
	border-bottom-color: var(--gd-red);
}

.tn-pin-in {
	display: flex;
	max-width: var(--gd-wrap);
	margin: 0 auto;
	padding: 7px var(--gd-gap);
	align-items: center;
	gap: 14px;
}

.tn-pin-who {
	display: flex;
	min-width: 0;
	flex: 1 1 auto;
	align-items: baseline;
	gap: 6px 14px;
	overflow: hidden;
	color: var(--gd-muted);
	font-size: 13px;
	white-space: nowrap;
}

.tn-pin-who b {
	color: var(--gd-ink);
}

.tn-pin-name {
	overflow: hidden;
	color: var(--gd-green-dark) !important;
	font-size: 15px;
	text-overflow: ellipsis;
}

.tn-pin-progress {
	display: flex;
	width: 150px;
	flex: 0 0 auto;
	flex-direction: column;
	gap: 4px;
	font-size: 13px;
}

.tn-pin-progress b {
	color: var(--gd-green-dark);
}

.tn-pin-ptext {
	white-space: nowrap;
}

.tn-pin-blank {
	display: inline-flex;
	flex: 0 0 auto;
	padding: 6px 12px;
	align-items: center;
	gap: 6px;
	border: 1px solid #fdba74;
	border-radius: 8px;
	background: #fff7ed;
	color: #c2410c;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
}

.tn-pin-blank svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.tn-pin-blank b {
	min-width: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: #c2410c;
	color: #fff;
	font-size: 12px;
	text-align: center;
}

.tn-pin-blank:hover,
.tn-pin-blank:focus-visible {
	background: #ffedd5;
	outline: none;
}

.tn-exam.is-all-done .tn-pin-blank {
	border-color: #86efac;
	background: var(--gd-green-light);
	color: var(--gd-green-dark);
}

.tn-exam.is-all-done .tn-pin-blank b {
	background: var(--gd-green);
}

.tn-pin-save {
	width: 130px;
	flex: 0 0 auto;
	overflow: hidden;
	color: var(--gd-muted);
	font-size: 12px;
	text-align: right;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tn-pin-save.ok {
	color: var(--gd-green);
}

.tn-pin-save.err {
	color: var(--gd-red);
	font-weight: 600;
}

.tn-pin-timer {
	display: flex;
	flex: 0 0 auto;
	padding: 2px 12px;
	flex-direction: column;
	align-items: center;
	border: 1px solid #fecaca;
	border-radius: 8px;
	background: #fff;
	line-height: 1.1;
}

.tn-pin-timer-label {
	color: var(--gd-muted);
	font-size: 10.5px;
	font-weight: 600;
	text-transform: uppercase;
}

.tn-pin-timer .tn-timer-value {
	font-size: 22px;
}

.tn-pin-timer.is-low {
	animation: tn-pulse 1s ease-in-out infinite;
}

.tn-pin .tn-btn {
	flex: 0 0 auto;
	padding: 9px 20px;
	font-size: 15px;
}

/* Thông báo nhanh: nhắc sắp hết giờ, đã làm hết câu... */
.tn-toast {
	position: fixed;
	top: 14px;
	left: 50%;
	z-index: 1500;
	width: max-content;
	max-width: calc(100vw - 32px);
	padding: 10px 18px;
	border: 1px solid #fdba74;
	border-radius: 10px;
	background: #fff7ed;
	box-shadow: 0 14px 30px -14px rgba(154, 52, 18, 0.55);
	color: #9a3412;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	transform: translateX(-50%);
}

.tn-exam.has-pin .tn-toast {
	top: calc(var(--tn-pin-h, 0px) + 10px);
}

.tn-toast[hidden] {
	display: none;
}

@media (max-width: 1199px) {
	.tn-pin-save,
	.tn-pin-code {
		display: none;
	}

	.tn-pin-progress {
		width: 120px;
	}
}

@media (max-width: 767px) {
	.tn-pin-in {
		padding: 6px 10px;
		gap: 8px;
	}

	.tn-pin-who,
	.tn-pin-plabel,
	.tn-pin-timer-label,
	.tn-pin-blank-text {
		display: none;
	}

	.tn-pin-progress {
		width: auto;
		min-width: 70px;
		flex: 1 1 auto;
	}

	.tn-pin-blank {
		padding: 6px 8px;
	}

	.tn-pin-timer {
		padding: 2px 8px;
	}

	.tn-pin-timer .tn-timer-value {
		font-size: 19px;
	}

	.tn-pin .tn-btn {
		padding: 8px 12px;
		font-size: 14px;
	}

	.tn-q-head {
		align-items: flex-start;
	}
}

/* ------------------------------------------------------------------ CO GIÃN */

@media (max-width: 1199px) {
	.tn-exam-info {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 991px) {
	.tn-exam-body {
		grid-template-columns: 210px minmax(0, 1fr);
	}

	.tn-bubble span {
		width: 26px;
		height: 26px;
	}

	.tn-sheet-n {
		width: 28px;
	}
}

@media (max-width: 767px) {
	.tn-exam-head {
		flex-direction: column;
		align-items: stretch;
		padding: 10px 12px;
	}

	.tn-exam-info {
		display: none;
	}

	.tn-exam-side {
		flex-direction: row;
		align-items: center;
		flex-wrap: wrap;
	}

	.tn-timer {
		flex: 1 1 auto;
		padding: 4px 10px;
	}

	.tn-timer-value {
		font-size: 24px;
	}

	.tn-exam-body {
		grid-template-columns: minmax(0, 1fr);
	}

	.tn-sheet {
		position: static;
		order: 2;
	}

	.tn-sheet-in {
		max-height: none;
	}

	.tn-sheet-grid {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	}

	.tn-opts {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media print {
	.tn-exam-side,
	.tn-sheet,
	.tn-pin,
	.tn-toast,
	.tn-flag,
	.tn-modal {
		display: none !important;
	}
}

@media (max-width: 767px) {
	.tn-opt {
		padding: 5px 8px;
	}

	.tn-q {
		padding: 12px 12px;
	}
}

/* ------------------------------------------------------------------ GIÁM SÁT / VẬN HÀNH (cán bộ) */

.tn-btn-sm {
	padding: 6px 12px;
	font-size: 13px;
}

.tn-h2 {
	margin: 0 0 6px;
	color: var(--gd-green-dark);
	font-size: 17px;
	font-weight: 700;
}

.tn-h2 .fa {
	margin-right: 6px;
	color: var(--gd-orange);
}

.tn-toolbar {
	display: flex;
	margin: -4px 0 14px;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.tn-toolbar-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tn-tabs {
	display: inline-flex;
	padding: 3px;
	border-radius: 10px;
	background: var(--gd-green-soft);
	gap: 3px;
}

.tn-tab {
	padding: 7px 14px;
	border-radius: 8px;
	color: var(--gd-green-dark);
	font-weight: 600;
}

.tn-tab:hover,
.tn-tab:focus {
	background: var(--gd-green-light);
	text-decoration: none;
}

.tn-tab.is-active {
	background: var(--gd-green);
	color: #fff;
}

.tn-monitor-head {
	display: flex;
	margin-bottom: 12px;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 18px;
}

.tn-monitor-head .tn-h1 {
	margin: 0;
}

.tn-monitor-head .tn-note {
	margin: 0;
}

.tn-badge-session {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 10px;
	border-radius: 999px;
	background: #fff1e3;
	color: var(--gd-orange-dark);
	font-size: 13px;
	font-weight: 700;
	vertical-align: middle;
}

.tn-counters {
	display: flex;
	margin: 0;
	padding: 0;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
}

.tn-counters li {
	padding: 4px 10px;
	border: 1px solid var(--gd-line);
	border-radius: 8px;
	background: #fff;
	font-size: 13px;
}

.tn-counters li.doing b {
	color: var(--gd-green);
}

.tn-counters li.done b {
	color: var(--gd-red);
}

.tn-counters li.paused b {
	color: var(--gd-orange-dark);
}

.tn-search {
	display: flex;
	margin-left: auto;
	gap: 6px;
}

.tn-search .form-control {
	width: 220px;
}

.tn-refresh-note {
	flex-basis: 100%;
	font-size: 12px !important;
}

.tn-mono {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.tn-state {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}

.tn-state-doing {
	background: var(--gd-green-light);
	color: var(--gd-green-dark);
}

.tn-state-done {
	background: #fee2e2;
	color: #b91c1c;
}

.tn-state-paused {
	background: #fff1e3;
	color: var(--gd-orange-dark);
}

.tn-state-waiting {
	background: #f1f5f9;
	color: #475569;
}

.tn-ip.is-online::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 6px;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
	vertical-align: middle;
}

.tn-ops {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 16px;
}

.tn-op form {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.tn-op form .tn-btn {
	align-self: flex-start;
	margin-top: 6px;
}

.tn-op .form-control {
	height: auto;
	padding: 8px 12px;
}

.tn-op-warn {
	border-top: 3px solid var(--gd-orange);
}

.tn-state-line {
	margin: 0 0 10px;
	padding: 6px 10px;
	border-radius: 8px;
	background: var(--gd-green-soft);
	font-size: 13px;
}

.tn-state-line.ok {
	color: var(--gd-green-dark);
}

.tn-state-line.err {
	background: #fef2f2;
	color: #b91c1c;
	font-weight: 600;
}

.tn-check {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 500;
}

.gd-nav-badge {
	margin-right: 10px;
	padding: 2px 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
	color: #ffd88a;
	font-weight: 700;
	white-space: nowrap;
}

@media (max-width: 767px) {
	.tn-search {
		width: 100%;
		margin-left: 0;
	}

	.tn-search .form-control {
		flex: 1 1 auto;
		width: auto;
	}
}

/* ------------------------------------------------------------------ IN PHIẾU */

.tn-print-body {
	background: #e5e7eb;
}

.tn-print-bar {
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	padding: 10px 16px;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	background: var(--gd-green-dark);
	color: #fff;
}

.tn-print-none {
	padding: 40px;
	text-align: center;
}

.tn-print-page {
	box-sizing: border-box;
	width: 210mm;
	min-height: 287mm;
	margin: 16px auto;
	padding: 12mm 14mm;
	background: #fff;
	color: #000;
	font-family: "Times New Roman", Times, serif;
	font-size: 13.5pt;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.tn-print-head {
	display: grid;
	grid-template-columns: 64px 1fr;
	align-items: center;
	gap: 6px 14px;
	padding-bottom: 8px;
	border-bottom: 2px solid #000;
}

.tn-print-org {
	margin: 0;
	font-size: 12pt;
	line-height: 1.35;
}

.tn-print-title {
	grid-column: 1 / -1;
	text-align: center;
}

.tn-print-title h1 {
	margin: 6px 0 2px;
	font-family: inherit;
	font-size: 17pt;
	font-weight: 700;
}

.tn-print-title p {
	margin: 0;
	font-size: 12pt;
}

.tn-print-info {
	width: 100%;
	margin: 10px 0;
	border-collapse: collapse;
}

.tn-print-info th,
.tn-print-info td {
	padding: 3px 6px;
	border: 1px solid #444;
	font-size: 12pt;
	text-align: left;
}

.tn-print-info th {
	width: 18%;
	background: #f3f4f6;
	font-weight: 600;
}

.tn-print-grid {
	display: flex;
	justify-content: space-around;
	gap: 10mm;
	margin: 6px 0 10px;
}

.tn-print-col {
	border-collapse: collapse;
}

.tn-print-col th {
	width: 28px;
	padding: 1px 6px 1px 0;
	font-size: 11pt;
	text-align: right;
}

.tn-print-col td {
	padding: 1.5px 3px;
}

.tn-pb {
	display: inline-flex;
	width: 21px;
	height: 21px;
	align-items: center;
	justify-content: center;
	border: 1.3px solid #000;
	border-radius: 50%;
	font-family: Arial, sans-serif;
	font-size: 9pt;
	-webkit-print-color-adjust: exact;
	print-color-adjust: exact;
}

.tn-pb.is-on {
	background: #000;
	color: #fff;
}

.tn-print-sign {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	text-align: center;
	font-size: 12pt;
}

.tn-print-sign p {
	margin: 0;
}

.tn-print-signname {
	margin-top: 46px !important;
	font-weight: 700;
}

.tn-print-proctors {
	margin: 8px 0 0;
	padding-left: 18px;
	text-align: left;
}

.tn-print-proctors li {
	margin-bottom: 30px;
}

@media print {
	@page {
		size: A4;
		margin: 8mm;
	}

	.tn-print-body {
		background: #fff;
	}

	.tn-print-bar {
		display: none !important;
	}

	.tn-print-page {
		width: auto;
		min-height: 0;
		margin: 0;
		padding: 0;
		box-shadow: none;
		break-after: page;
		page-break-after: always;
	}

	.tn-print-page:last-child {
		break-after: auto;
		page-break-after: auto;
	}
}

/* ------------------------------------------------------------------ KẾT QUẢ / SO ĐÁP ÁN / CHI TIẾT ĐỀ */

.tn-search-left {
	margin: 0 0 12px;
	flex-wrap: wrap;
}

.tn-search-left .form-control {
	width: auto;
	min-width: 160px;
}

.tn-icon-btn {
	padding: 2px 6px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--gd-red);
	cursor: pointer;
}

.tn-icon-btn:hover,
.tn-icon-btn:focus {
	background: #fee2e2;
}

.tn-legend {
	display: flex;
	margin: 0 0 12px;
	align-items: center;
	gap: 8px;
	color: var(--gd-muted);
	font-size: 13px;
}

.tn-cmp-grid {
	font-family: var(--gd-font);
}

.tn-pb.is-key {
	border-color: #dc2626;
	background: #dc2626;
	color: #fff;
}

.tn-print-col tr.is-wrong th {
	color: #dc2626;
}

.tn-print-col tr.is-right th {
	color: var(--gd-green);
}

.tn-z {
	color: var(--gd-orange-dark);
	font-size: 11px;
	font-weight: 700;
}

.tn-rev.is-right {
	border-left-color: var(--gd-green);
}

.tn-rev.is-wrong {
	border-left-color: #dc2626;
}

.tn-rev-opt {
	cursor: default;
}

.tn-rev-opt:hover {
	border-color: transparent;
	background: none;
}

.tn-rev-opt.is-key .tn-opt-letter {
	border: 2px solid #dc2626;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
	color: #dc2626;
}

.tn-rev-opt.is-on .tn-opt-text {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
	font-weight: 600;
}

@media print {
	.tn-noprint,
	.tn-search,
	.tn-toolbar-actions {
		display: none !important;
	}

	.tn-card {
		border: 0;
		box-shadow: none;
		padding: 0;
	}

	.tn-q {
		break-inside: avoid;
	}

	.tn-pb.is-key,
	.tn-pb.is-on {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}
}

.tn-table .tn-name {
	min-width: 170px;
}

/* ------------------------------------------------------------------ HƯỚNG DẪN SỬ DỤNG (chuyên mục cán bộ) */

.tn-guide {
	display: grid;
	grid-template-columns: 270px minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}

.tn-guide-nav {
	position: sticky;
	top: 12px;
}

.tn-guide-nav-in {
	overflow: hidden;
	border: 1px solid var(--gd-line);
	border-radius: var(--gd-radius);
	background: #fff;
}

.tn-guide-nav-title {
	position: relative;
	margin: 0;
	padding: 10px 14px 9px 18px;
	background: linear-gradient(90deg, var(--gd-green), var(--gd-green-mid));
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
}

.tn-guide-nav-title::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 4px;
	background: var(--gd-yellow);
}

.tn-guide-nav ol {
	margin: 0;
	padding: 4px 0;
	list-style: none;
}

.tn-guide-nav a {
	display: block;
	padding: 9px 14px 9px 18px;
	border-bottom: 1px solid #eef3f0;
	color: var(--gd-ink);
	font-weight: 500;
	line-height: 1.35;
}

.tn-guide-nav li:last-child a {
	border-bottom: 0;
}

.tn-guide-nav a:hover,
.tn-guide-nav a:focus {
	background: var(--gd-green-soft);
	color: var(--gd-green-dark);
	text-decoration: none;
}

.tn-guide-nav a.is-active {
	background: var(--gd-green-light);
	box-shadow: inset 3px 0 0 var(--gd-green);
	color: var(--gd-green-dark);
	font-weight: 600;
}

.tn-guide-meta {
	margin: 0;
	padding: 8px 14px;
	border-top: 1px solid var(--gd-line);
	color: var(--gd-muted);
	font-size: 12px;
}

.tn-guide-body .tn-toolbar {
	margin-bottom: 6px;
}

.tn-guide-body .tn-toolbar .tn-eyebrow {
	margin: 0;
}

.tn-doc {
	font-size: 15px;
	line-height: 1.65;
}

.tn-doc p {
	margin: 0 0 12px;
}

.tn-doc h3 {
	margin: 18px 0 8px;
	color: var(--gd-green-dark);
	font-size: 16px;
	font-weight: 700;
}

.tn-doc ol,
.tn-doc ul {
	margin: 0 0 14px;
	padding-left: 24px;
}

.tn-doc li {
	margin-bottom: 6px;
}

.tn-doc li > ul,
.tn-doc li > ol {
	margin: 6px 0 0;
}

.tn-doc strong {
	color: #11301f;
}

.tn-doc code {
	padding: 1px 6px;
	border-radius: 5px;
	background: #f1f5f2;
	color: var(--gd-orange-dark);
	font-size: 0.9em;
}

.tn-doc em {
	color: #334155;
}

.tn-doc hr {
	margin: 18px 0;
	border: 0;
	border-top: 1px solid var(--gd-line);
}

.tn-doc-table {
	margin: 0 0 16px;
	overflow-x: auto;
	border: 1px solid var(--gd-line);
	border-radius: var(--gd-radius);
}

.tn-doc-table .tn-table td,
.tn-doc-table .tn-table th {
	vertical-align: top;
}

.tn-guide-pager {
	display: flex;
	margin-top: 22px;
	padding-top: 14px;
	border-top: 1px solid var(--gd-line);
	gap: 12px;
}

.tn-guide-pager a {
	display: flex;
	flex: 1 1 0;
	padding: 10px 14px;
	flex-direction: column;
	border: 1px solid var(--gd-line);
	border-radius: var(--gd-radius);
	background: var(--gd-green-soft);
	color: var(--gd-green-dark);
	font-weight: 600;
}

.tn-guide-pager a:hover,
.tn-guide-pager a:focus {
	background: var(--gd-green-light);
	text-decoration: none;
}

.tn-guide-pager small {
	color: var(--gd-muted);
	font-weight: 500;
}

.tn-guide-next {
	margin-left: auto;
	text-align: right;
}

@media (max-width: 991px) {
	.tn-guide {
		grid-template-columns: minmax(0, 1fr);
	}

	.tn-guide-nav {
		position: static;
	}
}

@media print {
	.tn-guide {
		display: block;
	}

	.tn-guide-nav,
	.tn-guide-pager {
		display: none !important;
	}
}

/* Lưu ý dưới thông tin thí sinh (soạn bằng trình soạn thảo) */
.tn-info-note p,
.tn-info-note ul,
.tn-info-note ol {
	margin: 0 0 4px;
}

.tn-info-note ul,
.tn-info-note ol {
	padding-left: 20px;
}

.tn-info-note > :last-child {
	margin-bottom: 0;
}

/* Hướng dẫn soạn bằng trình soạn thảo NukeViet (CKEditor 5): bảng, trích dẫn, ảnh, tiêu đề */
.tn-doc figure.table {
	display: block;
	margin: 0 0 12px;
	overflow-x: auto;
}

.tn-doc table:not(.tn-table) {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.tn-doc table:not(.tn-table) th,
.tn-doc table:not(.tn-table) td {
	padding: 6px 10px;
	border: 1px solid var(--gd-line);
	vertical-align: top;
}

.tn-doc table:not(.tn-table) th,
.tn-doc table:not(.tn-table) thead td {
	background: var(--gd-green-soft);
	font-weight: 600;
}

.tn-doc blockquote {
	margin: 0 0 12px;
	padding: 8px 14px;
	border-left: 4px solid var(--gd-orange);
	background: #fff8f0;
	font-size: inherit;
}

.tn-doc figure.image {
	margin: 0 0 12px;
	text-align: center;
}

.tn-doc img {
	max-width: 100%;
	height: auto;
}

.tn-doc h2,
.tn-doc h4 {
	margin: 16px 0 8px;
	color: var(--gd-green-dark);
	font-weight: 700;
}

.tn-doc h2 {
	font-size: 18px;
}

.tn-doc h4 {
	font-size: 15px;
}