/* Clever Members — front-end styles */
.cm-front { font-size: 15px; }

/* -------------------- Login -------------------- */
.cm-login-box {
	max-width: 380px;
	margin: 0 auto;
	background: #fff;
	border: 1px solid #e2e4e7;
	border-radius: 10px;
	padding: 26px 26px 20px;
	box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.cm-login-box h3 { margin: 0 0 16px; text-align: center; }
.cm-login-box label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.cm-login-box input {
	display: block;
	width: 100%;
	margin-top: 4px;
	padding: 9px 11px;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	font-size: 15px;
	box-sizing: border-box;
}
.cm-login-box .cm-btn { width: 100%; text-align: center; margin-top: 4px; }
.cm-login-error {
	background: #fcf0f1;
	border: 1px solid #f0b8bb;
	color: #b32d2e;
	border-radius: 6px;
	padding: 8px 12px;
	font-size: 13.5px;
}
.cm-forgot { text-align: center; margin: 14px 0 0; font-size: 13px; }
.cm-notice { background: #f6f7f7; border: 1px solid #e2e4e7; border-radius: 8px; padding: 12px 16px; }

/* -------------------- Buttons -------------------- */
.cm-front .cm-btn, .cm-portal .cm-btn {
	display: inline-block;
	border: 1px solid #2271b1;
	background: #2271b1;
	color: #fff;
	border-radius: 6px;
	padding: 9px 18px;
	font-size: 14px;
	cursor: pointer;
	text-decoration: none;
}
.cm-front .cm-btn:hover { background: #135e96; }

/* -------------------- App bar + hamburger menu -------------------- */
.cm-portal { position: relative; }
.cm-appwrap { position: sticky; top: 0; z-index: 500; margin-bottom: 18px; }
body.admin-bar .cm-appwrap { top: 32px; }
.cm-appbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #1d2327;
	color: #fff;
	border-radius: 10px;
	padding: 12px 16px;
	position: relative;
	z-index: 2;
}
.cm-appbar-title { font-size: 17px; font-weight: 700; }

.cm-menu-toggle {
	background: none;
	border: 0;
	cursor: pointer;
	padding: 6px 2px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 34px;
	height: 34px;
}
.cm-menu-toggle span {
	display: block;
	height: 3px;
	width: 26px;
	background: #fff;
	border-radius: 2px;
	transition: transform .22s ease, opacity .18s ease;
}
.cm-menu-toggle.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.cm-menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.cm-menu-toggle.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.cm-portal-menu {
	display: none;
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	background: #fff;
	border: 1px solid #e2e4e7;
	border-radius: 0 0 12px 12px;
	box-shadow: 0 14px 34px rgba(0,0,0,.18);
	z-index: 499;
	overflow: hidden;
}
.cm-portal-menu.is-open { display: block; }
.cm-pnav {
	display: block;
	width: 100%;
	text-align: left;
	background: none;
	border: 0;
	border-bottom: 1px solid #eef0f1;
	padding: 15px 18px;
	font-size: 15.5px;
	color: #1d2327;
	cursor: pointer;
	text-decoration: none;
	box-sizing: border-box;
}
.cm-pnav:last-child { border-bottom: 0; }
.cm-pnav:hover { background: #f6f7f7; }
.cm-pnav.is-active { color: #2271b1; font-weight: 700; background: #eef4fa; }
.cm-pnav-logout { color: #b32d2e; }

.cm-ppanel { display: none; }
.cm-ppanel.is-active { display: block; }
.cm-ppanel-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.cm-ppanel-head h2 { margin: 0; }

/* -------------------- Home -------------------- */
.cm-profile-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin-bottom: 22px; }
.cm-profile-photo {
	width: 84px;
	height: 84px;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid #e2e4e7;
}
.cm-profile-photo-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #2271b1;
	color: #fff;
	font-size: 26px;
	font-weight: 700;
}
.cm-home-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 28px; }
.cm-home-col h3 { margin: 0 0 10px; border-bottom: 1px solid #e2e4e7; padding-bottom: 6px; }

.cm-doc-ul { list-style: none; margin: 0 0 22px; padding: 0; }
.cm-doc-item { margin: 0 0 6px; }
.cm-doc-link {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	background: #f6f7f7;
	border: 1px solid #e2e4e7;
	border-radius: 6px;
	padding: 9px 12px;
	text-decoration: none;
	color: #2271b1;
	font-weight: 600;
}
.cm-doc-link:hover { background: #eef4fa; }
.cm-doc-date { color: #8c8f94; font-weight: 400; white-space: nowrap; }
.cm-empty { color: #8c8f94; font-style: italic; }

/* -------------------- Event list calendar -------------------- */
#cm-calendar { border: 1px solid #e2e4e7; border-radius: 12px; overflow: hidden; background: #fff; }
.cm-cal-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #1d2327;
	color: #fff;
	padding: 10px 12px;
}
.cm-cal-title { font-weight: 700; font-size: 15px; }
.cm-cal-nav {
	background: rgba(255,255,255,.12);
	border: 0;
	color: #fff;
	font-size: 22px;
	cursor: pointer;
	line-height: 1;
	padding: 4px 14px;
	border-radius: 8px;
}
.cm-cal-nav:hover { background: rgba(255,255,255,.22); }

.cm-cal-list { padding: 10px; }
.cm-cal-empty { color: #8c8f94; font-style: italic; text-align: center; padding: 22px 10px; margin: 0; }

.cm-cal-item {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	text-align: left;
	background: #f6f7f7;
	border: 1px solid #e2e4e7;
	border-radius: 10px;
	padding: 10px 12px;
	margin-bottom: 8px;
	cursor: pointer;
	box-sizing: border-box;
	transition: background .15s ease;
}
.cm-cal-item:last-child { margin-bottom: 0; }
.cm-cal-item:hover, .cm-cal-item:active { background: #eef4fa; }
.cm-cal-item-today { border-color: #2271b1; background: #eef4fa; }

.cm-cal-datebadge {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 56px;
	background: #2271b1;
	color: #fff;
	border-radius: 10px;
}
.cm-cal-badge-mon { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; opacity: .9; }
.cm-cal-badge-day { font-size: 22px; font-weight: 800; line-height: 1.05; }

.cm-cal-item-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cm-cal-item-name { font-weight: 700; color: #1d2327; font-size: 15px; }
.cm-cal-item-meta { font-size: 12.5px; color: #50575e; }
.cm-cal-item-venue { font-size: 12px; color: #8c8f94; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cm-cal-item-chev { flex: 0 0 auto; color: #8c8f94; font-size: 22px; line-height: 1; }

/* -------------------- Tables / past officers -------------------- */
.cm-front-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.cm-front-table th { text-align: left; background: #f6f7f7; border-bottom: 2px solid #e2e4e7; padding: 9px 12px; }
.cm-front-table td { border-bottom: 1px solid #eef0f1; padding: 8px 12px; }
.cm-past-year { border: 1px solid #e2e4e7; border-radius: 8px; margin-bottom: 10px; padding: 0 14px; }
.cm-past-year summary { cursor: pointer; font-weight: 700; padding: 12px 0; font-size: 16px; }

/* -------------------- Front-end modal -------------------- */
.cm-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.55);
	z-index: 100000;
	align-items: flex-start;
	justify-content: center;
	padding: 40px 16px;
	overflow-y: auto;
}
.cm-modal-overlay.is-open { display: flex; }
.cm-modal {
	background: #fff;
	border-radius: 10px;
	width: 560px;
	max-width: 100%;
	box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.cm-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid #e2e4e7; }
.cm-modal-head h3 { margin: 0; }
.cm-modal-close { background: none; border: 0; font-size: 24px; cursor: pointer; color: #8c8f94; line-height: 1; }
.cm-modal-body { padding: 18px; max-height: 72vh; overflow-y: auto; }
.cm-fe-when { font-weight: 600; color: #50575e; }
.cm-fe-venue { font-weight: 600; margin: 12px 0 6px; }

/* -------------------- Responsive -------------------- */
.cm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 820px) {
	.cm-home-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 700px) {
	.cm-front { font-size: 14px; }

	/* App bar */
	.cm-appbar { border-radius: 0 10px 10px 10px; padding: 11px 14px; }
	.cm-appbar-title { font-size: 16px; }

	/* Login */
	.cm-login-box { max-width: 100%; padding: 20px 18px 16px; }
	.cm-login-box input { font-size: 16px; } /* prevents iOS zoom-on-focus */

	/* Home / profile */
	.cm-profile-head { flex-direction: column; text-align: center; gap: 14px; }
	.cm-profile-id { flex-direction: column; gap: 8px; }
	.cm-idcard { width: 100%; }
	.cm-idcard-mid { justify-content: center; }
	.cm-idcard-photo img, .cm-idcard-photo-empty { width: 96px; height: 96px; }
	.cm-profile-photo { width: 96px; height: 96px; }
	.cm-doc-link { flex-direction: column; gap: 2px; }
	.cm-doc-date { white-space: normal; }
	.cm-ppanel-head { flex-direction: column; align-items: flex-start; }

	/* Event list */
	.cm-cal-datebadge { width: 46px; height: 50px; }
	.cm-cal-badge-day { font-size: 19px; }
	.cm-cal-item { gap: 10px; padding: 9px 10px; }
	.cm-cal-item-name { font-size: 14px; }
	.cm-cal-head { padding: 8px 10px; }

	/* Tables stack into cards */
	.cm-front-table thead { display: none; }
	.cm-front-table, .cm-front-table tbody, .cm-front-table tr, .cm-front-table td { display: block; width: 100%; box-sizing: border-box; }
	.cm-front-table tr { border: 1px solid #e2e4e7; border-radius: 8px; margin-bottom: 10px; padding: 6px 0; }
	.cm-front-table td { border-bottom: 0; padding: 4px 12px; }
	.cm-front-table td[data-label]::before {
		content: attr(data-label);
		display: block;
		font-size: 11px;
		font-weight: 700;
		text-transform: uppercase;
		color: #8c8f94;
	}

	/* Modal */
	.cm-modal-overlay { padding: 12px 8px; }
	.cm-modal { width: 100%; }
	.cm-modal-body { padding: 14px; max-height: 78vh; }
	.cm-modal-body iframe { height: 200px !important; }

	/* Buttons easier to tap */
	.cm-front .cm-btn, .cm-portal .cm-btn { padding: 11px 18px; }
	.cm-past-year summary { padding: 14px 0; }
}

/* -------------------- App bar actions + scan button -------------------- */
.cm-appbar-actions { display: flex; align-items: center; gap: 10px; }
.cm-scan-toggle {
	background: rgba(255,255,255,.12);
	border: 0;
	color: #7fd18b;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	width: 34px;
	height: 34px;
	border-radius: 8px;
}
.cm-scan-toggle:hover { background: rgba(255,255,255,.22); }

/* -------------------- Membership card -------------------- */
.cm-profile-id { display: flex; align-items: center; gap: 18px; }
.cm-idcard {
	background: #fff;
	border: 1px solid #dcdfe3;
	border-radius: 14px;
	box-shadow: 0 4px 16px rgba(0,0,0,.08);
	padding: 16px 18px;
	width: 320px;
	max-width: 100%;
	box-sizing: border-box;
}
.cm-idcard-name { font-weight: 800; font-size: 17px; text-align: center; margin-bottom: 12px; color: #1d2327; }
.cm-idcard-mid { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.cm-idcard-qr { flex: 0 0 auto; line-height: 0; }
.cm-idcard-qr-svg { border: 1px solid #eef0f1; border-radius: 6px; }
.cm-idcard-photo { flex: 0 0 auto; }
.cm-idcard-photo img, .cm-idcard-photo-empty {
	width: 110px;
	height: 110px;
	border-radius: 10px;
	object-fit: cover;
	border: 1px solid #e2e4e7;
}
.cm-idcard-photo-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #2271b1;
	color: #fff;
	font-size: 30px;
	font-weight: 700;
	box-sizing: border-box;
}
.cm-idcard-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12.5px; color: #50575e; padding: 5px 0; border-top: 1px solid #eef0f1; }
.cm-idcard-row strong { color: #1d2327; font-size: 13px; text-align: right; }
.cm-idcard-status-yes { color: #1e7a34 !important; }
.cm-idcard-status-no, .cm-idcard-status-suspended, .cm-idcard-status-deceased { color: #b32d2e !important; }

/* -------------------- Scanner panel -------------------- */
#cm-qr-reader { max-width: 420px; margin: 0 auto; border: 1px solid #e2e4e7; border-radius: 12px; overflow: hidden; }
.cm-scan-hint { text-align: center; color: #8c8f94; font-size: 13px; margin-top: 10px; }
.cm-scan-error { padding: 20px; text-align: center; color: #b32d2e; }
.cm-scan-result { max-width: 420px; margin: 0 auto; text-align: center; }
.cm-scan-result-card {
	border-radius: 14px;
	padding: 26px 20px;
	margin-bottom: 16px;
	border: 2px solid transparent;
}
.cm-scan-result-card.cm-scan-ok { background: #e5f6e8; border-color: #9fd8ab; }
.cm-scan-result-card.cm-scan-bad { background: #fbeaea; border-color: #efb2b4; }
.cm-scan-result-name { font-size: 22px; font-weight: 800; margin-bottom: 14px; color: #1d2327; }
.cm-scan-result-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 4px; border-top: 1px solid rgba(0,0,0,.08); font-size: 14px; color: #3c434a; }
.cm-scan-result-row strong { color: #1d2327; }
.cm-scan-result .cm-btn { width: 100%; }

/* -------------------- Renewal banner + payment -------------------- */
.cm-renew-banner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
	background: #fff8e1;
	border: 1px solid #f0d47a;
	border-radius: 10px;
	padding: 12px 16px;
	margin-bottom: 14px;
	color: #6b5200;
	font-weight: 600;
}
.cm-renew-pay {
	background: #fff;
	border: 1px solid #e2e4e7;
	border-radius: 12px;
	box-shadow: 0 4px 16px rgba(0,0,0,.06);
	padding: 18px;
	margin-bottom: 16px;
	max-width: 440px;
}
.cm-renew-pay h3 { margin: 0 0 12px; }
.cm-renew-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px solid #eef0f1; font-size: 14.5px; }
.cm-renew-total { font-size: 16px; border-bottom: 0; }
.cm-renew-total strong { color: #1e7a34; }
.cm-renew-pay .cm-btn { width: 100%; margin-top: 12px; }
#cm-paypal-buttons { margin-top: 14px; }
.cm-renew-msg { margin: 10px 0 0; font-size: 13.5px; color: #50575e; }
.cm-renew-msg.cm-renew-ok { color: #1e7a34; font-weight: 700; }

/* Card download button */
.cm-idcard-download { display: block; text-align: center; margin-top: 12px; width: 100%; box-sizing: border-box; }

@media (max-width: 700px) {
	.cm-renew-banner { flex-direction: column; align-items: stretch; text-align: center; }
	.cm-renew-pay { max-width: 100%; }
}

/* ==========================================================================
 * Edit Profile
 * ========================================================================== */
.cm-profile-name-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.cm-profile-name-wrap h2 { margin: 0; }
#cm-edit-profile-btn { padding: 7px 16px; }
.cm-profile-form { max-width: 460px; }
.cm-pf-photo-row { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.cm-pf-preview img,
.cm-pf-initials {
	width: 110px;
	height: 110px;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid #e2e4e7;
}
.cm-pf-initials {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #2271b1;
	color: #fff;
	font-size: 32px;
	font-weight: 700;
}
.cm-pf-photo-field { flex: 1; min-width: 0; }
.cm-pf-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.cm-pf-label input,
.cm-pf-label textarea {
	display: block;
	width: 100%;
	margin-top: 5px;
	padding: 9px 11px;
	border: 1px solid #c8ccd0;
	border-radius: 6px;
	font-size: 14px;
	font-family: inherit;
	box-sizing: border-box;
	background: #fff;
}
.cm-pf-label input[type="file"] { padding: 7px; background: #f6f7f7; }
.cm-pf-hint { font-size: 12px; color: #666; margin: 4px 0 14px; }
.cm-pf-subhead { margin: 22px 0 4px; }
.cm-pf-msg { margin-left: 10px; font-size: 13px; color: #b32d2e; }
.cm-pf-msg.cm-pf-ok { color: #1a7f37; }
@media (max-width: 640px) {
	.cm-pf-photo-row { flex-direction: column; align-items: flex-start; }
	.cm-profile-name-wrap { align-items: center; }
	.cm-pf-label input, .cm-pf-label textarea { font-size: 16px; } /* prevents iOS zoom-on-focus */
}

/* Waiting-member status notice */
.cm-waiting-notice { max-width: 520px; margin: 24px auto; text-align: center; font-size: 15px; }
.cm-waiting-notice p { margin: 0 0 12px; }
.cm-waiting-notice p:last-child { margin-bottom: 0; }

/* Account-status popup (Waiting / Suspended / Deceased) */
.cm-status-overlay {
	position: fixed;
	top: 0; right: 0; bottom: 0; left: 0;
	background: rgba(0, 0, 0, .55);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
	padding: 20px;
	box-sizing: border-box;
}
.cm-status-modal {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
	padding: 30px 28px;
	max-width: 420px;
	width: 100%;
	text-align: center;
	font-size: 15px;
	line-height: 1.5;
}
.cm-status-modal p { margin: 0 0 20px; }
.cm-status-modal .cm-btn { min-width: 130px; text-align: center; }

/* Event payment section in the event popup */
.cm-fe-pay { margin-top: 18px; border-top: 1px solid #e2e4e7; padding-top: 12px; }
.cm-fe-pay-title { margin: 0 0 10px; }
.cm-fe-pay .cm-btn { margin-top: 10px; }
.cm-fe-check { margin-top: 14px; background: #f6f7f7; border: 1px solid #e2e4e7; border-radius: 8px; padding: 12px 14px; }
.cm-fe-check h5 { margin: 0 0 8px; font-size: 14px; }
.cm-fe-check p { margin: 0 0 6px; }
.cm-fe-check-addr { font-weight: 600; white-space: pre-line; }
