.tam-courses-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 20px;
	margin: 20px 0;
}
.tam-course-card {
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	padding: 16px;
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.tam-course-thumb img { width: 100%; border-radius: 6px; }
.tam-course-title { margin: 0; font-size: 18px; }
.tam-course-excerpt { color: #555; font-size: 14px; }
.tam-course-meta { list-style: none; margin: 0; padding: 0; font-size: 13px; color: #333; }
.tam-course-meta li { margin-bottom: 4px; }

.tam-btn, button.tam-btn {
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 5px;
	padding: 10px 16px;
	cursor: pointer;
	font-size: 14px;
	width: 100%;
}
.tam-btn:hover { background: #135e96; }
.tam-btn:disabled { opacity: .6; cursor: not-allowed; }

.tam-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 12px;
	background: #eee;
	color: #333;
	width: fit-content;
}
.tam-badge-pending { background: #fff3cd; color: #856404; }
.tam-badge-in_progress { background: #cfe2ff; color: #0842a0; }
.tam-badge-completed { background: #d1e7dd; color: #0f5132; }
.tam-badge-cancelled { background: #f8d7da; color: #842029; }
/* وضعیت کلاس (متفاوت از وضعیت ثبت‌نام) — استفاده‌شده در پنل استاد. */
.tam-badge-class-upcoming { background: #e2e3e5; color: #41464b; }
.tam-badge-class-in_progress { background: #cfe2ff; color: #0842a0; }
.tam-badge-class-completed { background: #d1e7dd; color: #0f5132; }

.tam-instructor-panel { margin: 16px 0; }
.tam-instructor-panel h3 { margin-top: 0; }
.tam-notice-success { background: #d1e7dd; color: #0f5132; }

.tam-attendance-details summary { cursor: pointer; color: #1e6fbf; font-size: 13px; }
.tam-attendance-list { margin: 6px 0 0; padding: 0 16px 0 0; font-size: 12px; }
.tam-attendance-list li { margin-bottom: 4px; }

.tam-online-pay-form { margin-top: 6px; display: flex; gap: 6px; align-items: center; }
.tam-btn-small { padding: 4px 10px; font-size: 12px; }
.tam-online-pay-disabled { margin-top: 6px; font-size: 11px; color: #999; }

.tam-enroll-message { font-size: 13px; margin-top: 4px; }
.tam-enroll-message.tam-success { color: #0f5132; }
.tam-enroll-message.tam-error { color: #842029; }

.tam-dashboard { max-width: 900px; }
.tam-dashboard-mobile { background: #f7f7f7; padding: 14px; border-radius: 8px; margin-bottom: 20px; }
.tam-dashboard-mobile input[type="text"] { padding: 6px 10px; border-radius: 5px; border: 1px solid #ccc; margin-inline-end: 8px; }
.tam-mobile-message { font-size: 13px; margin-inline-start: 8px; }

.tam-dashboard-tabs { display: flex; gap: 8px; border-bottom: 2px solid #eee; margin-bottom: 16px; }
.tam-tab-btn {
	background: none;
	border: none;
	padding: 10px 14px;
	cursor: pointer;
	font-size: 14px;
	border-bottom: 3px solid transparent;
}
.tam-tab-btn.active { border-bottom-color: #2271b1; font-weight: bold; color: #2271b1; }

.tam-tab-panel { display: none; }
.tam-tab-panel.active { display: block; }

.tam-table { width: 100%; border-collapse: collapse; }
.tam-table th, .tam-table td { padding: 10px; border-bottom: 1px solid #eee; text-align: right; font-size: 14px; }
.tam-table thead th { background: #f7f7f7; }

.tam-notice, .tam-empty { padding: 12px; background: #f7f7f7; border-radius: 6px; }
.tam-notice-error { background: #f8d7da; color: #842029; }

/* فرم ثبت‌نام کارآموز */
.tam-register-form { max-width: 780px; }
.tam-register-avatar-row { display: flex; align-items: center; gap: 20px; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid #eee; flex-wrap: wrap; }
.tam-register-avatar-preview { width: 80px; height: 80px; border-radius: 50%; background: #f1f5f9; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.tam-register-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.tam-avatar-placeholder { font-size: 32px; opacity: .4; }
.tam-field-hint { font-size: 12px; color: #777; margin: 4px 0 0; }

.tam-register-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 14px; }
.tam-register-grid label, .tam-register-full { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #333; }
.tam-register-full { margin-bottom: 16px; }
.tam-register-grid input, .tam-register-grid select, .tam-register-full textarea {
	padding: 10px 12px; border-radius: 8px; border: 1px solid #e2e2e2; font-family: inherit; font-size: 14px;
}
.tam-required::after { content: " *"; color: #c0392b; }
.tam-register-subhead { margin: 24px 0 12px; padding-top: 16px; border-top: 1px dashed #e2e2e2; font-size: 16px; }

/* اعتبارسنجی بلادرنگ فیلدها */
.tam-field-error { display: block; color: #c0392b; font-size: 12px; margin-top: 4px; min-height: 16px; font-weight: 400; }
.tam-register-grid input.tam-field-invalid { border-color: #c0392b; box-shadow: 0 0 0 1px #c0392b; }

/* ===== آزمون ===== */
.tam-exam-panel { max-width: 800px; }
.tam-exam-panel ul { margin: 10px 0; padding-inline-start: 20px; }
.tam-exam-panel li { margin-bottom: 4px; }

/* زمان‌سنج معکوس، همیشه بالای صفحه و ثابت — با اسکرول جابه‌جا نمی‌شود. */
.tam-exam-timer-bar {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 99999;
	background: #2c3338;
	color: #fff;
	text-align: center;
	padding: 12px 10px;
	font-size: 18px;
	font-weight: 700;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
	transition: background-color .3s ease;
}
.tam-exam-timer-bar .tam-exam-timer-label { font-weight: 400; font-size: 14px; margin-inline-end: 8px; }
.tam-exam-timer-value { font-variant-numeric: tabular-nums; direction: ltr; display: inline-block; }
.tam-exam-timer-bar.tam-exam-timer-warning { background: #caa316; color: #2c2200; }
.tam-exam-timer-bar.tam-exam-timer-danger { background: #c0392b; color: #fff; animation: tam-exam-pulse 1s infinite; }
@keyframes tam-exam-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: .75; }
}
/* فضای بالای صفحه برای این‌که زمان‌سنج ثابت، محتوا را نپوشاند. */
.tam-exam-panel-with-timer { padding-top: 64px; }
body.admin-bar .tam-exam-timer-bar { top: 32px; }
@media screen and (max-width: 782px) {
	body.admin-bar .tam-exam-timer-bar { top: 46px; }
}

.tam-exam-question {
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	padding: 16px 18px;
	margin-bottom: 14px;
}
.tam-exam-question h4 { margin: 0 0 12px; font-size: 15px; }
.tam-exam-options { display: flex; flex-direction: column; gap: 8px; }
.tam-exam-option {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border: 1px solid #eee;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
}
.tam-exam-option:hover { background: #f7f7f7; }
.tam-exam-option input[type="radio"] { flex-shrink: 0; }
.tam-exam-finish-btn { max-width: 260px; margin-top: 10px; }

/* دکمه‌های کپسولی افزونه */
.tam-btn,
button.tam-btn,
a.tam-btn,
.tam-wrap .button,
.tam-wrap .button-primary,
input[type="submit"].tam-btn {
	border-radius: 999px !important;
}
.tam-btn,
button.tam-btn {
	background: #C98A12;
	padding: 11px 22px;
	font-weight: 700;
	box-shadow: 0 4px 14px rgba(201,138,18,.3);
	transition: transform .2s, box-shadow .2s, filter .2s;
}
.tam-btn:hover {
	background: #A8720E;
	filter: brightness(1.05);
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(201,138,18,.35);
}
