/* W91099CH Sync Modules - Frontend */
.w91099ch-sync-wrap { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; max-width: 1200px; margin: 0 auto; padding: 20px 0; }
.w91099ch-sync-header { text-align: center; margin-bottom: 32px; }
.w91099ch-sync-header h2 { font-size: 28px; font-weight: 800; color: #111827; margin: 0 0 8px; }
.w91099ch-sync-header p { color: #6b7280; font-size: 15px; margin: 0; }

.w91099ch-sync-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }

.w91099ch-sync-card {
	background: #fff;
	border-radius: 18px;
	border: 1px solid #e5e7eb;
	box-shadow: 0 8px 30px rgba(17,24,39,.07);
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	position: relative;
	overflow: hidden;
	transition: transform .25s ease, box-shadow .25s ease;
}
.w91099ch-sync-card::before {
	content: '';
	position: absolute;
	left: 0; right: 0; top: 0;
	height: 12px;
	border-radius: 18px 18px 0 0;
	background: var(--accent, #1a56db);
}
.w91099ch-sync-card:hover { transform: translateY(-5px); box-shadow: 0 18px 50px rgba(17,24,39,.12); }

.w91099ch-sync-card-label {
	text-transform: uppercase;
	font-weight: 900;
	font-size: 13px;
	letter-spacing: .1em;
	color: #111827;
	text-align: center;
	padding-top: 6px;
}
.w91099ch-sync-card-label::after {
	content: '';
	display: block;
	height: 2px;
	width: 50px;
	margin: 6px auto 0;
	border-radius: 999px;
	background: var(--accent, #1a56db);
}

.w91099ch-sync-card-head { display: flex; gap: 12px; align-items: flex-start; }
.w91099ch-sync-card-icon {
	width: 46px; height: 46px; flex-shrink: 0;
	border-radius: 12px;
	background: rgba(0,0,0,.06);
	display: flex; align-items: center; justify-content: center;
	font-size: 20px;
	color: var(--accent, #1a56db);
}
.w91099ch-sync-card-head h3 { font-size: 14px; font-weight: 800; color: #111827; margin: 0 0 4px; }
.w91099ch-sync-card-head p { font-size: 12px; color: #6b7280; margin: 0; }

.w91099ch-sync-groups { display: flex; flex-direction: column; gap: 10px; }
.w91099ch-sync-group { border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; padding: 10px; }
.w91099ch-sync-group h4 { font-size: 12px; font-weight: 800; color: #111827; margin: 0 0 8px; }
.w91099ch-sync-options { display: flex; flex-direction: column; gap: 6px; }
.w91099ch-sync-option {
	display: flex; align-items: flex-start; gap: 8px;
	padding: 6px 8px; border-radius: 8px;
	background: #f9fafb; border: 1px solid transparent;
	cursor: pointer; font-size: 13px; color: #374151;
	transition: opacity .18s ease, background .18s ease;
}
.w91099ch-sync-option input { margin-top: 2px; flex-shrink: 0; accent-color: var(--accent, #1a56db); }
.w91099ch-sync-option.is-excluded { opacity: .45; color: #9ca3af; background: #f3f4f6; }
.w91099ch-sync-option:not(.is-excluded) { border-color: rgba(0,0,0,.08); background: rgba(0,0,0,.025); }

.w91099ch-sync-payload-box { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px; }
.w91099ch-sync-payload-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; font-weight: 800; color: #111827; }
.w91099ch-sync-payload-count { font-size: 11px; font-weight: 800; color: var(--accent, #1a56db); background: rgba(0,0,0,.05); border: 1px solid rgba(0,0,0,.08); border-radius: 999px; padding: 3px 8px; }
.w91099ch-sync-payload-pre { margin: 0; padding: 10px; background: #111827; color: #e5e7eb; border-radius: 8px; font-size: 11px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 160px; overflow: auto; }

.w91099ch-sync-footer { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.w91099ch-sync-consent-wrap { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #374151; }
.w91099ch-sync-consent-wrap input { margin-top: 3px; accent-color: #1a56db; flex-shrink: 0; }
.w91099ch-sync-consent-wrap strong { display: block; font-size: 13px; color: #111827; margin-bottom: 2px; }

.w91099ch-sync-btn {
	width: 100%; padding: 11px;
	background: linear-gradient(135deg, var(--accent, #1a56db), #1e429f);
	color: #fff; border: none; border-radius: 12px;
	font-size: 14px; font-weight: 700; cursor: pointer;
	display: flex; align-items: center; justify-content: center; gap: 8px;
	transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
	box-shadow: 0 8px 20px rgba(0,0,0,.15);
}
.w91099ch-sync-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.2); }
.w91099ch-sync-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.w91099ch-sync-status { text-align: center; font-size: 12px; font-weight: 700; color: #6b7280; min-height: 16px; }
.w91099ch-sync-status.is-loading { color: #1a56db; }
.w91099ch-sync-status.is-success { color: #059669; }
.w91099ch-sync-status.is-error   { color: #dc2626; }

/* Modal */
.w91099ch-modal-overlay {
	position: fixed; inset: 0; z-index: 99999;
	background: rgba(17,24,39,.65); backdrop-filter: blur(4px);
	display: flex; align-items: center; justify-content: center; padding: 20px;
}
.w91099ch-modal {
	background: #fff; border-radius: 16px;
	width: min(660px, 96vw); max-height: 90vh;
	overflow: hidden; display: flex; flex-direction: column;
	box-shadow: 0 28px 80px rgba(17,24,39,.3);
}
.w91099ch-modal-head {
	display: flex; gap: 14px; align-items: flex-start;
	padding: 22px 24px; color: #fff;
	background: linear-gradient(135deg, #1a56db, #1e429f);
}
.w91099ch-modal-head i { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.w91099ch-modal-head h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; color: #fff; }
.w91099ch-modal-head p { margin: 0; font-size: 13px; color: rgba(255,255,255,.88); }
.w91099ch-modal-body { padding: 18px 24px; overflow: auto; }
.w91099ch-modal-note { margin-bottom: 12px; padding: 10px 12px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; font-size: 13px; font-weight: 700; color: #1e40af; }
.w91099ch-modal-payload { margin: 0; max-height: 300px; overflow: auto; padding: 14px; background: #111827; color: #e5e7eb; border-radius: 10px; font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.w91099ch-modal-actions { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid #e5e7eb; background: #f8fafc; }
.w91099ch-btn-cancel { padding: 10px 20px; background: #fff; color: #374151; border: 1px solid #d1d5db; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.w91099ch-btn-cancel:hover { background: #f9fafb; }
.w91099ch-btn-ok { padding: 10px 24px; background: #1a56db; color: #fff; border: none; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.w91099ch-btn-ok:hover { background: #1e429f; }

.w91099ch-sync-group-head {
	display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 0;
}
.w91099ch-sync-group-toggle {
	display: flex; align-items: center; gap: 8px; flex: 1; cursor: pointer;
	font-size: 12px; font-weight: 800; color: #111827;
}
.w91099ch-sync-group-toggle input { accent-color: var(--accent, #1a56db); flex-shrink: 0; }
.w91099ch-sync-group-toggle.is-excluded { opacity: .5; color: #9ca3af; }
.w91099ch-sync-group-expand {
	width: 26px; height: 26px; flex-shrink: 0;
	border: none; background: #f3f4f6; border-radius: 6px;
	cursor: pointer; display: flex; align-items: center; justify-content: center;
	color: #6b7280; font-size: 12px;
	transition: transform .18s ease, background .18s ease;
}
.w91099ch-sync-group-expand:hover { background: #e5e7eb; }
.w91099ch-sync-group-body { display: block; transition: all .2s ease; }
.w91099ch-sync-group-body.is-collapsed { display: none; }
.w91099ch-sync-group-expand.is-collapsed i { transform: rotate(180deg); }

@media (max-width: 640px) {
	.w91099ch-sync-grid { grid-template-columns: 1fr; }
	.w91099ch-modal-actions { flex-direction: column-reverse; }
	.w91099ch-btn-cancel, .w91099ch-btn-ok { width: 100%; justify-content: center; }
}
