/* arsv 담당 전용 CSS — 클래스는 .arsv- 접두어만 씁니다. 색·간격은 base.css 토큰(var(--…))만. */

/* ── 공통 ─────────────────────────── */
.arsv-h { font-size: var(--fs-lg); display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; }
.arsv-count b { color: var(--ink); }
.arsv-title { font-size: var(--fs-h4); line-height: 1.35; }
.arsv-head { align-items: flex-start; margin-top: var(--sp-2); }
.arsv-meta { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-2); }
.arsv-sub { display: block; font-size: var(--fs-xs); color: var(--ink-3); font-weight: 500; margin-top: 2px; }
.arsv-danger { color: var(--danger); font-weight: 600; }
.arsv-kv { grid-template-columns: 7.5rem 1fr; }
.arsv-kv dd { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .arsv-kv { grid-template-columns: 1fr; } }

/* 요약 숫자 */
.arsv-stats { grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }
.arsv-stat-warm { background: var(--warm-soft); border-color: var(--warm-soft); }
.arsv-stat-warm .k, .arsv-stat-warm .v { color: var(--warm-ink); }
.arsv-stat-danger { background: var(--danger-soft); border-color: var(--danger-soft); }
.arsv-stat-danger .k { color: var(--danger); }
.arsv-stat-v { font-size: var(--fs-lg); font-weight: 800; margin-top: 6px; }

/* 필터 */
.arsv-filter { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-4); }
.arsv-chips .chip { min-height: 2.75rem; }
.arsv-chip-n { display: inline-block; min-width: 1.5rem; padding: 0 .4rem; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-xs); text-align: center; }
.arsv-chips .chip[aria-current="page"] .arsv-chip-n { background: var(--surface); color: var(--accent-ink); }
.arsv-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-4); align-items: end; }
.arsv-filter-grid .field > label { font-size: var(--fs-sm); }
.arsv-filter-grid .input, .arsv-filter-grid .select { min-height: 2.75rem; }
.arsv-span-2 { grid-column: span 2; }
.arsv-filter-actions { grid-column: span 2; justify-content: flex-end; }
.arsv-sort { display: flex; align-items: center; gap: var(--sp-2); }
.arsv-sort .select { min-height: 2.75rem; width: auto; }
@media (max-width: 1000px) { .arsv-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .arsv-filter-grid { grid-template-columns: 1fr; }
  .arsv-span-2, .arsv-filter-actions { grid-column: auto; }
  .arsv-filter-actions .btn { flex: 1; }
}

/* 표 → 좁은 화면은 카드 */
.arsv-table { min-width: 0; width: 100%; }
.arsv-table td { font-size: var(--fs-sm); }
.arsv-table th, .arsv-table td { padding-left: .625rem; padding-right: .625rem; }
.arsv-table td.num, .arsv-table .arsv-nw { white-space: nowrap; text-align: left; }
.arsv-table .arsv-sub { white-space: nowrap; }
.arsv-table .badge { white-space: nowrap; }
.arsv-row-new td:first-child { box-shadow: inset 4px 0 0 var(--warm); }
.arsv-actions { white-space: normal; min-width: 8.5rem; }
.arsv-actions .btn { margin: 2px 0; }
.arsv-table td[data-label="진료 항목"] { min-width: 6.5rem; }
.arsv-actions .btn { min-height: 2.25rem; padding: 0 .625rem; }
.arsv-status-link { display: inline-flex; align-items: center; gap: 2px; border-radius: var(--r-pill); color: var(--ink-3); }
.arsv-status-link:hover .badge { box-shadow: 0 0 0 2px var(--line-strong); }
@media (max-width: 1180px) { .arsv-table-wrap { overflow-x: auto; } .arsv-table { min-width: 960px; } }
@media (max-width: 760px) {
  .arsv-table-wrap { border: 0; background: transparent; overflow: visible; }
  .arsv-table { min-width: 0; }
  .arsv-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .arsv-table, .arsv-table tbody, .arsv-table tr, .arsv-table td { display: block; width: 100%; }
  .arsv-table tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); }
  .arsv-table tr.row-new { border-color: var(--warm); }
  .arsv-table td { border: 0; padding: .3rem 0; display: flex; flex-wrap: wrap; gap: 4px var(--sp-2); align-items: baseline; }
  .arsv-table td::before { content: attr(data-label); flex: 0 0 5.5rem; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; }
  .arsv-table td .arsv-sub { display: inline; margin: 0; }
  .arsv-table td:first-child { box-shadow: none; }
  .arsv-table .arsv-hide-m { display: none; }
  .arsv-actions { white-space: normal; }
  .arsv-actions .btn { min-height: var(--tap); margin: 2px 2px 0 0; }
}

