/* =====================================================================
   ui_refresh.css — 디자인 시스템 리프레시 (Stripe/Notion 톤)
   emr_integrations.css 뒤에 로드되어 토큰과 공통 컴포넌트를 덮어쓴다.
   1) 토큰: 중립 회색 팔레트 + 브랜드 파랑 1개 + 상태 4색, 8px 간격, 반경 10/14, 낮은 그림자
   2) 컴포넌트: 버튼·입력·카드·표·배지·페이지 헤더·사이드바·빈 상태·스켈레톤·드로어
   화면별 규칙은 최소화하고 여기서 정의한 컴포넌트만 사용한다.
   ===================================================================== */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f4;
  --border: #e3e6ea;
  --border-soft: #eceef2;
  --border-strong: #cfd4dc;
  --text: #1a1f2e;
  --text-soft: #3c4257;
  --text-primary: #1a1f2e;
  --text-secondary: #6a7185;
  --muted: #6a7185;
  --primary: #3b63f5;
  --primary-soft: #eaf0ff;
  --green: #1f9d61;
  --green-soft: #e8f7ef;
  --amber: #c8811a;
  --amber-soft: #fff6e8;
  --red: #d64545;
  --red-soft: #fdeeee;
  --purple: #7c5cff;
  --console-radius: 14px;
  --console-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .05);
  --shadow-pop: 0 12px 40px rgba(16, 24, 40, .14);
  --sidebar: 224px;
  --topbar: 76px;
  --page-pad-x: 32px;
  --type-page-size: 24px;
  --type-page-line: 32px;
  --type-section-size: 16px;
  --type-section-line: 24px;
  --type-subsection-size: 14px;
  --type-body-size: 14px;
  --type-body-line: 22px;
  --type-label-size: 13px;
  --type-label-line: 20px;
  --type-control-size: 14px;
  --type-helper-size: 12px;
  --type-helper-line: 18px;
  --type-meta-size: 12px;
  --type-table-size: 13px;
  --type-badge-size: 12px;
  --type-eyebrow-size: 11px;
}
:root[data-theme='dark'] {
  --bg: #0f1218;
  --surface: #161a22;
  --surface-2: #1b202a;
  --surface-3: #222836;
  --border: #2a3140;
  --border-soft: #232a38;
  --border-strong: #3a4354;
  --text: #e9edf5;
  --text-soft: #c5ccd9;
  --text-primary: #e9edf5;
  --text-secondary: #98a2b8;
  --muted: #98a2b8;
  --primary: #6d8cff;
  --primary-soft: #1a2647;
  --green: #34c27f;
  --green-soft: #12301f;
  --amber: #e9a33b;
  --amber-soft: #352610;
  --red: #f26d6d;
  --red-soft: #3a1c1c;
  --console-shadow: none;
}

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.integration-detail-page .app-shell { background: var(--bg); }

/* ---------- 페이지 헤더 ---------- */
.topbar { padding: 0 var(--page-pad-x); border-bottom: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); }
.title-block h1 { font-size: var(--type-page-size); font-weight: 650; line-height: var(--type-page-line); letter-spacing: -.02em; }
.header-clock { color: var(--muted); font-size: 13px; }
.user-chip strong { font-size: 13px; }
.user-chip small { font-size: 12px; }
.detail-breadcrumb { font-size: 13px; }
.entity-title-line h1 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }

/* ---------- 사이드바 ---------- */
.sidebar { padding: 20px 14px; border-right: 1px solid var(--border-soft); }
.sidebar-brand { height: 52px; padding: 0 8px 16px; }
.sidebar-brand strong { font-size: 16px; font-weight: 700; }
.sidebar-brand small { font-size: 11px; letter-spacing: .04em; }
.sidebar nav { margin-top: 20px; gap: 2px; }
.nav-item { height: 40px; padding: 0 12px; border-radius: 10px; color: var(--text-soft); font-size: 14px; font-weight: 500; }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active, .integration-detail-page .nav-item.active { color: var(--text); background: var(--surface-3); box-shadow: none; font-weight: 650; }
.integration-detail-page .nav-item.active::before { display: none; }
.nav-item svg, .integration-detail-page .nav-item svg { width: 18px; height: 18px; color: var(--muted); }
.nav-item.active svg { color: var(--primary); }
.nav-group-toggle { height: 40px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--text-soft); }
.nav-children a { border-radius: 8px; font-size: 13px; }
.sidebar-toggle { border-radius: 10px; }

