/* ===== GBWA Subsidy ID Card — Statewide Enrollments ===== */

.tbss-root {
	max-width: 940px;
	margin: 20px auto;
	background: #fffdf8;
	border: 1px solid #f0dfb8;
	border-radius: 14px;
	box-shadow: 0 4px 18px rgba(180, 120, 20, 0.12);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
	color: #3a2a10;
	overflow: hidden;
}

/* ---------- Top bar ---------- */
.tbss-topbar {
	background: linear-gradient(135deg, #fff3d6, #ffe6b0);
	padding: 16px 18px;
	border-bottom: 2px solid #f0c96a;
}
.tbss-menu-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
}
.tbss-title {
	text-align: center;
	font-size: 18px;
	font-weight: 800;
	color: #7a3d00;
	line-height: 1.4;
	margin: 14px 0 0;
}
.tbss-title span { display: block; font-size: 12px; font-weight: 600; color: #9a6a20; margin-top: 2px; }
.tbss-topbtn {
	background: #ffffff;
	border: 2px solid #d99a2b;
	color: #7a3d00;
	font-size: 13px;
	font-weight: 700;
	padding: 10px 12px;
	border-radius: 8px;
	cursor: pointer;
	white-space: nowrap;
}
.tbss-topbtn:hover { background: #fff0d0; }

/* ---------- Views ---------- */
.tbss-view { display: none; padding: 22px; }
.tbss-view.tbss-active { display: block; }

/* ---------- Form ---------- */
.tbss-form { display: flex; flex-direction: column; gap: 16px; }
.tbss-field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.tbss-field-row .tbss-field { flex: 2; min-width: 200px; }
.tbss-field-row .tbss-field-small { flex: 1; min-width: 90px; }
.tbss-field-narrow { max-width: 220px; }

.tbss-field label { display: block; font-size: 15px; font-weight: 700; color: #5a3c10; margin-bottom: 6px; }
.tbss-field .req { color: #c0392b; }
.tbss-field input[type="text"],
.tbss-field input[type="tel"],
.tbss-field input[type="number"],
.tbss-field input[type="password"] {
	width: 100%;
	box-sizing: border-box;
	padding: 13px 14px;
	font-size: 17px;
	border: 2px solid #e7d0a0;
	border-radius: 9px;
	background: #fffefb;
	color: #2c1e08;
}
.tbss-field input:focus { outline: none; border-color: #d99a2b; background: #ffffff; }

.tbss-aadhar-group { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tbss-aadhar-part { width: 100% !important; max-width: 260px; text-align: center; letter-spacing: 6px; font-size: 22px !important; font-weight: 800; padding: 14px !important; }
.tbss-aadhar-sep { font-size: 20px; color: #b98a2f; font-weight: 700; line-height: 1; }
.tbss-aadhar-confirm {
	margin-top: 10px;
	background: #e6f6e6;
	border: 1px solid #b0e0b0;
	color: #226622;
	font-weight: 800;
	font-size: 15px;
	letter-spacing: 2px;
	text-align: center;
	padding: 10px;
	border-radius: 8px;
}

/* ---------- Photo upload ---------- */
.tbss-photo-row { display: flex; gap: 18px; flex-wrap: wrap; }
.tbss-photo-box { flex: 1; min-width: 160px; text-align: center; }
.tbss-photo-box label { display: block; font-size: 14px; font-weight: 700; color: #5a3c10; margin-bottom: 8px; }
.tbss-photo-preview {
	width: 140px;
	height: 140px;
	margin: 0 auto 10px;
	border: 2px dashed #d99a2b;
	border-radius: 10px;
	background: #fffaf0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	color: #b08040;
	overflow: hidden;
}
.tbss-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.tbss-photo-hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.tbss-photo-btns { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.tbss-photo-btn {
	background: #fff;
	border: 2px solid #d99a2b;
	color: #7a3d00;
	font-size: 12px;
	font-weight: 700;
	padding: 8px 10px;
	border-radius: 7px;
	cursor: pointer;
}
.tbss-photo-btn:hover { background: #fff0d0; }

/* ---------- Disclaimer ---------- */
.tbss-disclaimer-box {
	background: #fff3d6;
	border: 1px solid #f0c96a;
	border-radius: 10px;
	padding: 14px 16px;
	font-size: 13px;
	line-height: 1.6;
	color: #6b4a10;
}
.tbss-agree-label { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; font-weight: 700; cursor: pointer; }

.tbss-orphan-box {
	background: #fff3d6;
	border: 2px solid #d99a2b;
	border-radius: 10px;
	padding: 14px 16px;
	font-size: 15px;
	font-weight: 800;
	color: #5a3c10;
}
.tbss-orphan-box .tbss-agree-label { margin-top: 0; font-weight: 800; }
.tbss-orphan-box input[type="checkbox"] { transform: scale(1.4); margin-right: 4px; flex-shrink: 0; }

/* ---------- Preview modal ---------- */
.tbss-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(90, 60, 16, 0.45);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	padding: 16px;
}
.tbss-modal-box {
	background: #fffdf8;
	border: 2px solid #d99a2b;
	border-radius: 16px;
	padding: 20px;
	max-width: 420px;
	width: 100%;
	max-height: 92vh;
	overflow-y: auto;
	box-shadow: 0 10px 30px rgba(90,60,16,0.3);
}
.tbss-modal-title { text-align: center; color: #7a3d00; font-size: 17px; margin: 0 0 14px; }

.tbss-submit-btn {
	background: #ffe680;
	color: #1a1a1a;
	border: 2px solid #d99a2b;
	padding: 15px;
	font-size: 18px;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 1px;
	border-radius: 10px;
	cursor: pointer;
}
.tbss-submit-btn:hover { background: #ffd94d; }
.tbss-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.tbss-back-btn {
	background: #fff; border: 2px solid #d99a2b; color: #7a3d00;
	padding: 10px 16px; font-size: 14px; font-weight: 700; border-radius: 8px; cursor: pointer;
}

.tbss-msg { font-size: 14px; font-weight: 700; padding: 10px 12px; border-radius: 8px; display: none; }
.tbss-msg.tbss-ok { display: block; background: #e6f6e6; color: #226622; border: 1px solid #b0e0b0; }
.tbss-msg.tbss-err { display: block; background: #fdeaea; color: #a12525; border: 1px solid #f0b0b0; }
.tbss-msg-warn.tbss-visible { display: block; background: #fff2d0; color: #9a6a00; border: 1px solid #f0c96a; }

/* ---------- Lists / tables ---------- */
.tbss-list-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.tbss-list-header h2 { flex: 1; font-size: 19px; color: #7a3d00; margin: 0; }
#tbss-list-search, #tbss-admin-search { padding: 10px 12px; font-size: 14px; border: 2px solid #e7d0a0; border-radius: 8px; background: #fffefb; }

.tbss-table-wrap { overflow-x: auto; border: 1px solid #f0dfb8; border-radius: 10px; }
.tbss-table { width: 100%; border-collapse: collapse; background: #fffefb; }
.tbss-table th {
	background: #fff3d6; color: #7a3d00; font-size: 12px; text-transform: uppercase;
	padding: 10px 8px; text-align: left; border-bottom: 2px solid #f0c96a; white-space: nowrap;
}
.tbss-table td { padding: 8px; font-size: 13px; border-bottom: 1px solid #f2e6c8; word-break: break-word; vertical-align: middle; }
.tbss-table tr:hover td { background: #fffaf0; }
.tbss-loading { text-align: center; padding: 20px; color: #a07a30; font-weight: 700; }
.tbss-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }

.tbss-download-link-btn {
	background: #2e9e2e; color: #fff; border: none; padding: 7px 12px;
	border-radius: 6px; font-size: 12px; font-weight: 800; cursor: pointer;
}

.tbss-status-badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 800; }
.tbss-status-approved { background: #e2f5e2; color: #1e7a1e; }
.tbss-status-pending  { background: #fff2d0; color: #9a6a00; }
.tbss-status-blocked  { background: #fbe3e3; color: #a12525; }

/* ---------- Login / verify box ---------- */
.tbss-login-box { max-width: 380px; margin: 20px auto; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.tbss-login-box h2 { color: #7a3d00; margin: 0; }
.tbss-login-box .tbss-field { text-align: left; }
#tbss-pin-input {
	width: 100%; box-sizing: border-box; padding: 14px; font-size: 20px; text-align: center;
	letter-spacing: 6px; border: 2px solid #e7d0a0; border-radius: 9px;
}

/* ---------- Approved ID Cards (internal staff search) ---------- */
.tbss-note-small { font-size: 12px; color: #a12525; font-weight: 700; margin-top: -6px; }
.tbss-note-info { font-size: 12px; color: #8a6a20; font-weight: 700; margin-top: 6px; }
.tbss-showid-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.tbss-showid-header h2 { color: #7a3d00; margin: 0; font-size: 19px; }
.tbss-showid-search-wrap { position: relative; max-width: 480px; margin: 0 auto 20px; }
.tbss-showid-search-wrap input {
	width: 100%; box-sizing: border-box; padding: 13px 14px; font-size: 16px;
	border: 2px solid #e7d0a0; border-radius: 9px; background: #fffefb;
}
.tbss-showid-results {
	position: absolute; left: 0; right: 0; top: 100%; z-index: 5;
	background: #fff; border: 2px solid #e7d0a0; border-top: none;
	border-radius: 0 0 9px 9px; max-height: 320px; overflow-y: auto;
	box-shadow: 0 6px 14px rgba(180,120,20,0.15);
}
.tbss-showid-result-item {
	display: flex; align-items: center; gap: 10px; padding: 8px 12px;
	cursor: pointer; border-bottom: 1px solid #f2e6c8; font-size: 13px;
}
.tbss-showid-result-item:hover { background: #fff3d6; }
.tbss-showid-result-item .tbss-thumb { width: 34px; height: 34px; }
.tbss-showid-result-empty { padding: 10px 12px; font-size: 13px; color: #a07a30; }

/* ---------- ID Card ---------- */
.tbss-preview-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.tbss-idcard {
	width: 380px;
	max-width: 100%;
	background: linear-gradient(160deg, #fffaf0, #fff3d6);
	border: 3px solid #d99a2b;
	border-radius: 16px;
	padding: 16px;
	box-shadow: 0 6px 20px rgba(180,120,20,0.2);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}
.tbss-idcard-header { text-align: center; border-bottom: 2px solid #d99a2b; padding-bottom: 8px; margin-bottom: 10px; }
.tbss-idcard-header .org { font-size: 15px; font-weight: 900; color: #7a3d00; letter-spacing: 0.5px; }
.tbss-idcard-header .sub { font-size: 11px; font-weight: 700; color: #9a6a20; }
.tbss-idcard-cardno { font-size: 12px; font-weight: 800; color: #a15c00; text-align: center; margin-bottom: 10px; }
.tbss-idcard-body { display: flex; gap: 12px; }
.tbss-idcard-photo { width: 90px; height: 100px; border-radius: 8px; border: 2px solid #d99a2b; object-fit: cover; background: #fff; flex-shrink: 0; }
.tbss-idcard-fields { flex: 1; font-size: 12px; line-height: 1.7; color: #3a2a10; }
.tbss-idcard-fields b { color: #5a3c10; }
.tbss-idcard-nominee-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #d99a2b; }
.tbss-idcard-nominee-photo { width: 46px; height: 46px; border-radius: 6px; border: 2px solid #d99a2b; object-fit: cover; background: #fff; flex-shrink: 0; }
.tbss-idcard-disclaimer { margin-top: 10px; font-size: 9px; color: #8a6a3a; line-height: 1.4; text-align: center; }
.tbss-idcard-status { text-align: center; margin-top: 6px; font-size: 11px; font-weight: 800; }

.tbss-preview-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- Admin panel ---------- */
.tbss-admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.tbss-admin-header h2 { color: #7a3d00; margin: 0; font-size: 19px; }
.tbss-logout-btn { background: #fff; border: 2px solid #c0392b; color: #c0392b; font-weight: 800; padding: 9px 16px; border-radius: 8px; cursor: pointer; }

.tbss-distribution-box {
	background: #fff3d6; border: 1px solid #f0c96a; border-radius: 10px;
	padding: 14px 16px; margin-bottom: 16px;
}
.tbss-distribution-box label { display: block; font-weight: 800; color: #7a3d00; margin-bottom: 8px; font-size: 13px; }
.tbss-distribution-row { display: flex; gap: 10px; flex-wrap: wrap; }
.tbss-distribution-row input {
	flex: 1; min-width: 200px; padding: 10px 12px; font-size: 14px;
	border: 2px solid #e7d0a0; border-radius: 8px;
}
#tbss-dist-result { margin-top: 10px; font-size: 14px; font-weight: 800; }
#tbss-dist-result .tbss-dist-ok { color: #1e7a1e; }
#tbss-dist-result .tbss-dist-blocked { color: #a12525; background: #fbe3e3; padding: 10px; border-radius: 8px; display: inline-block; }
#tbss-dist-result .tbss-dist-pending { color: #9a6a00; }

.tbss-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.tbss-stat { flex: 1; min-width: 100px; background: #fffaf0; border: 2px solid #f0dfb8; border-radius: 10px; padding: 12px; text-align: center; }
.tbss-stat span { display: block; font-size: 26px; font-weight: 900; color: #7a3d00; }
.tbss-stat label { font-size: 12px; font-weight: 700; color: #9a6a20; text-transform: uppercase; }
.tbss-stat-pending span { color: #9a6a00; }
.tbss-stat-approved span { color: #1e7a1e; }
.tbss-stat-blocked span { color: #a12525; }

.tbss-filterbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tbss-filter-btn { background: #fff; border: 2px solid #e7d0a0; color: #7a3d00; font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 20px; cursor: pointer; }
.tbss-filter-btn.tbss-filter-active { background: #e8971e; border-color: #e8971e; color: #fff; }
#tbss-admin-search { flex: 1; min-width: 160px; }

.tbss-bulkbar {
	display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
	background: #fff3d6; border: 1px solid #f0c96a; border-radius: 10px;
	padding: 10px 14px; margin-bottom: 14px; font-size: 13px; font-weight: 700; color: #7a3d00;
}
.tbss-selectall-label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.tbss-bulk-btn { border: none; color: #fff; font-weight: 800; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.tbss-bulk-approve { background: #2e9e2e; }
.tbss-bulk-block  { background: #c9700a; }
.tbss-bulk-delete  { background: #c0392b; }

.tbss-admin-table td, .tbss-admin-table th { font-size: 12px; }
.tbss-row-btn { border: none; color: #fff; font-weight: 800; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; margin-right: 4px; margin-bottom: 4px; }
.tbss-row-approve { background: #2e9e2e; }
.tbss-row-block    { background: #c9700a; }
.tbss-row-edit     { background: #d97706; }
.tbss-row-delete   { background: #c0392b; }
.tbss-row-save     { background: #2e9e2e; }
.tbss-row-cancel   { background: #888; }

.tbss-edit-input { width: 100%; box-sizing: border-box; padding: 6px 8px; font-size: 12px; border: 2px solid #e7d0a0; border-radius: 6px; }

@media (max-width: 640px) {
	.tbss-aadhar-part { max-width: 100%; }
	.tbss-idcard { width: 100%; }
}