/* ── 상세 2단 ─────────────────────── */
.arsv-2col { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: var(--sp-4); align-items: start; }
.arsv-main, .arsv-side { min-width: 0; }
@media (max-width: 1100px) { .arsv-2col { grid-template-columns: 1fr; } }
@media (max-width: 1100px) and (min-width: 0) { .arsv .arsv-2col > .arsv-side .arsv-process { order: -1; } }
.arsv-timeline li { border-bottom: 1px solid var(--line); }
.arsv-timeline li:last-child { border-bottom: 0; }
.arsv-tl-row { display: flex; align-items: flex-start; gap: var(--sp-3); padding: .75rem 1.125rem; color: var(--ink); }
a.arsv-tl-row:hover { background: var(--surface-3); }
.arsv-tl-row.is-wait b { color: var(--warm-ink); }
.arsv-panel-foot { border-top: 1px solid var(--line); padding-top: var(--sp-3); padding-bottom: var(--sp-3); }
.arsv-panel-alert { border-color: var(--danger); }
.arsv-note { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); font-size: var(--fs-sm); }
.arsv-preview { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.arsv-recent { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-2); font-size: var(--fs-sm); }
.arsv-box { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); }
.arsv-big { font-size: 2.25rem; font-weight: 800; line-height: 1.2; color: var(--accent-ink); }
.arsv-big small { font-size: var(--fs-md); color: var(--ink-3); margin-left: 4px; }
.arsv-file { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); overflow-wrap: anywhere; }

/* 처리 상태 고르기(라디오·체크 카드) */
.arsv-status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: var(--sp-2); }
.arsv-status-grid.arsv-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.arsv-status-grid.arsv-3 { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
.arsv-status-grid.arsv-4 { grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); }
.arsv-st, .arsv-st-opt span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: .375rem .625rem; border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-weight: 700; text-align: center; color: var(--ink-2); }
.arsv-st { color: var(--ink-3); background: var(--surface-2); }
.arsv-st.is-on { border-color: var(--ink-3); color: var(--ink); }
.arsv-st-opt { position: relative; cursor: pointer; }
.arsv-st-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.arsv-st-opt span small { display: block; width: 100%; font-weight: 500; font-size: var(--fs-xs); color: var(--ink-3); }
.arsv-ch-opt span { flex-wrap: wrap; }
.arsv-4 .arsv-st-opt span small { display: inline; width: auto; }
.arsv-st-opt:hover span { border-color: var(--line-strong); }
.arsv-st-opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.arsv-st-opt input:focus-visible + span { box-shadow: var(--focus); }
.arsv-quick { padding-bottom: var(--sp-4); border-bottom: 1px solid var(--line); }
.arsv-quick .btn-row { gap: var(--sp-2); }
.arsv-pick { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-sm); max-height: 14rem; overflow-y: auto; }
.arsv-pick a { display: flex; align-items: center; gap: var(--sp-2); padding: .5rem .75rem; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.arsv-pick a:last-child { border-bottom: 0; }
.arsv-pick a:hover { background: var(--surface-3); }
.arsv-pick a[aria-current="true"] { background: var(--accent-soft); font-weight: 700; }
.arsv-dup .check { padding-top: var(--sp-3); }

/* 모달(시트) 화면 */
.arsv-sheet-wrap .sheet-page { padding-top: var(--sp-4); }
.arsv-sheet-wrap .sheet { width: min(620px, 100%); }
.arsv-sheet-wrap .modal-foot { flex-wrap: wrap; padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.arsv-sheet-wrap .modal-foot .btn { flex: 1 1 8rem; }

/* 수정 폼 */
.arsv-fs { min-width: 0; padding: 0; margin-left: 0; margin-right: 0; }
.arsv-fs[disabled] { opacity: .75; }
.arsv-legend { float: left; width: 100%; padding: 1rem 1.125rem; }
.arsv-legend + * { clear: both; }
.arsv-legend-t { display: flex; align-items: center; gap: 8px; font-size: 1.125rem; font-weight: 700; }
.arsv-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
@media (max-width: 640px) { .arsv-form-grid { grid-template-columns: 1fr; } .arsv-form-grid .arsv-span-2 { grid-column: auto; } }
.arsv-form-grid .input-group { flex-wrap: wrap; }
.arsv-form-grid .input-group .select { flex: 1 1 12rem; width: auto; }
.arsv-range { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.arsv-range .input { flex: 1 1 10rem; width: auto; }
.arsv-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0 var(--sp-4); }