/* ---------- 콘텐츠 영역 ---------- */
.content { padding: 24px var(--page-pad-x) 40px; }
.content.report-content { padding: 24px var(--page-pad-x) 40px !important; }
.console-section, .table-card, .filter-section, .summary-card-grid, .kpi-grid, .status-hero-main, .status-cards,
.registry-card, .dashboard-action-card, .vendor-merge-group, .drawer-rule, .activity-summary-card, .endpoint-card, .contact-card, .issue-quick-card {
  border-color: var(--border); border-radius: var(--console-radius); box-shadow: var(--console-shadow);
}
.console-section + .console-section, .table-card { margin-top: 16px; }
.console-section > header { padding: 18px 22px 14px; border-bottom: 1px solid var(--border-soft); }
.console-section > header h2 { font-size: var(--type-section-size); font-weight: 650; letter-spacing: -.01em; }
.console-section > header p { font-size: var(--type-helper-size); }
.field-grid, .section-field-body, .check-result-layout { padding: 20px 22px; }
.description-list div { min-height: 40px; }
.notice, .error-notice, .inline-alert, .form-alert { border-radius: 12px; font-size: 13px; }

/* ---------- 버튼 ---------- */
.primary-button, .secondary-button, .danger-button, .check-button {
  min-height: 38px; padding: 0 16px; border-radius: 10px; font-size: 13px; font-weight: 600; letter-spacing: -.005em;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.primary-button, .check-button { border-color: var(--primary); background: var(--primary); box-shadow: 0 1px 2px rgba(16, 24, 40, .10); }
.primary-button:hover, .check-button:hover { background: color-mix(in srgb, var(--primary) 88%, #000); border-color: color-mix(in srgb, var(--primary) 88%, #000); }
.primary-button:active { transform: translateY(1px); }
.secondary-button { border-color: var(--border); color: var(--text); background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.secondary-button:hover { background: var(--surface-2); border-color: var(--border-strong); }
.danger-button { border-radius: 10px; }
.text-button { font-size: 13px; font-weight: 600; color: var(--primary); }
.text-button:hover { color: color-mix(in srgb, var(--primary) 80%, #000); text-decoration: underline; }
.text-button.danger-text { color: var(--red); }
.icon-button { border-radius: 10px; background: var(--surface); }
.primary-button.compact, .secondary-button.compact { min-height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.detail-menu-button { min-height: 30px; padding: 0 12px; border-radius: 8px; font-size: 12px; }
.report-content #report-check-submit, .report-content .bg-blue-700 { background: var(--primary) !important; border-color: var(--primary) !important; border-radius: 10px !important; }

/* ---------- 입력 ---------- */
.field input, .field select, .field textarea,
.report-field > input, .report-field > select, .report-date-control > input:first-child,
.registry-form input, .record-dialog input, .record-dialog select, .record-dialog textarea, .select-wrap select,
.hospital-search-input, .search-box, .vendor-search-form input, .vendor-create-form input, .inline-edit-form input,
.access-history-search .date-filter input, .access-history-search .date-filter select {
  border-radius: 10px; border-color: var(--border); background: var(--surface); font-size: 14px;
}
.field input, .field select, .report-field > input, .report-field > select, .report-date-control > input:first-child, .registry-form input, .search-box, .select-wrap select { height: 40px; }
.field input:focus, .field select:focus, .field textarea:focus, .report-field > input:focus, .report-field > select:focus, .report-date-control > input:first-child:focus, .registry-form input:focus, .search-box:focus-within {
  border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent);
}
.field > span, .field-heading > span, .report-field { font-size: var(--type-label-size); font-weight: 600; color: var(--text-soft); }
.field small, .field-heading small { font-size: var(--type-helper-size); line-height: 1.5; }
.report-content label, .report-content button, .report-content input, .report-content select { font-size: 13px !important; }
.report-content input, .report-content select { font-size: 14px !important; }
.report-content p { font-size: 13px !important; }
.report-content h2 { font-size: var(--type-section-size) !important; }
.report-content .rounded-2xl, .report-content > section { border-radius: var(--console-radius) !important; }
.report-field-error { font-size: 12px; }

/* ---------- 표 ---------- */
.operations-table, .integration-table, .report-log-table, .vendor-merge-table, .ip-configuration-table, .access-history-table, .vendor-table { font-size: var(--type-table-size); border-collapse: separate; border-spacing: 0; }
.operations-table thead th, .integration-table th, .report-log-table th, .vendor-merge-table th, .ip-configuration-table th, .access-history-table th {
  height: 44px; padding: 0 14px; color: var(--muted); background: var(--surface); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; border-bottom: 1px solid var(--border);
}
.operations-table td, .integration-table td, .report-log-table td, .vendor-merge-table td, .ip-configuration-table td, .access-history-table td { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); font-size: var(--type-table-size); }
.operations-table tbody tr:hover td, .integration-table tbody tr:hover td, .report-log-table tbody tr:hover td, .access-history-table tbody tr:hover td, .vendor-table tbody tr:hover td { background: var(--surface-2); }
.operations-table tbody tr:last-child td, .report-log-table tbody tr:last-child td { border-bottom: 0; }
.hospital-cell strong { font-size: 14px; font-weight: 650; }
.hospital-cell small, .muted { font-size: 12px; }
.sort-heading { font-size: 12px; }
.table-pagination, .report-pagination { padding: 12px 16px; font-size: 13px; color: var(--muted); }

/* ---------- 배지 ---------- */
.status-pill { min-height: 24px; padding: 2px 10px; border: 0; font-size: var(--type-badge-size); font-weight: 600; line-height: 20px; letter-spacing: -.005em; }
.status-pill i { width: 6px; height: 6px; }
.status-pill.neutral { color: var(--text-soft); background: var(--surface-3); }
.status-pill.compact, .status-secondary .status-pill { min-height: 20px; padding: 0 8px; font-size: 11px; line-height: 18px; }
.status-pill.large { min-height: 32px; padding: 4px 14px; font-size: 14px; }
.status-pill.large i { width: 8px; height: 8px; }
.rule-count-badge, .rule-severity { border-radius: 999px; font-size: 12px; font-weight: 700; }
.rule-count-badge.required, .rule-severity.required { color: #9a4300; background: #fff1dc; border-color: #f3c27a; }
.state-reason { font-size: 12px; }
.tab-count { min-width: 20px; height: 20px; font-size: 11px; }

/* ---------- 요약 카드 (KPI) ---------- */
.summary-card { min-height: 96px; padding: 18px 20px; gap: 14px; }
.summary-card div > span { font-size: 12px; font-weight: 600; letter-spacing: 0; }
.summary-card strong { margin: 6px 0 4px; font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.summary-card small { font-size: 12px; }
.summary-icon { width: 36px; height: 36px; border-radius: 10px; }
.summary-icon svg { width: 18px; height: 18px; }
.summary-card-grid a.summary-card.active, .summary-card.selected { background: var(--surface-2); box-shadow: inset 0 -3px var(--primary); border-color: var(--border); }
.status-card { padding: 16px 18px; }
.status-card strong { font-size: 15px; white-space: normal; line-height: 1.3; }
.status-card small, .status-card span { font-size: 12px; }
.status-hero-main { padding: 20px 24px; }
.status-hero-badges small { font-size: 12px; }
.status-hero-reason { font-size: 13px; }

/* ---------- 필터/검색 ---------- */
.filter-primary, .filter-secondary { min-height: 56px; padding: 10px 16px; gap: 12px; }
.filter-result-row { padding: 10px 16px; font-size: 12px; color: var(--muted); }
.hospital-search-field label, .hospital-search-label { font-size: var(--type-label-size); font-weight: 600; color: var(--text-soft); }
.hospital-autocomplete-menu { border-radius: 12px; box-shadow: var(--shadow-pop); }

/* ---------- 탭 ---------- */
.detail-tabs { background: color-mix(in srgb, var(--bg) 92%, transparent); }
.detail-tabs button { min-height: 48px; padding: 0 16px; font-size: 14px; font-weight: 600; color: var(--muted); }
.detail-tabs button[aria-selected='true'] { color: var(--text); }
.detail-tabs button::after { background: var(--text); }

/* ---------- 드로어 / 다이얼로그 ---------- */
.detail-drawer { border-left: 1px solid var(--border); border-radius: 18px 0 0 18px; box-shadow: var(--shadow-pop); }
.drawer-header h2 { font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.drawer-header p, .drawer-hero-reason { font-size: 13px; }
.drawer-facts dt, .summary-definition dt { font-size: 12px; }
.drawer-facts dd, .summary-definition dd { font-size: 13px; }
.record-dialog, .account-dialog { border-radius: 16px; box-shadow: var(--shadow-pop); }
.record-dialog::backdrop, .account-dialog::backdrop { background: rgba(16, 24, 40, .45); backdrop-filter: blur(2px); }
.sticky-save-bar { border-radius: 14px; box-shadow: var(--shadow-pop); }
.sticky-save-bar strong { font-size: 13px; }
.sticky-save-bar small { font-size: 12px; }
.toast { border-radius: 12px; font-size: 13px; box-shadow: var(--shadow-pop); }

/* ---------- 빈 상태 / 스켈레톤 ---------- */
.compact-empty-state, .console-empty-state, .report-empty-state, .table-empty-content { color: var(--muted); font-size: 13px; }
.compact-empty-state strong, .console-empty-state strong, .report-empty-state strong, .table-empty-content strong { color: var(--text); font-size: 14px; font-weight: 600; }
.compact-empty-line { font-size: 13px; }
.skeleton-lines { display: grid; gap: 10px; width: min(560px, 100%); }
.skeleton-lines i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: skeleton-shimmer 1.4s ease-in-out infinite; }
.skeleton-lines i:nth-child(2) { width: 85%; }
.skeleton-lines i:nth-child(3) { width: 65%; }
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.report-loading-state, .measurement-detail-content[data-loading='1'] { min-height: 120px; padding: 24px; display: grid; justify-items: center; align-content: center; gap: 12px; color: var(--muted); }
.report-loading-state strong { font-size: 13px; }
.report-loading-state p { font-size: 12px !important; }



/* ---------- 환자 측정 이력 ---------- */
.report-workspace .console-section + .console-section { margin-top: 0; }
.report-workspace .console-section > header { padding: 12px 16px 10px; }
.measurement-results-toolbar { padding: 10px 16px; }
.measurement-filter-bar { padding: 0; }
.measurement-filter-label { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.measurement-device-filters button { min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.measurement-device-filters button b { font-weight: 700; }
.measurement-session-tools { padding: 0; }
.measurement-patient-summary h3 { font-size: 16px; font-weight: 650; }
.measurement-patient-summary code { font-size: 12px; }
.measurement-session { border-radius: 12px; border-color: var(--border); }
.measurement-session-times { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.measurement-session-meta span { font-size: 12px; }
.measurement-session-alert { border-radius: 999px; font-size: 12px; font-weight: 600; }
.measurement-device-list-header span { font-size: 12px; font-weight: 600; color: var(--muted); }
.measurement-device-item strong { font-size: 14px; font-weight: 650; }
.measurement-device-item small { font-size: 12px; }
.measurement-long-summary { margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.measurement-long-summary li { font-size: 12px; }
.measurement-detail-panel { border-radius: 12px; }
.measurement-detail-panel h4 { font-size: 14px; font-weight: 650; }

/* ---------- 반응형 ---------- */
@media (max-width: 1024px) { :root { --page-pad-x: 20px; } }
@media (max-width: 900px) { :root { --sidebar: 0px; --page-pad-x: 16px; --topbar: 104px; } .title-block h1 { font-size: 20px; } .summary-card strong { font-size: 22px; } }

/* ---------- 업체 상세 ---------- */
.vendor-overview { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 1.6fr); gap: 0; }
.vendor-overview-main, .vendor-overview-hospitals { padding: 20px 22px; }
.vendor-overview-hospitals { border-left: 1px solid var(--border-soft); }
.vendor-name-form { align-items: flex-end; gap: 10px; }
.vendor-name-form .field { flex: 1; }
.vendor-name-static { display: block; font-size: 16px; font-weight: 650; }
.vendor-meta { margin: 10px 0 0; font-size: 12px; }
.field-label { display: block; margin-bottom: 8px; color: var(--text-soft); font-size: 13px; font-weight: 600; }
.field-label b { color: var(--text); }
.vendor-hospital-list a { border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.vendor-hospital-list a:hover { background: var(--surface-3); }
.rule-collection-actions { display: flex; align-items: center; gap: 12px; }
.rule-collection-summary { color: var(--muted); font-size: 13px; white-space: nowrap; }
.rule-collection-summary b { color: var(--text); font-weight: 700; }
.rule-collection-summary .warning-text { color: var(--amber); }
.operating-rule-list { padding: 16px 22px 22px; }
.operating-rule-card { padding: 18px 20px; border-left-width: 4px; border-radius: 12px; box-shadow: none; }
.operating-rule-card h3 { margin: 10px 0 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.rule-badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rule-type-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.rule-card-actions { display: flex; align-items: center; gap: 12px; }
.rule-card-actions form { display: inline; }
.rule-content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0 0; }
.rule-content-grid.has-follow-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rule-content-grid > div { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.rule-content-grid dt { margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.rule-content-grid dd { margin: 0; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.rule-targets { margin: 12px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.rule-targets a { padding: 2px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: 12px; }
.rule-form-section[hidden] { display: none; }
.operating-rule-form .field-grid { padding: 20px 22px 8px; }
.operating-rule-form .form-actions { padding: 0 22px 20px; display: flex; justify-content: flex-end; gap: 8px; }
.rule-advanced { padding: 0; border: 1px dashed var(--border); border-radius: 10px; }
.rule-advanced > summary { padding: 10px 14px; list-style: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-soft); }
.rule-advanced > summary small { margin-left: 6px; color: var(--muted); font-weight: 500; }
.rule-advanced > summary::-webkit-details-marker { display: none; }
.rule-advanced .field-grid { padding: 4px 14px 14px; }
.hospital-checkbox-field { border-radius: 10px; }
.hospital-checkbox-field legend { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.hospital-checkbox-field label { font-size: 13px; }
.collapsible-section > summary { padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; }
.collapsible-section > summary::-webkit-details-marker { display: none; }
.collapsible-section > summary h2 { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-size: var(--type-section-size); font-weight: 650; }
.collapsible-section[open] > summary { border-bottom: 1px solid var(--border-soft); }
.collapsible-section[open] .rule-alert-more::after { content: ' 접기'; }
.collapsible-section .rule-history-list { padding: 8px 22px 16px; }
.rule-history-list li { padding: 10px 0; font-size: 13px; }
.rule-history-list li small { color: var(--muted); font-size: 12px; }
.vendor-merge-group > footer .field.compact small { color: var(--muted); font-weight: 500; }
@media (max-width: 900px) { .vendor-overview { grid-template-columns: 1fr; } .vendor-overview-hospitals { border-left: 0; border-top: 1px solid var(--border-soft); } .rule-content-grid, .rule-content-grid.has-follow-up { grid-template-columns: 1fr; } }

/* ---------- 병원 상세 개요: 좌우 독립 컬럼 ---------- */
.overview-columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.overview-column { min-width: 0; display: grid; gap: 16px; align-content: start; }
.overview-column .console-section { margin-top: 0; }
.check-facts { margin: 0; padding: 6px 22px 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.check-facts > div { min-height: 42px; display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 8px; border-bottom: 1px solid var(--border-soft); }
.check-facts > div:nth-last-child(-n+2) { border-bottom: 0; }
.check-facts dt { color: var(--muted); font-size: 12px; }
.check-facts dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.check-result-message { margin: 0 22px 18px; }
.http-code { display: inline-flex; align-items: center; gap: 6px; }
.http-code::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.http-code.bad::before { background: var(--red); }
.sys-value { padding: 0 5px; border-radius: 5px; background: var(--surface-3); color: var(--text-soft); font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.value-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.value-tags > span { padding: 1px 9px; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.overview-facts div { grid-template-columns: 88px minmax(0, 1fr); min-height: 38px; }
.overview-facts dd { padding: 6px 0; }
.overview-facts { padding: 6px 22px 12px; }
.compact-timeline { padding: 8px 22px 12px; }
.status-hero-reason:empty { display: none; }
.status-card small { font-size: 12px; color: var(--muted); }
.status-card strong { font-size: 15px; }
.has-save-bar .detail-console { padding-bottom: 104px; }
@media (max-width: 1024px) {
  .overview-columns { grid-template-columns: 1fr; }
  .overview-column { display: contents; }
  .overview-card { order: var(--card-order, 0); }
}
@media (max-width: 720px) {
  .check-facts { grid-template-columns: 1fr; padding: 4px 16px 10px; }
  .check-facts > div:nth-last-child(-n+2) { border-bottom: 1px solid var(--border-soft); }
  .check-facts > div:last-child { border-bottom: 0; }
  .check-result-message { margin: 0 16px 16px; }
  .has-save-bar .detail-console { padding-bottom: 140px; }
}

/* ---------- 운영 규칙 등록 폼: 밀도 ---------- */
.operating-rule-form .field-grid { padding: 16px 20px 6px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
.operating-rule-form .span-full { grid-column: 1 / -1; }
.operating-rule-form .span-half { grid-column: span 2; }
.operating-rule-form .field { gap: 5px; }
.operating-rule-form .field > span { font-size: 12px; }
.operating-rule-form .field small { font-size: 11px; line-height: 1.35; }
.operating-rule-form textarea { min-height: 0; padding: 8px 10px; line-height: 1.5; }
.operating-rule-form .form-actions { padding: 6px 20px 16px; }
/* 적용 범위가 업체 전체일 때 대상 병원 숨김(.field 의 display:grid 가 [hidden] 을 덮어쓰지 않도록) */
.operating-rule-form [hidden] { display: none !important; }
.hospital-checkbox-field { padding: 8px 12px 10px; }
.hospital-checkbox-field legend { font-size: 12px; }
.hospital-checkbox-field > div { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.hospital-checkbox-field label { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; font-size: 13px; }
.hospital-checkbox-field input[type="checkbox"] { width: 15px; height: 15px; margin: 0; flex: none; }
.rule-advanced > summary { padding: 8px 12px; font-size: 12px; }
.rule-advanced .field-grid { padding: 2px 12px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.operating-rule-form .check-option { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 13px; }
.operating-rule-form .check-option input { width: 15px; height: 15px; }
@media (max-width: 1100px) { .operating-rule-form .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .operating-rule-form .span-half { grid-column: 1 / -1; } }
@media (max-width: 640px) { .operating-rule-form .field-grid { grid-template-columns: 1fr; } .rule-advanced .field-grid { grid-template-columns: 1fr; } }

.ssh-host-name { font-family: var(--font-mono); font-size: 12px; font-weight: 600; word-break: break-all; }

/* 병원 검색 라벨 줄의 보조 정보(자동 점검 주기 · 조회 결과) */
.hospital-search-label-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.hospital-search-meta { color: var(--muted); font-size: 12px; font-weight: 500; }
.hospital-search-meta strong { color: var(--primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.dashboard-filters .filter-primary { flex-wrap: wrap; }
.dashboard-filters .batch-connection-check-button { margin-left: 0; }
/* 연결 정보 표: 머리글 줄바꿈 방지 + 열 최소 너비 확보(병동·역할이 두 줄로 접히지 않게) */
.ip-configuration-table { min-width: 660px; }
.ip-configuration-table th { white-space: nowrap; }
.ip-configuration-table th, .ip-configuration-table td { padding: 10px 12px; }
.ip-configuration-table th:nth-child(1), .ip-configuration-table td:nth-child(1) { min-width: 148px; }
.ip-configuration-table th:nth-child(2), .ip-configuration-table td:nth-child(2) { min-width: 112px; }
.ip-configuration-table th:nth-child(3), .ip-configuration-table td:nth-child(3) { min-width: 120px; white-space: nowrap; }
.ip-configuration-table th:nth-child(5), .ip-configuration-table td:nth-child(5) { min-width: 76px; white-space: nowrap; }
.ip-configuration-table td:nth-child(4) code { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 연동 현황 테이블 셀 표기 ----------
   열 너비는 emr_integrations.css의 th[data-column] 규칙 한 곳에서만 정의한다. */
/* ACK 협력은 런타임 상태가 아니라 속성값이므로 상태 배지와 구분한다 */
.ack-value { font-size: var(--type-table-size); font-weight: 600; color: var(--text-soft); white-space: nowrap; }
.ack-value.no { color: var(--amber); }
.ack-value.unknown { color: var(--muted); font-weight: 500; }
.issue-preview { margin-top: 3px; font-size: 12px; }
.operations-table [data-column="issues"] .muted { font-variant-numeric: tabular-nums; }
