/* ================================================================ 의뢰 서비스 (site.css 다음에 로드) */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-title { margin: 0; font-size: 28px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
.page-sub { margin: 4px 0 0; color: var(--ink-2); }
.back { display: inline-flex; gap: 6px; margin-bottom: 16px; color: var(--ink-2); text-decoration: none; font-size: 15px; }
.back:hover { color: var(--ink); }

.is-admin .client-only { display: none !important; }
body:not(.is-admin) .admin-only { display: none !important; }

/* 상태 표시 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--resin); color: var(--ink-2); }
.badge--wait { background: #e9f1fb; color: #1b4f8a; }
.badge--work { background: #e3effc; color: #0b4f96; }
.badge--ask { background: #fff1d6; color: #7a4600; }
.badge--done { background: #e6f5ee; color: var(--ok); }
.badge--off { background: #f1f3f6; color: var(--ink-3); }

/* 목록 */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.filters button { border: 1px solid var(--line); background: var(--white); color: var(--ink-2); border-radius: 999px; padding: 5px 12px; font-size: 14px; font-weight: 500; cursor: pointer; }
.filters button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); background: var(--resin); }
.filters b { margin-left: 4px; color: var(--ink); }
.orders { width: 100%; border-collapse: collapse; font-size: 15px; }
.orders th { text-align: left; font-weight: 600; font-size: 14px; color: var(--ink-3); padding: 0 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.orders td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.orders tbody tr { cursor: pointer; }
.orders tbody tr:hover td { background: #f8fafc; }
.orders .no { font-weight: 600; white-space: nowrap; }
.orders .no a { color: var(--ink); text-decoration: none; }
.orders .muted { color: var(--ink-3); font-size: 14px; }

/* 의뢰서 */
.form { max-width: 780px; }
.fsec { padding: 32px 0; border-top: 1px solid var(--line); }
.fsec:first-of-type { border-top: 0; padding-top: 8px; }
.fsec h2 { margin: 0 0 4px; font-size: 20px; }
.fsec > .hint { margin: 0 0 20px; }
.hint { font-size: 14px; color: var(--ink-3); margin: 6px 0 0; word-break: keep-all; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.f { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.f > label, .f > .label, .f legend { font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 0; }
.f .opt { font-weight: 400; color: var(--ink-3); }
.f input[type=text], .f input[type=tel], .f input[type=date], .f select, .f textarea {
  min-height: 44px; padding: 0 12px; border: 1px solid #c6d2e0; border-radius: var(--radius-s); background: var(--white); color: var(--ink); font-size: 16px; width: 100%;
}
.f textarea { padding: 10px 12px; min-height: 96px; resize: vertical; line-height: 1.6; }
.f input:focus, .f select:focus, .f textarea:focus { outline: none; border-color: var(--blue-text); box-shadow: 0 0 0 3px rgba(0,104,201,.18); }
.f [aria-invalid="true"] { border-color: var(--danger); }
fieldset.f { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.seg-choice { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-choice label { flex: 1; min-width: 120px; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid #c6d2e0; border-radius: var(--radius-s); cursor: pointer; font-weight: 500; color: var(--ink); }
.seg-choice input { accent-color: var(--blue-text); }
.seg-choice label:has(input:checked) { border-color: var(--blue-text); background: #eef5fd; }
.seg-choice small { color: var(--ink-3); font-weight: 400; }

/* 치식 차트 */
.chart { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--resin); }
.chart__row { display: grid; grid-template-columns: repeat(8, 1fr) 14px repeat(8, 1fr); gap: 4px; align-items: center; }
.chart__row[data-off="true"] { opacity: .38; }
.chart__mid { width: 1px; height: 26px; background: #b7c3d2; justify-self: center; }
.chart__jaw { font-size: 13px; color: var(--ink-3); margin: 0 0 -2px; }
.tooth { min-height: 38px; border: 1px solid #c6d2e0; border-radius: 6px; background: var(--white); color: var(--ink-2); font-size: 14px; font-weight: 600; cursor: pointer; padding: 0; }
.tooth:hover:not(:disabled) { border-color: var(--blue-text); color: var(--ink); }
.tooth[aria-pressed="true"] { background: var(--blue-text); border-color: var(--blue-text); color: var(--white); }
.tooth:disabled { cursor: not-allowed; }
.sizes { margin-top: 12px; display: grid; gap: 8px; }
.sizes__row { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; }
.sizes__row b { font-size: 15px; }
.sizes__row input { min-height: 40px; padding: 0 12px; border: 1px solid #c6d2e0; border-radius: var(--radius-s); font-size: 15px; }

/* 파일 올리기 */
.drop { display: grid; gap: 10px; justify-items: start; padding: 20px; border: 1.5px dashed #b7c3d2; border-radius: var(--radius-m); background: var(--white); }
.drop.is-over { border-color: var(--blue-text); background: #eef5fd; }
.drop__title { font-weight: 600; }
.drop__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.drop input[type=file] { display: none; }
.uploads { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.up { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--white); font-size: 15px; }
.up__name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.up__name a { color: var(--ink); }
.up__meta { color: var(--ink-3); font-size: 14px; white-space: nowrap; }
.up__bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--resin); overflow: hidden; }
.up__bar i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.up--error { border-color: #f0b8bb; background: #fdf6f6; }
.up--error .up__meta { color: var(--danger); }

/* 하단 동작 막대 */
.actionbar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 14px 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(4px); }
.actionbar__state { font-size: 14px; color: var(--ink-3); }
.actionbar__btns { display: flex; gap: 8px; }
.problems { margin: 0 0 16px; padding: 12px 16px; border-left: 3px solid var(--warn); background: #fdf6ea; color: #7a4600; border-radius: var(--radius-s); font-size: 15px; }
.problems ul { margin: 4px 0 0; padding-left: 20px; }

/* 의뢰 상세 */
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.detail-head h1 { margin: 0; font-size: 28px; letter-spacing: -.01em; }
.detail-head p { margin: 4px 0 0; color: var(--ink-2); }
.track { list-style: none; margin: 28px 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); counter-reset: step; }
.track li { position: relative; padding-top: 30px; font-size: 14px; color: var(--ink-3); text-align: center; }
.track li::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--white); border: 1.5px solid #c6d2e0; color: var(--ink-3); z-index: 1; }
.track li::after { content: ""; position: absolute; top: 11px; left: calc(-50% + 14px); right: calc(50% + 14px); height: 2px; background: #d8e0ea; }
.track li:first-child::after { display: none; }
.track li.is-done { color: var(--ink-2); }
.track li.is-done::before { background: var(--blue-text); border-color: var(--blue-text); color: var(--white); content: "\2713"; }
.track li.is-done::after, .track li.is-now::after { background: var(--blue-text); }
.track li.is-now { color: var(--ink); font-weight: 600; }
.track li.is-now::before { border-color: var(--blue-text); color: var(--blue-text); box-shadow: 0 0 0 4px rgba(0,104,201,.14); }
.track.is-off { opacity: .5; }

.callout { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 18px 20px; border-radius: var(--radius-m); background: #eef5fd; border: 1px solid #cfe1f6; margin-bottom: 28px; }
.callout--ask { background: #fff7e8; border-color: #f3dcae; }
.callout p { margin: 0; max-width: 60ch; word-break: keep-all; }
.callout strong { display: block; margin-bottom: 2px; }
.callout__btns { display: flex; gap: 8px; flex-wrap: wrap; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.panel h2 { margin: 0 0 14px; font-size: 18px; }
.panel + .panel { margin-top: 36px; }
.summary { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; margin: 0; font-size: 15px; }
.summary dt { color: var(--ink-3); }
.summary dd { margin: 0; word-break: keep-all; }
.files-group { margin-bottom: 18px; }
.files-group h3 { margin: 0 0 8px; font-size: 15px; color: var(--ink-2); font-weight: 600; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ev { display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: 15px; }
.ev__dot { width: 28px; height: 28px; border-radius: 50%; background: var(--resin); display: grid; place-items: center; font-size: 13px; color: var(--ink-3); }
.ev--admin .ev__dot { background: #e3effc; color: var(--blue-deep); }
.ev__head { color: var(--ink-3); font-size: 13px; }
.ev__head b { color: var(--ink); font-weight: 600; margin-right: 6px; }
.ev__body { margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.ev--message .ev__body { padding: 10px 12px; border-radius: var(--radius-s); background: var(--resin); }
.ev--admin.ev--message .ev__body { background: #eef5fd; }
.composer { margin-top: 18px; display: grid; gap: 8px; }
.composer textarea { min-height: 84px; padding: 10px 12px; border: 1px solid #c6d2e0; border-radius: var(--radius-s); font-size: 15px; resize: vertical; }
.composer div { display: flex; justify-content: flex-end; }

.adminbox { margin-top: 36px; padding: 20px; border: 1px solid #cfe1f6; border-radius: var(--radius-m); background: #f7fbff; }
.adminbox h2 { margin: 0 0 14px; font-size: 18px; }

@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; gap: 28px; }
  .grid-2 { grid-template-columns: 1fr; }
  .track { grid-template-columns: repeat(3, 1fr); row-gap: 16px; }
  .track li:nth-child(4)::after { display: none; }
  .chart { padding: 10px; }
  .chart__row { gap: 2px; grid-template-columns: repeat(8, 1fr) 8px repeat(8, 1fr); }
  .tooth { min-height: 34px; font-size: 12px; }
  .orders .col-hide { display: none; }
  .summary { grid-template-columns: 1fr; gap: 2px; }
  .summary dd { margin-bottom: 8px; }
  .actionbar { flex-direction: column; align-items: stretch; }
  .actionbar__btns .btn { flex: 1; }
}

/* ================================================================ 확인 창 */
.dlg { width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: var(--radius-m); box-shadow: 0 24px 64px rgba(16, 32, 56, .28); color: var(--ink); background: var(--white); }
.dlg::backdrop { background: rgba(16, 28, 44, .48); }
.dlg__form { padding: 24px; display: grid; gap: 14px; }
.dlg__title { margin: 0; font-size: 19px; line-height: 1.4; }
.dlg--danger .dlg__title { color: var(--danger); }
.dlg--danger { border-top: 4px solid var(--danger); }
.dlg__body { font-size: 15px; color: var(--ink-2); word-break: keep-all; }
.dlg__body > p, .dlg__desc { margin: 0 0 10px; }
.dlg__body .f { margin: 12px 0 0; }
.dlg__file { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--resin); }
.dlg__file b { color: var(--ink); word-break: break-all; }
.dlg__file span { font-size: 14px; color: var(--ink-3); }
.dlg__warn { padding: 10px 12px; border-left: 3px solid var(--warn); background: #fdf6ea; color: #7a4600; border-radius: var(--radius-s); }
.dlg__list { margin: 8px 0 0; padding-left: 20px; }
.dlg__list span { color: var(--ink-3); font-size: 14px; }
.dlg__err { margin: 0; color: var(--danger); font-size: 14px; font-weight: 500; }
.dlg__btns { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; padding: 12px 14px; border: 1px solid #c6d2e0; border-radius: var(--radius-s); color: var(--ink); font-weight: 500; cursor: pointer; }
.check input { margin-top: 5px; accent-color: var(--blue-text); width: 16px; height: 16px; }
.check:has(input:checked) { border-color: var(--blue-text); background: #eef5fd; }
.btn--danger-solid { background: var(--danger); border-color: var(--danger); color: var(--white); }
.btn--danger-solid:hover { background: #9f1c22; border-color: #9f1c22; }
.btn[aria-disabled="true"] { opacity: .55; }
@media (max-width: 560px) { .dlg__btns .btn { flex: 1; } }

/* 처음 화면 · 치과 정보 */
.page--narrow { max-width: 820px; }
.eyebrow { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--blue-text); }
.addr { display: grid; gap: 8px; }
.addr__row { display: flex; gap: 8px; align-items: center; }
.addr__row input { max-width: 160px; }
.addr input { min-height: 44px; padding: 0 12px; border: 1px solid #c6d2e0; border-radius: var(--radius-s); background: var(--white); font-size: 16px; }
.addr input:focus { outline: none; border-color: var(--blue-text); box-shadow: 0 0 0 3px rgba(0,104,201,.18); }
.f input[type=email] { min-height: 44px; padding: 0 12px; border: 1px solid #c6d2e0; border-radius: var(--radius-s); background: var(--white); font-size: 16px; }
.f input[type=email]:focus { outline: none; border-color: var(--blue-text); box-shadow: 0 0 0 3px rgba(0,104,201,.18); }
.addr [aria-invalid="true"], .f input[type=email][aria-invalid="true"] { border-color: var(--danger); }
.btn-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.clinic-card { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding: 16px 18px; margin: 12px 0 20px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--resin); }
.clinic-card dl { display: grid; grid-template-columns: 64px 1fr; gap: 4px 12px; margin: 0; font-size: 15px; }
.clinic-card dt { color: var(--ink-3); }
.clinic-card dd { margin: 0; word-break: keep-all; }

/* 의뢰 상세: 지금 할 일 · 설계안 차수 */
.callout__text { display: grid; gap: 10px; min-width: 0; flex: 1 1 320px; }
.callout__files { display: flex; gap: 6px; flex-wrap: wrap; }
.quote { margin: 4px 0 0; padding: 10px 12px; border-left: 3px solid #b7c3d2; background: rgba(255,255,255,.7); border-radius: var(--radius-s); white-space: pre-wrap; word-break: break-word; font-size: 15px; }
.quote b { display: block; font-size: 13px; color: var(--ink-3); font-weight: 600; margin-bottom: 2px; }
.round { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-m); margin-bottom: 12px; }
.round--current { border-color: #f3dcae; background: #fffcf5; }
.round--pending { border-style: dashed; border-color: #9fbbe0; background: #f7fbff; }
.round__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.round__head b { font-size: 16px; }
.round__head .hint { margin: 0 0 0 auto; }
.round .uploads { margin-bottom: 0; }
.round .drop { margin-top: 10px; }
.round__send { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.round__send .hint { margin: 0; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e3effc; color: var(--blue-deep); }
.ship { margin: 0 0 10px; padding: 10px 12px; border-radius: var(--radius-s); background: #eef8f3; color: #0b5c40; }
.track small { font-weight: 400; color: var(--ink-3); }
.ev--removed .ev__head { text-decoration: none; }
.ev--removed .ev__dot { background: #fdf2f2; color: var(--danger); }
.panel .drop { margin-top: 10px; }

/* 원본 자료 보관 안내 */
.retention { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--resin); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.retention p { margin: 0; flex: 1 1 300px; word-break: keep-all; }
.retention b { color: var(--ink); }
.retention--soon { background: #fdf6ea; border-color: #f3dcae; color: #7a4600; }
.retention__btns { display: flex; gap: 6px; flex-wrap: wrap; }
.up--purged { background: var(--resin); border-style: dashed; }
.up--purged .up__name { color: var(--ink-3); text-decoration: line-through; }

/* 설계 문의 (관리자) */
.inq { padding: 22px 0; border-top: 1px solid var(--line); }
.inq:last-child { border-bottom: 1px solid var(--line); }
.inq__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.inq__head h2 { margin: 0; font-size: 18px; }
.inq__head h2 span { font-weight: 500; color: var(--ink-3); font-size: 15px; }
.inq__head time { margin: 0 0 0 auto; }
.inq .btn-row { margin-top: 14px; }

/* 전화·이메일 접수 (관리자 대리 의뢰) */
.picker { max-width: 780px; }
.picker__search { display: flex; gap: 8px; margin-bottom: 14px; }
.picker__search input { flex: 1; min-height: 44px; padding: 0 12px; border: 1px solid #c6d2e0; border-radius: var(--radius-s); font-size: 16px; }
.picker__search input:focus { outline: none; border-color: var(--blue-text); box-shadow: 0 0 0 3px rgba(0,104,201,.18); }
.picker__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.picker__list li { border-bottom: 1px solid var(--line); }
.picker__list button { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; width: 100%; padding: 14px 12px; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.picker__list button:hover, .picker__list button:focus-visible { background: #f3f8fe; }
.picker__list b { font-size: 16px; }
.picker__list span { color: var(--ink-3); font-size: 14px; }
.picker__list .tag { grid-row: 1 / 3; grid-column: 2; align-self: center; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef2f7; color: var(--ink-2); white-space: nowrap; }
.tag--offline { background: #fff1d6; color: #7a4600; }
.proxybar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius-m); background: #fff7e8; border: 1px solid #f3dcae; font-size: 15px; }
.proxybar select { min-height: 36px; padding: 0 10px; border: 1px solid #c6d2e0; border-radius: var(--radius-s); background: #fff; font: inherit; }
.proxybar b { font-weight: 600; }

.detail-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.callout__who { font-size: 13px; font-weight: 600; color: #7a4600; }

/* ================================================================ 휴대폰 */
@media (max-width: 760px) {
  /* 의뢰 목록: 표 대신 한 건씩 쌓인 목록 (번호·상태가 위, 치과·환자가 아래) */
  .orders thead { display: none; }
  .orders, .orders tbody { display: block; }
  .orders tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
  .orders td { display: block; grid-column: 1; padding: 0; border: 0; }
  .orders td.st { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
  .orders td.no a { font-size: 16px; }
  .orders tbody tr:hover td { background: none; }
  .orders tbody tr:active { background: #f3f8fe; }
  /* 파일: 이름을 한 줄 다 쓰고 크기·날짜는 아래 줄로 */
  .up { grid-template-columns: minmax(0, 1fr) auto; }
  .up__name { white-space: normal; word-break: break-all; }
  .up__meta { grid-column: 1; grid-row: 2; white-space: normal; }
  .up > .btn, .up > span:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .up .btn--small { min-height: 40px; }
  .back { min-height: 40px; align-items: center; }
  .callout__btns .btn { flex: 1 1 auto; }
  .detail-head h1 { font-size: 24px; }
  .round__head .hint { margin-left: 0; flex-basis: 100%; }
}

/* ================================================================ 정산 (관리자) */
.page--wide { max-width: 1180px; }
.tabs { display: flex; gap: 4px; margin: -8px 0 28px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px; }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--blue-text); }
.monthbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.monthbar input { min-height: 36px; padding: 0 10px; border: 1px solid #c6d2e0; border-radius: var(--radius-s); font: inherit; }
.monthbar .hint { margin: 0 0 0 8px; }
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0 0 28px; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; background: var(--line); }
.figures div { padding: 14px 16px; background: #fff; }
.figures dt { font-size: 13px; color: var(--ink-3); }
.figures dd { margin: 2px 0 0; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.is-due { color: #b0321f; }
.ledger { width: 100%; border-collapse: collapse; font-size: 15px; }
.ledger th { text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-3); padding: 0 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ledger td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger small { display: block; color: var(--ink-3); font-size: 13px; }
.ledger .acts { text-align: right; white-space: nowrap; }
.ledger .acts .btn + .btn { margin-left: 6px; }
.ledger__who { font-weight: 600; color: var(--ink); margin-right: 6px; }
.stmt { display: inline-flex; gap: 6px; align-items: center; margin: 0 8px 4px 0; color: var(--ink); font-size: 14px; }
.ledger--edit input[type=text], .ledger--edit select { width: 100%; min-height: 36px; padding: 0 8px; border: 1px solid #c6d2e0; border-radius: var(--radius-s); font: inherit; font-size: 14px; background: #fff; }
.ledger--edit input.num { text-align: right; }
.ledger--edit td { vertical-align: middle; }
.switch { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; white-space: nowrap; }
.feegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.feegrid label { display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.feegrid small { color: var(--ink-3); }
.feegrid input { min-height: 40px; padding: 0 10px; border: 1px solid #c6d2e0; border-radius: var(--radius-s); font: inherit; text-align: right; }
.panel__note { margin-left: 6px; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.charges { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.charges li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.charges__name small { display: block; color: var(--ink-3); font-size: 13px; }
.charges__calc { color: var(--ink-3); font-size: 14px; font-variant-numeric: tabular-nums; }
.charges__amt { font-variant-numeric: tabular-nums; }
.charges__acts, .charges li > .tag { grid-column: 1 / -1; justify-self: start; }
.charges__sum { margin: 10px 0 0; text-align: right; }
@media (max-width: 760px) {
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures dd { font-size: 18px; }
  .ledger thead { display: none; }
  .ledger, .ledger tbody, .ledger tr, .ledger td { display: block; }
  .ledger tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .ledger td { border: 0; padding: 2px 0; }
  .ledger td[data-label] { display: flex; justify-content: space-between; gap: 12px; }
  .ledger td[data-label]::before { content: attr(data-label); color: var(--ink-3); font-size: 13px; font-weight: 400; }
  .ledger .num { text-align: right; }
  .ledger .acts { text-align: left; padding-top: 8px; }
  .ledger--edit tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .ledger--edit td:first-child { grid-column: 1 / -1; }
}

/* ================================================================ 거래명세서 (A4 인쇄) */
.page--doc { max-width: 900px; }
.doc-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.doc-actions .back { margin: 0; }
.statement { background: #fff; padding: 48px 52px; border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: 0 10px 40px rgba(26, 42, 60, .08); color: #111a26; font-size: 14px; }
.statement__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid #111a26; }
.statement__head h1 { margin: 0; font-size: 28px; letter-spacing: .2em; }
.statement__head dl { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 0; font-size: 13px; }
.statement__head dt { color: #5a6574; }
.statement__head dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.statement__parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 22px 0; }
.statement__parties section { padding: 14px 16px; border: 1px solid #cfd6df; border-radius: 6px; }
.statement__parties h2 { margin: 0 0 6px; font-size: 12px; color: #5a6574; font-weight: 600; }
.statement__parties p { margin: 0 0 2px; line-height: 1.55; }
.statement__name { font-size: 17px; font-weight: 700; }
.statement__lines { width: 100%; border-collapse: collapse; margin: 8px 0 0; }
.statement__lines th { text-align: left; font-size: 12px; color: #5a6574; font-weight: 600; padding: 8px 6px; border-top: 1px solid #111a26; border-bottom: 1px solid #cfd6df; }
.statement__lines td { padding: 8px 6px; border-bottom: 1px solid #e3e8ee; vertical-align: top; }
.statement__lines .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.statement__lines small { display: block; color: #5a6574; font-size: 12px; }
.statement__sum { display: grid; grid-template-columns: auto 160px; justify-content: end; gap: 4px 20px; margin: 16px 0 0; font-variant-numeric: tabular-nums; }
.statement__sum dt { color: #5a6574; text-align: right; }
.statement__sum dd { margin: 0; text-align: right; }
.statement__sum small { font-size: 11px; }
.statement__total { padding-top: 6px; border-top: 1px solid #111a26; font-size: 18px; font-weight: 700; color: #111a26 !important; }
.statement__bank { margin: 22px 0 0; padding: 10px 14px; background: #f4f6f9; border-radius: 6px; }
.statement__note { margin: 10px 0 0; color: #3b4654; white-space: pre-wrap; }
.statement__admin { margin-top: 32px; padding-top: 20px; border-top: 1px dashed var(--line); }
.statement__admin h2 { font-size: 16px; margin: 0 0 8px; }
.statement__admin ul { margin: 0 0 14px; padding-left: 18px; }
@media (max-width: 760px) { .statement { padding: 24px 18px; } .statement__parties { grid-template-columns: 1fr; } .statement__head { flex-direction: column; } }
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff !important; }
  .topbar, .foot, .no-print, .toasts { display: none !important; }
  .page { padding: 0; max-width: none; }
  .statement { border: 0; box-shadow: none; padding: 0; border-radius: 0; }
}
