/* 동기화 상태 배지·운영 모드 전환
   (admin.css 1360–1495 행에서 분리. CSS 는 순서가 우선순위라 로드 순서를 지켜야 한다) */

/* ---------- 원본 서버 동기화 표시 ---------- */
/* 원본(MSSQL)이 노후 장비라 멈출 수 있다. 멈춘 걸 모르고 옛 자료를 최신으로
   착각하면 진료 일정이 어긋나므로, 상태를 상단에 크게 고정해 둔다. */
.sync-badge {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	margin-right: 14px;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: var(--card);
	white-space: nowrap;
}
.sync-badge .sync-text {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}
.sync-badge strong {
	font-size: 13px;
	font-weight: 800;
}
.sync-badge small {
	font-size: 11px;
	color: var(--muted);
	font-weight: 700;
}
.sync-dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #b9b1ac;
	flex: none;
}

.sync-badge[data-state="on"] {
	border-color: #2e7d54;
	background: rgba(46, 125, 84, 0.08);
}
.sync-badge[data-state="on"] strong { color: #1f6742; }
.sync-badge[data-state="on"] .sync-dot {
	background: #2e9e63;
	box-shadow: 0 0 0 0 rgba(46, 158, 99, 0.7);
	animation: syncPulse 2s infinite;
}
@keyframes syncPulse {
	70%  { box-shadow: 0 0 0 8px rgba(46, 158, 99, 0); }
	100% { box-shadow: 0 0 0 0 rgba(46, 158, 99, 0); }
}

.sync-badge[data-state="off"] {
	border-color: #b3261e;
	background: rgba(179, 38, 30, 0.1);
}
.sync-badge[data-state="off"] strong { color: #8c1d18; }
.sync-badge[data-state="off"] .sync-dot { background: #d93a31; }

.sync-badge[data-state="unknown"] strong { color: var(--muted); }

/* 움직임을 줄이도록 설정한 사용자에게는 깜빡임을 끈다 */
@media (prefers-reduced-motion: reduce) {
	.sync-badge[data-state="on"] .sync-dot { animation: none; }
}

@media (max-width: 1040px) {
	.sync-badge {
		margin-right: 0;
		margin-bottom: 10px;
	}
}

/* 배지를 버튼으로 쓰므로 버튼 기본 스타일을 지운다 */
button.sync-badge {
	font: inherit;
	cursor: pointer;
	text-align: left;
}
button.sync-badge:hover { filter: brightness(0.97); }
button.sync-badge:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* 독립 운영 모드 — 끊김(빨강)과 확실히 구분되는 색 */
.sync-badge[data-state="primary"] {
	border-color: #1d4ed8;
	background: rgba(29, 78, 216, 0.08);
}
.sync-badge[data-state="primary"] strong { color: #1a3fa8; }
.sync-badge[data-state="primary"] .sync-dot { background: #2563eb; }

/* ---------- 운영 모드 전환 화면 ---------- */
.mode-cards {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
	margin: 18px 0;
}
.mode-card {
	border: 1px solid var(--line);
	border-radius: 18px;
	padding: 16px 18px;
	background: var(--card);
	position: relative;
}
.mode-card.current {
	border-color: var(--admin-accent, #7f1f2e);
	box-shadow: 0 0 0 2px rgba(127, 31, 46, 0.14);
}
.mode-card h3 { margin: 0 0 8px; font-size: 15px; }
.mode-card p  { margin: 0 0 8px; font-size: 13px; }
.mode-card ul { margin: 0; padding-left: 18px; }
.mode-card li { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.mode-now {
	position: absolute; top: 12px; right: 12px;
	padding: 2px 9px; border-radius: 999px;
	background: var(--admin-accent, #7f1f2e); color: #fff;
	font-size: 11px; font-weight: 800;
}
.mode-warn {
	border: 1px solid rgba(179, 38, 30, 0.35);
	background: rgba(179, 38, 30, 0.07);
	border-radius: 14px;
	padding: 14px 16px;
	font-size: 13px;
	line-height: 1.7;
}
.mode-warn em { font-style: normal; text-decoration: underline; font-weight: 800; }
.mode-actions {
	display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px;
}
@media (max-width: 680px) {
	.mode-cards { grid-template-columns: 1fr; }
}
.mode-changes { margin: 8px 0 0; padding-left: 18px; }
.mode-changes li { margin-bottom: 4px; }
