.ems-portal {
	max-width: 800px; margin: 20px auto; background: #fff; border: 1px solid #e2e2e2;
	border-radius: 8px; padding: 24px; font-family: inherit;
}
.ems-login-box { max-width: 380px; text-align: left; }
.ems-login-logo { text-align: center; margin-bottom: 10px; }
.ems-login-logo img { width: 64px; height: 64px; object-fit: contain; }
.ems-login-emoji { font-size: 40px; }
.ems-login-box h2 { text-align: center; margin: 4px 0 2px; }
.ems-login-sub { text-align: center; color: #666; margin: 0 0 14px; font-size: 13px; }
.ems-login-box input[type=text], .ems-login-box input[type=password] {
	width: 100%; padding: 8px; box-sizing: border-box; margin-top: 4px;
}
.ems-error { color: #b32d2e; font-weight: 600; }
.ems-success { color: #15803d; font-weight: 600; }
.ems-password-form { max-width: 380px; }
.ems-password-form input[type=password] { width: 100%; margin-top: 4px; }
.ems-btn {
	display: inline-block; background: #2271b1; color: #fff !important; padding: 8px 18px;
	border-radius: 4px; text-decoration: none; border: none; cursor: pointer; font-size: 14px;
}
.ems-btn-outline { background: transparent; color: #2271b1 !important; border: 1px solid #2271b1; }
.ems-btn-sm { padding: 5px 12px; font-size: 13px; }
.ems-portal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.ems-portal-nav { display: flex; gap: 6px; border-bottom: 2px solid #f0f0f1; margin-bottom: 20px; flex-wrap: wrap; }
.ems-portal-nav a {
	padding: 10px 16px; text-decoration: none; color: #50575e; border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.ems-portal-nav a.active { color: #2271b1; border-bottom-color: #2271b1; font-weight: 600; }
.ems-profile-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.ems-profile-table th, .ems-profile-table td { border: 1px solid #e2e2e2; padding: 8px 12px; text-align: left; }
.ems-profile-table th { background: #f6f7f7; width: 160px; }
.ems-marksheet-header { text-align: center; margin-bottom: 16px; }
.ems-marksheet-sign { display: flex; justify-content: space-between; margin-top: 60px; font-weight: 600; }
.ems-notice-list { list-style: none; padding: 0; margin: 0; }
.ems-notice-list li { padding: 12px 0; border-bottom: 1px solid #f0f0f1; }
.ems-tag { display: inline-block; background: #eef4fb; color: #2271b1; font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-left: 8px; }

/* ---------- Result cards (list view) ---------- */
.ems-result-cards { display: flex; flex-direction: column; gap: 14px; }
.ems-result-card {
	border: 1px solid #e2e2e2; border-left: 5px solid #94a3b8; border-radius: 8px;
	padding: 16px 18px; background: #fafafa;
}
.ems-result-card.ems-result-pass { border-left-color: #16a34a; }
.ems-result-card.ems-result-fail { border-left-color: #dc2626; }
.ems-result-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ems-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; }
.ems-badge-pass { background: #dcfce7; color: #15803d; }
.ems-badge-fail { background: #fee2e2; color: #b91c1c; }
.ems-result-card-mid { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.ems-gpa-circle {
	--gpa-pct: 0%;
	width: 64px; height: 64px; border-radius: 50%; display: flex; flex-direction: column;
	align-items: center; justify-content: center; flex-shrink: 0; color: #0f4c81; font-weight: 700;
	background: conic-gradient(#0f4c81 var(--gpa-pct), #e5e7eb var(--gpa-pct));
}
.ems-gpa-circle span { background: #fff; border-radius: 50%; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.ems-gpa-circle small { position: absolute; margin-top: 46px; font-size: 9px; color: #666; font-weight: 400; }
.ems-result-card-info { font-size: 14px; line-height: 1.6; }

/* ---------- Board-style marksheet ---------- */
.ems-board-sheet {
	position: relative; background: #fff; border: 3px double #0f4c81; border-radius: 4px;
	padding: 0; max-width: 780px; margin: 0 auto; overflow: hidden;
}
.ems-watermark {
	position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-30deg);
	font-size: 54px; font-weight: 800; color: rgba(15,76,129,0.06); white-space: nowrap;
	pointer-events: none; z-index: 0; text-transform: uppercase;
}
.ems-sheet-inner { position: relative; z-index: 1; padding: 26px 30px; }
.ems-sheet-header { display: flex; align-items: center; gap: 16px; border-bottom: 2px solid #0f4c81; padding-bottom: 14px; margin-bottom: 14px; }
.ems-sheet-emblem { font-size: 42px; flex-shrink: 0; }
.ems-sheet-emblem img { width: 60px; height: 60px; object-fit: contain; }
.ems-sheet-title h2 { margin: 0 0 2px; color: #0f4c81; font-size: 20px; }
.ems-sheet-title p { margin: 0 0 8px; font-size: 12px; color: #555; }
.ems-sheet-banner {
	display: inline-block; background: #0f4c81; color: #fff; font-weight: 700; letter-spacing: 1px;
	font-size: 13px; padding: 4px 14px; border-radius: 3px;
}
.ems-sheet-meta { display: flex; justify-content: space-between; font-size: 13px; color: #333; margin-bottom: 14px; }
.ems-sheet-info { display: flex; gap: 30px; margin-bottom: 18px; flex-wrap: wrap; }
.ems-sheet-info > div { flex: 1; min-width: 220px; }
.ems-sheet-info div div { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dotted #ddd; font-size: 13px; }
.ems-sheet-info span { color: #777; }
.ems-grade-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 13px; }
.ems-grade-table th { background: #0f4c81; color: #fff; padding: 8px 10px; text-align: left; }
.ems-grade-table td { padding: 8px 10px; border-bottom: 1px solid #eee; vertical-align: middle; }
.ems-grade-table tr.ems-row-fail td { background: #fef2f2; }
.ems-subject-cell { min-width: 160px; }
.ems-bar-track { background: #eee; border-radius: 4px; height: 6px; margin-top: 4px; overflow: hidden; }
.ems-bar-fill { background: #0f4c81; height: 100%; border-radius: 4px; }
.ems-grade-chip { display: inline-block; padding: 2px 10px; border-radius: 10px; font-weight: 700; font-size: 12px; background: #e0e7ff; color: #1e3a8a; }
.ems-grade-chip.ems-grade-f { background: #fee2e2; color: #b91c1c; }
.ems-grade-chip.ems-grade-ap { background: #dcfce7; color: #15803d; }
.ems-grade-chip.ems-grade-a { background: #dbeafe; color: #1d4ed8; }
.ems-sheet-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.ems-sum-box { flex: 1; min-width: 110px; text-align: center; background: #f6f8fb; border: 1px solid #e5e7eb; border-radius: 6px; padding: 10px; }
.ems-sum-box span { display: block; font-size: 11px; color: #777; text-transform: uppercase; }
.ems-sum-box strong { font-size: 17px; color: #0f4c81; }
.ems-sum-result.pass strong { color: #15803d; }
.ems-sum-result.fail strong { color: #b91c1c; }
.ems-compare-panel { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 6px; padding: 14px 16px; margin-bottom: 20px; }
.ems-compare-panel h4 { margin: 0 0 10px; font-size: 14px; }
.ems-compare-row { display: grid; grid-template-columns: 110px 1fr 40px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.ems-compare-row .ems-bar-track { margin-top: 0; height: 10px; }
.ems-bar-you { background: #0f4c81; }
.ems-bar-avg { background: #f59e0b; }
.ems-bar-max { background: #16a34a; }
.ems-sheet-sign { display: flex; justify-content: space-between; margin: 40px 0 10px; font-size: 12px; text-align: center; }
.ems-sign-line { border-top: 1px solid #333; width: 130px; margin: 0 auto 6px; padding-top: 30px; }
.ems-sheet-footer { display: flex; justify-content: space-between; font-size: 11px; color: #777; border-top: 1px dashed #ddd; padding-top: 10px; }

@media print {
	.ems-portal-header, .ems-portal-nav, .ems-print-hide { display: none !important; }
	.ems-portal { border: none; box-shadow: none; }
	.ems-board-sheet { border-width: 2px; }
	.ems-watermark { color: rgba(15,76,129,0.08); }
}

/* ---------- Admit Card (প্রবেশপত্র) ---------- */
.ems-admit-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.ems-admit-card {
	position: relative; background: #fff; border: 2px solid #0f4c81; border-radius: 6px;
	width: 100%; max-width: 480px; overflow: hidden; page-break-inside: avoid; break-inside: avoid;
}
.ems-admit-card .ems-watermark { font-size: 30px; }
.ems-admit-inner { position: relative; z-index: 1; padding: 16px 18px; }
.ems-admit-header { display: flex; align-items: flex-start; gap: 10px; border-bottom: 2px solid #0f4c81; padding-bottom: 10px; margin-bottom: 10px; }
.ems-admit-emblem { font-size: 26px; flex-shrink: 0; }
.ems-admit-emblem img { width: 42px; height: 42px; object-fit: contain; }
.ems-admit-title { flex: 1; min-width: 0; }
.ems-admit-title h2 { margin: 0 0 2px; color: #0f4c81; font-size: 15px; line-height: 1.3; }
.ems-admit-title p { margin: 0 0 6px; font-size: 10px; color: #555; }
.ems-admit-banner { display: inline-block; background: #0f4c81; color: #fff; font-weight: 700; letter-spacing: .5px; font-size: 11px; padding: 3px 10px; border-radius: 3px; }
.ems-admit-photo {
	width: 64px; height: 76px; border: 1px solid #ccc; border-radius: 3px; flex-shrink: 0;
	display: flex; align-items: center; justify-content: center; background: #f6f7f7; overflow: hidden;
}
.ems-admit-photo img { width: 100%; height: 100%; object-fit: cover; }
.ems-admit-photo span { font-size: 26px; color: #999; }
.ems-admit-examline { font-size: 12px; margin-bottom: 10px; color: #333; }
.ems-admit-info { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 16px; margin-bottom: 10px; }
.ems-admit-info div { display: flex; justify-content: space-between; gap: 6px; padding: 3px 0; border-bottom: 1px dotted #ddd; font-size: 11px; }
.ems-admit-info span { color: #777; flex-shrink: 0; }
.ems-admit-info strong { text-align: right; }
.ems-admit-subjects { font-size: 11px; margin-bottom: 10px; border-top: 1px dashed #ddd; padding-top: 8px; }
.ems-admit-subjects-label { color: #777; text-transform: uppercase; font-size: 10px; display: block; margin-bottom: 4px; }
.ems-admit-subjects ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.ems-admit-subjects li { background: #f6f8fb; border: 1px solid #e5e7eb; border-radius: 10px; padding: 2px 8px; }
.ems-admit-rules { font-size: 10px; color: #555; background: #fffbea; border: 1px dashed #f0c36d; border-radius: 4px; padding: 6px 8px; margin-bottom: 14px; line-height: 1.5; }
.ems-admit-sign { display: flex; justify-content: space-between; margin: 18px 0 8px; font-size: 10px; text-align: center; }
.ems-admit-sign .ems-sign-line { width: 100px; padding-top: 20px; }
.ems-admit-footer { display: flex; justify-content: space-between; font-size: 9px; color: #777; border-top: 1px dashed #ddd; padding-top: 6px; }

@media print {
	.ems-admit-card { border-width: 1.5px; }
	.ems-admit-grid { gap: 10px; }
}
