/* ===== Shared ===== */
.toefl-lms-app, .toefl-lms-admin-root { box-sizing: border-box; }
.toefl-lms-app *, .toefl-lms-admin-root * { box-sizing: border-box; }

.toefl-lms-btn {
	display: inline-block; padding: 8px 18px; border-radius: 8px; border: none;
	background: #e2e8f0; color: #1e293b; font-weight: 600; cursor: pointer; text-decoration: none; font-size: 14px;
}
.toefl-lms-btn-primary { background: linear-gradient(135deg, #3b82f6, #4f46e5); color: #fff; }
.toefl-lms-btn-danger { background: #fee2e2; color: #b91c1c; }
.toefl-lms-btn-sm { padding: 5px 10px; font-size: 12px; }

/* ===== Frontend App ===== */
.toefl-lms-app {
	font-family: 'Segoe UI', system-ui, sans-serif;
	background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
	border-radius: 16px;
	min-height: 480px;
	padding: 0;
	overflow: hidden;
	color: #1e293b;
}
.toefl-lms-guest { display: flex; align-items: center; justify-content: center; min-height: 380px; }
.toefl-lms-login-box { text-align: center; max-width: 420px; padding: 40px; }
.toefl-lms-login-box h2 { margin-top: 0; }

.tlms-shell { display: flex; min-height: 480px; }
.tlms-sidebar {
	width: 230px; flex-shrink: 0; background: rgba(255,255,255,0.75); padding: 20px 14px;
	border-right: 1px solid rgba(0,0,0,0.06);
}
.tlms-sidebar .tlms-brand { font-weight: 800; font-size: 18px; margin-bottom: 20px; padding: 0 8px; }
.tlms-nav-item {
	display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
	cursor: pointer; color: #334155; font-weight: 600; font-size: 14px; margin-bottom: 4px;
}
.tlms-nav-item:hover { background: rgba(59,130,246,0.08); }
.tlms-nav-item.active { background: linear-gradient(135deg, #3b82f6, #4f46e5); color: #fff; }
.tlms-main { flex: 1; padding: 28px; overflow-y: auto; }

.tlms-card {
	background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 4px 14px rgba(0,0,0,0.05);
	border: 1px solid rgba(0,0,0,0.04); margin-bottom: 18px;
}
.tlms-card.hover:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); cursor: pointer; }
.tlms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tlms-hero {
	background: linear-gradient(135deg, #3b82f6, #4f46e5); color: #fff; border-radius: 16px;
	padding: 28px; margin-bottom: 20px;
}
.tlms-hero h2 { margin: 0 0 6px; }
.tlms-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.tlms-badge-blue { background: #dbeafe; color: #1d4ed8; }
.tlms-badge-green { background: #dcfce7; color: #15803d; }
.tlms-badge-amber { background: #fef3c7; color: #b45309; }
.tlms-badge-red { background: #fee2e2; color: #b91c1c; }

.tlms-video-wrap { position: relative; padding-top: 56.25%; background: #000; border-radius: 12px; overflow: hidden; }
.tlms-video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
/* Video hasil rekam HP secara tegak (portrait, rasio ~9:16) supaya tidak gepeng/kepotong. */
.tlms-video-wrap.tlms-video-portrait { max-width: 420px; margin: 0 auto; padding-top: 177.78%; }

table.tlms-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
table.tlms-table th, table.tlms-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; text-align: left; font-size: 14px; }
table.tlms-table th { background: #f8fafc; font-weight: 700; }

.tlms-exam-header {
	position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,0.97); backdrop-filter: blur(6px);
	border-radius: 14px; padding: 16px 20px; margin-bottom: 16px; border-bottom: 4px solid #3b82f6;
	box-shadow: 0 4px 14px rgba(0,0,0,0.06); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
}
.tlms-exam-question { background: #fff; border-radius: 12px; padding: 18px; margin-bottom: 14px; border: 1px solid #eef2f7; }
.tlms-question-num {
	flex-shrink: 0; background: #dbeafe; color: #1d4ed8; font-weight: 800; width: 30px; height: 30px;
	border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.tlms-audio-box { margin-bottom: 12px; padding: 10px; background: #f8fafc; border-radius: 10px; border: 1px solid #eef2f7; }
.tlms-options-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.tlms-option-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; border: 2px solid #e5e7eb; }
.tlms-option-row:hover { background: #f8fafc; }
.tlms-option-row.selected { background: #ebf5ff; border-color: #3b82f6; }
.tlms-timer { font-weight: 800; font-size: 20px; color: #dc2626; background: #fee2e2; padding: 8px 16px; border-radius: 10px; }
.tlms-progressbar { height: 8px; border-radius: 6px; background: #e2e8f0; overflow: hidden; }
.tlms-progressbar > div { height: 100%; background: linear-gradient(135deg, #3b82f6, #4f46e5); }

.tlms-score-box { text-align: center; padding: 30px; }
.tlms-score-box .score-total { font-size: 56px; font-weight: 900; color: #4f46e5; }

.tlms-form-group { margin-bottom: 14px; }
.tlms-form-group label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 13px; }
.tlms-form-group input[type=text], .tlms-form-group input[type=number], .tlms-form-group input[type=url],
.tlms-form-group input[type=date], .tlms-form-group input[type=file],
.tlms-form-group textarea, .tlms-form-group select {
	width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px;
}
.tlms-form-group input[type=file] { padding: 6px; background: #f8fafc; }
.tlms-modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.5); display: flex; align-items: center; justify-content: center; z-index: 999999; }
.tlms-modal { background: #fff; border-radius: 14px; padding: 24px; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; }

@media (max-width: 782px) {
	.tlms-shell { flex-direction: column; }
	.tlms-sidebar { width: 100%; display: flex; overflow-x: auto; gap: 4px; padding: 10px; }
	.tlms-sidebar .tlms-brand { display: none; }
	.tlms-nav-item { white-space: nowrap; margin-bottom: 0; }
}

/* ===== Admin ===== */
.toefl-lms-admin-wrap .toefl-lms-cards { display: flex; gap: 16px; margin: 16px 0 24px; flex-wrap: wrap; }
.toefl-lms-admin-wrap .toefl-lms-card {
	background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 18px 24px; min-width: 140px;
}
.toefl-lms-admin-wrap .toefl-lms-card .num { display: block; font-size: 30px; font-weight: 800; color: #4f46e5; }
.toefl-lms-admin-wrap .toefl-lms-card .label { color: #64748b; font-size: 13px; }
.toefl-lms-admin-root .tlms-admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.toefl-lms-admin-root .tlms-filter-tabs { display: flex; gap: 6px; }
.toefl-lms-admin-root .tlms-filter-tabs span {
	padding: 6px 14px; border-radius: 20px; background: #f1f5f9; cursor: pointer; font-size: 13px; font-weight: 600;
}
.toefl-lms-admin-root .tlms-filter-tabs span.active { background: #4f46e5; color: #fff; }
