.PayModeChoices {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding-top: 4px;
}
.PayModeChoice {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0;
	margin: 0;
	cursor: pointer;
	user-select: none;
}
.PayModeChoice input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}
.PayModeChoice span {
	display: inline-flex;
	align-items: center;
	height: 34px;
	padding: 0 12px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--surface);
	color: var(--ink-2);
	font-size: 12.5px;
	font-weight: 600;
	white-space: nowrap;
}
.PayModeChoice input:checked + span {
	background: var(--brand-strong);
	border-color: var(--brand-strong);
	color: #fff;
}
.PayModeHint {
	margin: 6px 0 0;
	font-size: 11px;
	line-height: 1.4;
	color: var(--ink-3);
	font-weight: 500;
}
.SalaryOnlyField { display: flex; }
.ContactDrawer:not(.HasSalary) .SalaryOnlyField input,
.ContactDrawer:not(.HasSalary) .SalaryOnlyField select {
	opacity: .45;
}
.ContactDrawer.open { display: block; }
.ContactDrawer.ViewMode,
.ContactDrawer.EditMode,
.ContactDrawer.NewMode { width: min(720px, calc(100% - 28px)); }
.overlay-card.ContactDrawer.open.ViewMode,
.overlay-card.ContactDrawer.open.EditMode,
.overlay-card.ContactDrawer.open.NewMode {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.ContactDrawer.ViewMode .ContactFormWrap { display: none; }
.ContactDrawer.EditMode .ContactCard,
.ContactDrawer.NewMode .ContactCard { display: none; }
.ContactDrawer.NewMode .ContactFormClose,
.ContactDrawer.NewMode .ContactFormWrap .b-risk { display: none; }
.ContactDrawer.EditMode .ContactCloseForm { display: none; }
.ContactFormWrap {
	padding: 18px 20px 0;
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1;
	overflow: hidden;
}
.ContactFormWrap .ModHead { flex: none; margin-bottom: 12px; }
.ContactForm {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1;
	overflow: hidden;
}
.ContactFormScroll {
	flex: 1;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	padding-bottom: 28px;
}

.ContactCard {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1;
	overflow: hidden;
}
.ContactBanner {
	height: 92px;
	background: linear-gradient(135deg, #2A1258 0%, #4E46E8 58%, #74DCEC 140%);
	border-radius: var(--r-card) var(--r-card) 0 0;
}
.ContactCardClose {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 36px;
	height: 36px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255,255,255,.22);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.ContactCardClose:hover { background: rgba(255,255,255,.38); }
.ContactCardHead { padding: 0 22px 8px; position: relative; }
.ContactAvatar {
	width: 86px; height: 86px; border-radius: 50%;
	border: 4px solid var(--surface); margin-top: -43px;
	background: linear-gradient(145deg, #A78BFA, #4E46E8);
	color: #fff; display: grid; place-items: center;
	font-size: 28px; font-weight: 700; overflow: hidden;
	box-shadow: 0 8px 20px rgba(42,18,88,.18);
}
.ContactAvatar img { width: 100%; height: 100%; object-fit: cover; }
.ContactCardId { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 10px; }
.ContactCardId h3 { font-size: 22px; font-weight: 700; line-height: 1.15; }
.ContactCardId .mail { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.ContactCardId .nick { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.ContactCardActions { display: flex; gap: 6px; flex: none; }
.ContactRole { display: inline-flex; margin-top: 10px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; color: #fff; }

.ContactStats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	margin: 16px 22px 6px;
	padding: 14px 0;
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
}
.ContactStat .lbl { font-size: 10px; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; text-transform: uppercase; }
.ContactStat .val { font-size: 14px; font-weight: 600; margin-top: 4px; color: var(--ink); word-break: break-word; }

.ContactCardBody {
	padding: 8px 22px 20px;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}
.ContactBlock { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ContactBlock:last-child { border-bottom: none; }
.ContactBlock .blk-label { width: 112px; flex: none; }
.ContactBlock .blk-label h4 { font-size: 13px; font-weight: 600; }
.ContactBlock .blk-label p { font-size: 11px; color: var(--ink-3); margin-top: 2px; line-height: 1.35; }
.ContactBlock .blk-fields { flex: 1; display: flex; flex-wrap: wrap; gap: 10px 18px; align-content: start; }
.cv { min-width: 92px; }
.cv.wide { min-width: 100%; }
.cv .lbl { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.cv .val { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: 2px; line-height: 1.35; }
.ContactPhoneRow {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 10px;
}
.ContactPhoneActions { display: inline-flex; align-items: center; gap: 8px; }
.phone-act {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	flex: none;
	border: 1px solid rgba(20, 16, 40, .08);
	box-shadow: 0 2px 6px rgba(20, 16, 40, .12);
}
.phone-act:hover { transform: translateY(-1px); }
.phone-act-call { background: #E8F7EE; color: #1B7A3D; }
.phone-act-sms { background: #EEE9FE; color: #4E46E8; }
.phone-act-wa { background: #E8F8EE; color: #25D366; }
.ContactPhoneActions.compact { gap: 5px; }
.ContactPhoneActions.compact .phone-act {
	width: 30px;
	height: 30px;
	box-shadow: none;
}
.ContactPhoneActions.compact .phone-act svg { width: 15px; height: 15px; }
.ContactPhoneCell {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 8px;
	min-width: 0;
}
.ContactPhoneCell .ContactPhoneNum { min-width: 0; }
.ContactCardMeta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 10px;
}
html.theme-dark .phone-act { border-color: rgba(255,255,255,.08); }
html.theme-dark .phone-act-call { background: #16382E; color: #7EE0B8; }
html.theme-dark .phone-act-sms { background: #2A2458; color: #C4B8FF; }
html.theme-dark .phone-act-wa { background: #16382E; color: #4AD4A4; }
.ContactCardFoot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 0 22px 18px; }
.ContactReportBtn {
	margin-right: auto;
	background: #128C72;
	color: #fff;
	border: none;
	font-weight: 700;
}
.ContactReportBtn:hover { background: #0E735E; }
.ContactFormHeadActions { display: flex; align-items: center; gap: 6px; }
.ContactDrawer.NewMode .ContactFormSticky { display: none; }
.ContactFormClose {
	position: static;
	background: var(--surface-sunk);
	color: var(--ink-2);
	flex: none;
}
.ContactFormClose:hover { background: #E8EAF2; }

.ContactsModule .ModToolbar {
	align-items: flex-end;
}
.ContactFilterField {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 140px;
	max-width: 200px;
	flex: none;
}
.ContactFilterField span {
	font-size: 11px;
	font-weight: 600;
	color: var(--ink-3);
	line-height: 1.2;
}
.ContactFilterField select {
	width: 100%;
	min-width: 0;
	max-width: none;
}
.ContactSortSwitch {
	display: inline-flex;
	height: 36px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
	overflow: hidden;
}
.ContactSortSwitch .sort-btn {
	width: 36px;
	height: 36px;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--ink-2);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.ContactSortSwitch .sort-btn.on {
	background: var(--brand-strong);
	color: #fff;
}

.ContactListCount {
	font-size: 12px;
	font-weight: 700;
	color: var(--ink-3);
	white-space: nowrap;
	flex: none;
}
.ContactMoreRow {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 10px 0 18px;
}

.ContactsModule .ContactSearchWrap {
	position: relative;
	flex: 0 0 200px;
	width: 200px;
	min-width: 140px;
	max-width: 240px;
}
.ContactsModule .ContactSearch {
	width: 100%;
	max-width: none;
	padding-right: 34px;
}
.ContactSearchClear {
	display: none;
	position: absolute;
	top: 50%;
	right: 4px;
	width: 28px;
	height: 28px;
	margin-top: -14px;
	padding: 0;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: var(--ink-3);
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.ContactSearchClear.on { display: inline-flex; }
.ContactSearchClear:hover { background: var(--surface-hover); color: var(--ink); }
.ContactStatusFilters {
	display: inline-flex;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
	overflow: hidden;
	flex: none;
}
.ContactStatusFilters .status-filter {
	height: 36px;
	padding: 0 12px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--ink-2);
	border: none;
	background: transparent;
	cursor: pointer;
	white-space: nowrap;
}
.ContactStatusFilters .status-filter.on {
	background: var(--brand-strong);
	color: #fff;
}

.FavoriteFilterBtn {
	height: 36px;
	padding: 0 12px;
	border-radius: 10px;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: var(--surface);
	border: 1px solid var(--border);
	color: #B8A56A;
	font-size: 12.5px;
	font-weight: 600;
	flex: none;
}
.FavoriteFilterBtn .fav-ico {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.FavoriteFilterBtn .fav-ico-on { display: none; }
.FavoriteFilterBtn.on {
	background: #FFF6D6;
	border-color: #F0D878;
	color: #C49212;
}
.FavoriteFilterBtn.on .fav-ico-off { display: none; }
.FavoriteFilterBtn.on .fav-ico-on { display: inline-flex; }
html.theme-dark .FavoriteFilterBtn.on {
	background: #3A3010;
	border-color: #C9A227;
	color: #F0C84A;
}
.FavoriteStarBtn {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #C4B48A;
	background: transparent;
	border: 1px solid transparent;
	flex: none;
}
.FavoriteStarBtn:hover {
	background: #FFF8E0;
	border-color: #F0E6C8;
	color: #C49212;
}
.FavoriteStarBtn.on {
	color: #E8B422;
}
.FavoriteStarBtn.on:hover {
	background: #FFF3B0;
	border-color: #E8D070;
}
html.theme-dark .FavoriteStarBtn:hover,
html.theme-dark .FavoriteStarBtn.on:hover {
	background: #3A3010;
	border-color: #C9A227;
	color: #F0C84A;
}
.contact-card-tools {
	display: flex;
	align-items: center;
	gap: 4px;
	flex: none;
}
.contact-favcell {
	display: flex;
	align-items: center;
	justify-content: center;
}
.ContactFavEmpty {
	padding: 18px 8px;
	grid-column: 1 / -1;
}

@media (max-width: 720px) {
	.FavoriteFilterBtn .fav-txt { display: none; }
	.FavoriteFilterBtn { width: 36px; padding: 0; justify-content: center; }
}

@media (max-width: 720px) {
	.ContactsModule .ContactSearchWrap {
		flex: 1 1 140px;
		width: auto;
		max-width: none;
	}
}

.FormHero { margin: 0 -20px 8px; flex: none; }
.FormHero .ContactBanner { border-radius: 16px 16px 0 0; }
.PhotoDrop {
	display: flex; align-items: center; gap: 16px;
	padding: 0 22px 8px; margin-top: -40px; position: relative;
}
.PhotoDrop.on { outline: 2px dashed var(--brand); outline-offset: 6px; border-radius: 16px; }
.FormAvatar {
	width: 86px; height: 86px; border-radius: 50%; flex: none;
	border: 4px solid var(--surface);
	background: linear-gradient(145deg, #A78BFA, #4E46E8);
	color: #fff; display: grid; place-items: center;
	font-size: 26px; font-weight: 700; overflow: hidden;
	box-shadow: 0 8px 20px rgba(42,18,88,.18);
}
.FormAvatar img { width: 100%; height: 100%; object-fit: cover; }
.PhotoHint strong { display: block; font-size: 14px; }
.PhotoHint p { font-size: 12px; color: var(--ink-3); margin: 4px 0 8px; }
.PhotoBtns { display: flex; flex-wrap: wrap; gap: 6px; }
.PhotoFile, .PhotoCamera { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.HeroNames { display: flex; flex-wrap: wrap; gap: 10px 12px; padding: 8px 22px 12px; }

.ff label { display: block; font-size: 11px; color: var(--ink-3); font-weight: 500; margin-bottom: 4px; }
.ff input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):not([type="hidden"]),
.ff select, .ff textarea {
	width: 100%; height: 38px; padding: 0 10px;
	border: 1px solid var(--border); border-radius: 10px;
	background: var(--surface-sunk);
}
.ff textarea { height: 72px; padding: 8px 10px; resize: vertical; }
.ff.is-req label::after { content: " *"; color: var(--risk); }
.ff.is-need input { border-color: var(--risk); background: var(--risk-tint); }
.ff .FieldNeed {
	display: none;
	margin: 4px 0 0;
	font-size: 11px;
	font-weight: 600;
	color: var(--risk-ink);
	line-height: 1.3;
}
.ff.is-need .FieldNeed { display: block; }
.ff.w-xs { width: 88px; }
.ff.w-sm { width: 124px; }
.ff.w-md { width: 188px; }
.ff.w-lg { width: 260px; }
.ff.w-xl { width: 100%; min-width: 200px; }
.SwitchLine {
	display: inline-flex; align-items: center; gap: 8px;
	margin-top: 18px; font-size: 13px; font-weight: 600; color: var(--ink-2);
	cursor: pointer; user-select: none;
}
.SwitchLine input { width: 18px; height: 18px; accent-color: var(--brand-strong); }

@media (max-width: 900px) {
	.ContactPhoneActions { display: inline-flex; }
	.contact-row .ContactPhoneNum { display: none; }
}

@media (max-width: 560px) {
	.ContactStats { grid-template-columns: 1fr 1fr; }
	.ContactBlock { flex-direction: column; gap: 8px; }
	.ContactBlock .blk-label { width: auto; }
}
