/* QUICKTEXTER — 시스템관리자 사이트 스타일.
 *
 * 디자인 기준: reference_review_ui/index.html (확정본)
 *   토큰 · 타이포 · 버튼 · 배지 · 테이블 · 폼 · 노트를 확정본과 동일하게 맞춘다.
 *   좌측 네비게이션만 어둡게 유지해 OCR 사이트와 시스템 관리 콘솔을 구분한다.
 */

/* ============================================================
   1. 디자인 토큰 / 기본 스타일 (확정본과 동일)
   ============================================================ */
:root {
  --bg: #f4f6f8; --panel: #ffffff; --line: #e2e6ec; --line-strong: #cbd2dc;
  --text: #1e2430; --text-2: #4b5563; --muted: #7b8494;
  --accent: #2563eb; --accent-weak: #eef4ff; --accent-line: #bcd2ff;
  --ok: #15803d; --ok-weak: #eaf7ee;
  --warn: #b45309; --warn-weak: #fdf5e6;
  --danger: #b91c1c; --danger-weak: #fdeeee;
  --lock: #6d28d9; --lock-weak: #f3eefe;
  --radius: 6px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 12px rgba(16,24,40,.06);
  --nav-bg: #1a2440; --nav-line: #26314f;
  --content-max: none;   /* 본문 최대 폭. none = 화면 전체 */
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 13px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c8ced8; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aab2bf; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- shell ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex: 0 0 auto; background: var(--nav-bg); color: #c6cee2;
  display: flex; flex-direction: column;
}
.brand { padding: 16px 16px 13px; border-bottom: 1px solid var(--nav-line); }
.brand strong {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: #fff; font-weight: 700; letter-spacing: -.2px;
}
.brand strong::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--accent); }
.brand span { display: block; font-size: 10.5px; color: #8794b3; margin-top: 2px; padding-left: 17px; }
.nav { padding: 10px 8px; }
.nav-group {
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: #7d89a8; padding: 12px 10px 5px; font-weight: 700;
}
.nav a {
  display: block; padding: 7px 10px; border-radius: var(--radius);
  color: #c6cee2; font-size: 12.5px;
}
.nav a:hover { background: #1f2a48; color: #fff; text-decoration: none; }
.nav a.on { background: var(--accent); color: #fff; font-weight: 600; }
.nav-shared {
  display: inline-block; margin-left: 6px; padding: 0 5px; border: 1px solid #8794b3; border-radius: 4px;
  color: inherit; font-size: 10px; font-weight: 500; line-height: 15px;
}

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.page-head { flex: 0 0 auto; position: sticky; top: 0; z-index: 30; }
.topbar {
  min-height: 52px; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px;
}
.page-title { min-width: 0; }
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  margin-bottom: 5px; font-size: 11.5px; color: var(--text-2);
}
.section-nav {
  display: flex; flex-wrap: wrap; gap: 2px; padding: 8px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.section-nav a { padding: 4px 9px; border-radius: var(--radius); color: var(--text-2); font-size: 12px; }
.section-nav a:hover { background: #f7f9fc; text-decoration: none; }
.section-nav a.on { background: var(--accent-weak); color: #1d4ed8; font-weight: 700; }
.js-tabs .panel[data-tab]:not(.tab-on) { display: none; }
.topbar h1 { font-size: 15px; margin: 0; font-weight: 700; }
.topbar h1 .heading-code { margin-left: 2px; font-weight: 400; white-space: nowrap; }   /* 제목 뒤 흐린 작은 묶음번호 (묶음 상세) */
.batch-crumbs .crumbs > :last-child { min-width: 0; overflow-wrap: anywhere; }   /* 묶음 상세 경로의 묶음명 — 공백 없는 긴 이름도 줄바꿈 */
.spacer { flex: 1 1 auto; }
.who { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.who b { color: var(--text); }
/* OCR 사이트와 동일 정책 — 화면 폭 전체 사용 (app.css 주석 참조) */
.content {
  padding: 24px 20px 20px;
  max-width: var(--content-max, none);
  margin: 0 auto;
  width: 100%;
}

/* ---------- cards ---------- */
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
}
.card .label { font-size: 11.5px; color: var(--muted); }
.card .value { font-size: 24px; font-weight: 700; letter-spacing: -.5px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.card .sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
/* `항목 <b>내용</b> · …` 줄: 항목 이름은 부모의 흐린 색, 내용만 본문 색으로 진하게. */
.kv b { color: var(--text); font-weight: 600; }
.card.card-split { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card.card-split > div { min-width: 0; }
.card.card-split > .btn { flex: none; }
.card.accent .value { color: var(--accent); }
.card.ok .value { color: var(--ok); }
.card.warn .value { color: var(--warn); }
.card.danger .value { color: var(--danger); }
/* 다른 화면으로 가는 카드 */
a.card { display: block; color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--line-strong); text-decoration: none; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 14px; overflow: hidden;
}
.panel > h2 {
  font-size: 13px; margin: 0; padding: 10px 12px; background: #fbfcfd;
  border-bottom: 1px solid var(--line); font-weight: 700;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.panel > h2 .hint { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.panel-body { padding: 12px; }
.panel-body.list-filters { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.cols { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }

/* ---------- table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 7px 14px; text-align: left; border-bottom: 1px solid #f1f3f6; vertical-align: top; }
th {
  background: #fbfcfd; font-weight: 700; color: var(--text-2); font-size: 11.5px;
  white-space: nowrap; border-bottom: 1px solid var(--line);
}
tbody tr:hover { background: #f7f9fc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }

/* 표 안 인라인 수정 — 버튼은 해당 row 의 액션 칸에, 폼은 바로 아래 전체 폭 행에.
   좁은 셀 안에서 폼을 펼치면 열 정렬이 무너지고, 접힌 토글을 별도 행에 두면
   행 수가 두 배가 된다. checkbox 는 폼 밖(위 행)에 있어 submit 되지 않는다. */
/* checkbox 는 tab 순서에 남겨야 하므로 display:none 이 아니라 시각적으로만 숨긴다 */
.row-toggle {
  position: absolute; width: 1px; height: 1px; margin: 0;
  opacity: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.row-toggle:focus-visible + label.btn { outline: 2px solid var(--accent); }
/* 기본값은 "펼침" 이다. 숨김은 :has() 를 실제로 지원할 때만 켠다.
   순서를 반대로 하면 selector() 문법을 모르는 브라우저가 at-rule 을 버리고
   숨김 규칙만 남겨 수정 폼을 아예 열 수 없다. */
@supports selector(tr:has(> td > .row-toggle:checked)) {
  tr.edit-row { display: none; }
  tr:has(> td > .row-toggle:checked) + tr.edit-row { display: table-row; }
}

/* ---------- badges (확정본과 동일한 pill) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
}
.badge.gray { background: #f0f2f5; color: var(--text-2); border-color: var(--line); }
.badge.accent { background: var(--accent-weak); color: #12419e; border-color: var(--accent-line); }
.badge.ok { background: var(--ok-weak); color: var(--ok); border-color: #c3e6cf; }
.badge.warn { background: var(--warn-weak); color: var(--warn); border-color: #f0dcb6; }
.badge.danger { background: var(--danger-weak); color: var(--danger); border-color: #f0c8c8; }
.badge.lock { background: var(--lock-weak); color: var(--lock); border-color: #ddd0fb; }

/* ---------- progress ---------- */
.bar { height: 6px; background: #e6e9ee; border-radius: 3px; overflow: hidden; min-width: 70px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.bar > i.ok { background: var(--ok); }
.bar > i.warn { background: var(--warn); }
.bar > i.danger { background: var(--danger); }
.bar-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- forms ---------- */
form.inline { display: inline; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 3px; }
.field > label { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=email], input[type=search], select, textarea {
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 0 8px;
  height: 30px; font: inherit; background: #fff; color: var(--text); min-width: 0;
}
textarea { min-height: 62px; height: auto; padding: 6px 8px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-weak); border-color: var(--accent); }
/* 읽기 전용·비활성 칸은 음영으로 구분한다. focus 모양은 다른 입력칸과 같게 둔다 */
input[readonly], input:disabled, select:disabled, textarea[readonly], textarea:disabled {
  background: var(--bg); color: var(--text-2); cursor: not-allowed;
}
/* OCR 사이트와 동일한 보기/숨기기 토글 (static/password-toggle.js) */
.password-input { position: relative; width: 100%; }
.password-input > input { width: 100%; padding-right: 38px; }
.password-toggle {
  position: absolute; top: 50%; right: 5px; transform: translateY(-50%);
  width: 28px; height: 26px; padding: 0; border: 0; border-radius: 4px;
  display: inline-grid; place-items: center; background: transparent; color: var(--text-2);
  line-height: 1; font-size: 16px;
}
.password-toggle:hover { background: #eef1f6; }
.password-toggle[aria-pressed="true"]::after {
  content: ""; position: absolute; width: 19px; height: 2px; border-radius: 2px;
  background: currentColor; transform: rotate(-42deg);
}
input.invalid { border-color: var(--danger); outline: 2px solid var(--danger-weak); }
.field-error { color: var(--danger); font-size: 11.5px; font-weight: 600; margin-top: 2px; }

/* 상세 관리 — 폼 4개가 한 덩어리로 보이지 않게 구획을 나눈다 */
.detail {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fbfcfd; padding: 10px 12px; margin-top: 8px; max-width: 900px;
}
.detail > form + form { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.detail .sec { font-size: 11.5px; font-weight: 700; color: var(--text-2); margin: 0; }
/* 펼친 패널이 무엇을 연 것인지 (스크립트가 있으면 summary 가 숨는다) */
.detail > .detail-title { margin-bottom: 10px; }
/* 이 영역은 <td> 안이라 목록 셀 가운데 정렬을 그대로 물려받았다.
   제목·라벨·안내 문구까지 가운데로 가면 폼으로 안 보인다. */
.detail, .detail th, .detail td { text-align: left; }
/* 버튼만 있는 칸은 옆 입력칸(라벨+입력상자)의 가운데에 둔다.
   아래에 붙이면 라벨이 없는 만큼 훌 내려간 것처럼 보인다. */
/* 버튼과 입력칸은 둘 다 30px 이라 **밑줄을 맞추면 세로 가운데가 정확히 맞는다.**
   칸 전체(라벨+입력칸) 기준으로 가운데를 잡으면 라벨 높이만큼 위로 뜨기만 한다. */
.row-details .grid-form .btn-cell { align-self: end; }
/* 관리 열 — 버튼 세 개를 한 줄로. 폭은 `.t-sys-user .y-act` 가 정한다. */
.sys-acts { white-space: nowrap; }
.sys-acts > .actions { flex-wrap: nowrap; }
/* 버튼 오른쪽에 안내 문구가 붙는 칸. 기본 200px 열에서는 문구가
   버튼 아래로 접힌다 — 남은 열을 전부 쓴다. */
.detail .grid-form .btn-cell.rest { grid-column: 2 / -1; }
.detail .grid-form .btn-cell.rest .actions { flex-wrap: nowrap; }

/* 상세 관리 여닫기 — 요약줄 대신 관리 열의 버튼을 쓴다.
   스크립트가 없으면 둘 다 원래대로 — 요약줄이 보이고 버튼은 숨는다. */
.js-row-details details.row-details > summary { display: none; }
html:not(.js-row-details) [data-details] { display: none; }
/* 접혀 있을 때는 빈 행이 되므로 여백을 주지 않는다. */
.js-row-details td.row-details-cell { padding: 0; border-bottom: 0; }
.js-row-details td.row-details-cell:has(> details[open]) { padding: 0 14px 10px; }
.panel > h2 > .btn { margin-left: auto; }
.panel > h2 .pg-count ~ .btn { margin-left: 0; }
.panel > h2 > .btn + .btn { margin-left: 0; }

/* 새로 만들기 모달 (modal.js). 스크립트가 없으면 일반 패널처럼 펼쳐 두고 열기·취소 버튼을 숨긴다. */
dialog.modal {
  background: var(--panel); color: inherit; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 0;
}
dialog.modal > h2 {
  font-size: 14px; margin: 0; padding: 12px 14px; background: #fbfcfd;
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
dialog.modal > h2 .hint { font-weight: 400; color: var(--muted); font-size: 11.5px; }
dialog.modal > .modal-hint { margin: 0; padding: 10px 12px 0; color: var(--muted); font-size: 12px; }
.js-modal dialog.modal { position: fixed; inset: 0; margin: auto; width: min(720px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); overflow: auto; }
.js-modal dialog.modal:focus, .js-modal dialog.modal:focus-visible { outline: none; }
dialog.modal .modal-foot { justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }
dialog.modal .modal-foot > span { margin-right: auto; }
.js-modal dialog.modal::backdrop { background: rgba(15, 23, 42, .45); }
html:not(.js-modal) dialog.modal { display: block; position: static; width: auto; max-width: none; margin: 14px 0 0; }
html:not(.js-modal) [data-modal], html:not(.js-modal) [data-modal-close] { display: none; }

/* 폼은 화면을 다 채우지 않는다. 넓은 모니터에서 입력칸 하나가 600px 로 늘어나면
   읽기도 채우기도 나쁘다. 표는 늘리고 폼은 묶는다. */
.grid-form {
  display: grid; gap: 10px; max-width: 1100px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.grid-form .wide { grid-column: 1 / -1; }
/* 시스템 설정 폼. auto-fit 은 항목이 하나면 입력칸을 한 줄 전체로 늘린다 */
.settings-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.settings-grid .field > label > .mono { display: block; }
/* 라벨 없는 버튼 칸. 세로 stretch 를 막아 옆 입력칸과 같은 줄에 맞춘다 */
.grid-form .btn-cell { align-self: end; align-items: flex-start; }
.check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }

/* 상품 설정(/plans). 상자는 패널 폭을 채우고, 한 줄의 입력칸은 폭이 같다 */
.plan-set { max-width: 1600px; }
/* 옆 상자와 높이가 같아지므로 버튼 줄을 아래로 밀면 설명 글 줄 수가 달라도 버튼이 같은 높이에 선다 */
.setting-group {
  display: flex; flex-direction: column; padding: 12px 14px; background: #fbfcfd;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.setting-group h3 { margin: 0 0 10px; font-size: 12.5px; font-weight: 700; }
.setting-group h3 .hint { font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 6px; }
.setting-group p { margin: 8px 0 12px; }
.setting-group > .actions { margin-top: auto; }
.plan-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.plan-row + .plan-row { margin-top: 10px; }
.plan-row input { width: 100%; }
/* 추가 면수 상자. 묶음(입력 2칸)과 유효기간(1칸)이 2:1 로 나란히 서고 좁으면 위아래로 쌓인다.
   덩어리가 상자 높이를 채우므로 두 버튼은 옆 구독 상자의 버튼과 같은 높이에 선다 */
.addon-parts { flex: 1; display: flex; flex-wrap: wrap; gap: 10px 20px; }
.addon-part { flex: 1 1 130px; display: flex; flex-direction: column; }
.addon-part:first-child { flex: 2 1 260px; }
.addon-part h4 { margin: 0 0 6px; font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.addon-part .plan-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.addon-part > .actions { margin-top: auto; }
/* 보안 · 시스템 설정(/settings)의 운영 기준 폼. 묶음 모양은 위 시스템 설정 폼과 같다 */
.settings-ops .settings-grid { margin-top: 8px; }
.settings-ops > .actions { margin-top: 14px; }
.plan-history > summary { padding: 10px 12px; font-weight: 700; font-size: 13px; cursor: pointer; }

/* ---------- buttons (확정본과 동일) ---------- */
.btn {
  height: 30px; padding: 0 10px; border: 1px solid var(--line-strong); background: #fff;
  border-radius: var(--radius); display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; color: var(--text); text-decoration: none;
}
.btn:hover { background: #f7f9fc; text-decoration: none; }
.btn:active { background: #eef1f6; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #1d54cf; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 600; }
.btn.warn { background: #fff; border-color: #f0dcb6; color: var(--warn); }
.btn.warn:hover { background: var(--warn-weak); }
.btn.danger { background: #fff; border-color: #e6b9b9; color: var(--danger); }
.btn.danger:hover { background: var(--danger-weak); }
.btn.next { background: var(--accent-weak); border-color: var(--accent-line); color: #1d4ed8; font-weight: 600; }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------- misc ---------- */
.note {
  background: var(--accent-weak); border: 1px solid var(--accent-line); color: #12419e;
  border-radius: var(--radius); padding: 9px 11px; font-size: 12.5px; margin-bottom: 12px;
}
/* panel 은 위쪽 margin 만 가진다. 그 뒤에 오는 note 는 스스로 떨어져야 한다 */
.panel + .note { margin-top: 12px; }
.panel + .actions { margin-top: 14px; }
.note.ok { background: var(--ok-weak); border-color: #c3e6cf; color: var(--ok); }
.note.warn { background: var(--warn-weak); border-color: #f0dcb6; color: var(--warn); }
.note.danger { background: var(--danger-weak); border-color: #f0c8c8; color: var(--danger); }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 11.5px; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.panel:has(> .trend-body) { display: flex; flex-direction: column; }
.trend-body { flex: 1; display: flex; align-items: center; justify-content: center; }
.trend { display: flex; justify-content: center; gap: 10px; width: 100%; height: 150px; padding: 8px 4px; }
/* 막대 칸(b)이 남은 높이를 가져야 i 의 height % 가 먹는다 */
.trend .col { flex: 0 1 64px; display: grid; grid-template-rows: 1fr auto auto; justify-items: center; gap: 4px; }
.trend .col > b { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 100%; }
.trend .col > b > i {
  display: block; width: 100%; max-width: 46px; background: var(--accent);
  border-radius: 3px 3px 0 0; min-height: 2px;
}
.trend .col > span { font-size: 10.5px; color: var(--muted); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--nav-bg); }
.login-box {
  width: 360px; background: #fff; border-radius: 10px; padding: 26px;
  box-shadow: 0 20px 50px rgba(16, 24, 40, .28);
}
.login-box h1 { font-size: 17px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.login-box h1::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--accent); }
.login-box p.sub { margin: 0 0 18px; font-size: 12px; color: var(--muted); }
.login-box .field { margin-bottom: 12px; }
.login-box input { width: 100%; }
.login-box .btn { width: 100%; height: 38px; justify-content: center; font-size: 14px; }
.login-err {
  background: var(--danger-weak); border: 1px solid #f0c8c8; color: var(--danger);
  padding: 8px 10px; border-radius: var(--radius); font-size: 12.5px; margin-bottom: 12px;
}

/* ---------- pagination ---------- */
.panel > h2 .pg-count { margin-left: auto; }
.pager {
  display: flex; justify-content: center; align-items: center; gap: 4px;
  flex-wrap: wrap; padding: 12px; border-top: 1px solid var(--line);
}
.pager .btn { min-width: 28px; justify-content: center; font-variant-numeric: tabular-nums; }
.pager span.btn[aria-disabled] { opacity: .45; background: #f7f9fc; }
.pg-size { height: 26px; padding: 0 4px; font-size: 12px; margin-left: 8px; }

/* ---------- 목록 표 열 너비 고정 ----------
   app.css 와 같은 규칙이다. 기본값(`table-layout: auto`)은 그 페이지의 내용으로
   열 너비를 정해서, 페이지를 넘길 때마다 열이 좌우로 흔들린다.
   잘린 셀에만 `title` 이 붙는다 (static/table-ellipsis.js). */
/* **표 안에서 편집하는 표는 말줄임에서 제외한다** (`t-editable`). 입력칸·라디오가
   들어 있어 잘라내면 조작이 불가능해진다. 폭은 `t-cols` 로 똑같이 고정하고, 칸을
   넘는 값은 잘리는 대신 줄바꿈된다. */
/* `:where()` 로 감싸 특정도를 0 으로 만든다. 감싸지 않으면 이 선택자가 (0,3,2) 라
   `.table-wrap td.cell-wrap`(0,2,1) 같은 예외가 절대 이기지 못한다 — 예외를
   써 놓고도 셀이 그대로 잘렸다 (Codex 2026-08-27 pass2 Finding 1). */
.table-wrap table:not(.t-editable) { table-layout: fixed; }
.table-wrap table.t-cols.t-editable { table-layout: fixed; }
.table-wrap table.t-cols.t-editable td { overflow-wrap: anywhere; }
.table-wrap table:where(:not(.t-editable)) th,
.table-wrap table:where(:not(.t-editable)) td {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.table-wrap th.num, .table-wrap td.num { width: 88px; }
.table-wrap th.acts, .table-wrap td.acts { width: 128px; }
.table-wrap th.acts-wide, .table-wrap td.acts-wide { width: 190px; }
.table-wrap td.cell-wrap { white-space: normal; overflow: visible; }
/* 상세 관리 행은 열이 아니라 **행 전체를 차지하는 폼**이다 (colspan). 고정 배치의
   말줄임을 그대로 두면 입력칸이 잘려 조작이 불가능해진다 — `t-editable` 로 표
   전체의 고정 배치를 포기하는 대신 이 칸만 예외로 둔다. 목록 열은 계속 고정된다. */
.table-wrap td.row-details-cell { white-space: normal; overflow: visible; }
/* 배지·버튼만 든 칸은 말줄임을 끈다. 이것들은 통짜 인라인 블록이라 글자 단위로
   잘리지 않는데, `text-overflow: ellipsis` 는 그래도 `...` 을 그린다.
   배지가 멀쩡히 다 보이는데 옆에 점 세 개만 붙어 **숨은 글자가 있다는 잘못된
   신호**를 준다 (2026-08-27 사용자 지적, 브라우저에서 확인).
   툴팁은 그대로 붙으므로 정말 좁을 때 확인할 방법은 남는다. */
.table-wrap td:has(> .badge),
.table-wrap td:has(> .btn),
.table-wrap td:has(> form) { text-overflow: clip; }

/* 표 안의 셀렉트는 **가장 긴 선택지 폭**으로 커진다. 고정 배치 칸에서는 그
   폭이 칸을 넘겨 `overflow:hidden` 에 잘리고, 조작 자체가 어려워진다.
   칸에 맞춰 줄어들게 한다 — 표 폭을 키우지 않고 해결된다
   (결과 반출 화면의 포맷 셀렉트가 216px 인데 칸은 145px 이었다). */
.table-wrap select { max-width: 100%; }

/* ---------- 값의 성격별 정렬 (모든 목록 공통) ----------
   같은 성격의 값이 화면마다 다르게 정렬되면 눈이 매번 다시 적응해야 한다.
   클래스로 성격을 구분할 수 있는 것만 잡는다 — 템플릿을 일일이 고치지 않는다.

   숫자를 오른쪽이 아니라 가운데로 둔다 (2026-08-26 사용자 지시). 자릿수 비교는
   오른쪽 정렬이 유리하지만, 열 폭을 고정한 뒤로는 가운데가 더 안정적으로 보인다.

   헤더는 전부 가운데다. 열 종류를 헤더 클래스로 구분할 수 없어(날짜·회차 th 에는
   표시가 없다) 컬럼별로 나눌 수 없다. */
.table-wrap th { text-align: center; }
.table-wrap th.num, .table-wrap td.num { text-align: center; }   /* 숫자 */
.table-wrap td.mono { text-align: center; }                      /* 회차·코드·IP */
.table-wrap td.nowrap { text-align: center; }                    /* 날짜 (고정 폭) */

/* ---------- 목록 셀 정렬 (최종) ----------
   app.css 와 같은 규칙이다. 목록 셀은 가로·세로 모두 가운데. 버튼이 든 칸은 행이
   높아지는데 기본값(`top`)이면 옆 칸 값들이 위로 붙어 어긋나 보인다. */
.table-wrap th, .table-wrap td { text-align: center; vertical-align: middle; }

/* 왼쪽 정렬로 남길 셀 (app.css 와 같은 규칙). 길이가 제각각인 값은 가운데로 두면
   줄마다 시작점이 달라 훑기 어렵다. */
.table-wrap td.t-left { text-align: left; }

/* ---------- 화면별 열 폭 (비율) ----------
   폭을 px 로 못 박으면 사이드바가 있는 이 레이아웃에서 창을 줄일 때 표가 먼저
   넘친다. 비율로 두면 남는 폭이 긴 값(상세·오류·사유)으로 흘러간다.
   `t-cols` 는 colgroup 으로 폭을 정했다는 표시 — `.num`/`.acts` 의 기본 폭을 푼다. */
.table-wrap table.t-cols th.num, .table-wrap table.t-cols td.num,
.table-wrap table.t-cols th.acts, .table-wrap table.t-cols td.acts { width: auto; }

/* ---------- 비율 표의 최소 폭 ----------
   비율(%)로만 폭을 준 표는 **바닥이 없다.** `width:100%` 라 창이 좁아지면 표가
   같이 줄어들 뿐 `.table-wrap` 의 가로 스크롤이 생기지 않는다. 그래서 셀렉트·
   버튼 같은 조작 요소가 스크롤 대신 잘려 못 쓰게 된다
   (Codex 2026-08-27 pass2 Finding 2).

   900px 는 브라우저에서 잰 값이 아니라 레이아웃 산술로 고른 **가드 값**이다.
   본문 폭은 사이트마다 다르다 — 관리자는 사이드바 216px 를 빼고(1280px 창에서
   약 1030px), OCR 은 상단바뿐이라 여백만 뺀다(약 1240px). 어느 쪽이든 이 바닥은
   1280px 창보다 좁아질 때만 발동한다.

   px 로 고정한 세 표는 자기 바닥(1114/1266/1604)이 따로 있어 제외한다.
   `:where()` 로 감싸 특정도를 올리지 않는다 — 아래 `.cols` 규칙이 이겨야 한다. */
.table-wrap table.t-cols:where(:not(.t-batch-status)):where(:not(.t-page-list)):where(:not(.t-batch-list)):where(:not(.t-audit)):where(:not(.t-tenant-users)):where(:not(.t-sys-user)):where(:not(.t-export-req)):where(:not(.t-sales-batch-list)) {
  min-width: 900px;
}
/* 좌우로 나란히 놓는 패널(`.cols`, 최소 360px) 안의 표는 절반 폭이 정상이다.
   여기에 900px 바닥을 씌우면 넓은 화면에서도 가로 스크롤이 생긴다. */
.cols .table-wrap table.t-cols:where(:not(.t-tenant-users)) { min-width: 0; }

/* 이 표만 바닥이 더 크다. 사이트 열은 `ADMIN`/`OCR` **배지**가 들어 있는데
   배지는 표가 좁아져도 줄지 않는다. 브라우저 실측: `ADMIN` 51.8px + 셀 여백 28
   = 80px 필요. 공용 900px 바닥에서 8% 는 72px 이라 모자란다.
   80 / 0.08 = 1000px 이 최소이고, 글꼴 편차를 감안해 1040px 로 둔다. */
.t-audit { min-width: 1040px; }
/* 감사 로그 — 고객사·사용자는 넉넉히, 남는 폭은 전부 상세로 */
.t-audit .a-when { width: 10%; }
.t-audit .a-site { width: 8%; }
.t-audit .a-tenant { width: 11%; }
.t-audit .a-user { width: 11%; }
.t-audit .a-event { width: 9%; }
.t-audit .a-target { width: 7%; }
.t-audit .a-ip { width: 8%; }
.t-audit .a-detail { width: 36%; }

/* 배치 목록 — 건수 넷과 상태는 좁게, 배치명·진행률로 폭을 넘긴다 */
/* 묶음번호 `B-YYYYMMDD-NNN` 은 mono 89px + 셀 여백 28 = 117px 이 든다 (1280px 창 실측). 1280px 에서 표 1004px → 12% */
.t-admin-batch .b-code { width: 12%; }
.t-admin-batch .b-name { width: 15%; }
.t-admin-batch .b-tenant { width: 11%; }
.t-admin-batch .b-state { width: 7%; }
.t-admin-batch .b-num { width: 5%; }
.t-admin-batch .b-progress { width: 11%; }
.t-admin-batch .b-when { width: 13%; }

/* 실패한 OCR Job — 오류 메시지가 주인공이다 */
.t-failed-job .j-id { width: 6%; }
.t-failed-job .j-tenant { width: 12%; }
.t-failed-job .j-type { width: 9%; }
.t-failed-job .j-page { width: 7%; }
.t-failed-job .j-try { width: 7%; }
.t-failed-job .j-error { width: 38%; }
.t-failed-job .j-when { width: 11%; }
.t-failed-job .j-act { width: 10%; }

/* 고객사 목록 */
.t-tenant-list .n-name { width: 26%; }
.t-tenant-list .n-login { width: 24%; }
/* ACTIVE 옆에 '탈퇴 신청' 배지가 한 줄로 들어갈 폭 */
.t-tenant-list .n-state { width: 16%; }
.t-tenant-list .n-left { width: 14%; }
.t-tenant-list .n-expiry { width: 14%; }
.t-tenant-list .n-small { width: 6%; }

/* 고객사 상세의 계정 표. 열이 아홉 개이고 관리 칸에 버튼 셋(잠금 풀기·비활성화·비밀번호 초기화)과
   임시 비밀번호 입력칸이 들어간다. 로그인 ID 는 짧으니 ID·이름 칸을 줄여 관리 칸에 준다.

   각 열의 필요 폭(브라우저 실측 아님 — 12~13px 글자수 산술로 잡은 가드 값):
     관리      버튼 3개 약 250px + 입력칸 약 160px + 간격 = 약 445px (셀 여백 포함)
     상태      가장 넓은 배지 `🔒 관리자 잠금` 약 95px
     권한      `TENANT_ADMIN` 배지 103px
     자동 해제 / 마지막 로그인  `2026-08-31 16:31` 119px
   1920px 창(본문 약 1645px)에서 관리 29% ≈ 477px 로 한 줄. 바닥 1300px 에서는 관리 377px 라
   두 줄로 접히고, 상태 104px, 권한 143px, 마지막 로그인 130px. 자동 해제(9%)만
   117px 로 2px 모자라 바닥 근처에서는 시각이 말줄임·툴팁으로 보인다 (배지가 아니라 글자라 허용).
   그 아래에서는 짓눌리는 대신 `.table-wrap` 이 가로로 스크롤한다. */
.t-tenant-users { min-width: 1300px; }
.t-tenant-users .u-id { width: 11%; }
.t-tenant-users .u-name { width: 11%; }
.t-tenant-users .u-role { width: 11%; }
.t-tenant-users .u-state { width: 8%; }
.t-tenant-users .u-dl { width: 6%; }      /* 허용/불가 43px */
.t-tenant-users .u-fail { width: 5%; }    /* 한 자리 수 */
.t-tenant-users .u-release { width: 9%; }
.t-tenant-users .u-when { width: 10%; }
.t-tenant-users .u-acts { width: 29%; }

/* 고객사 상세 · 이용권. 관리 칸에 연장 폼이 접혀 들어간다 (t-editable).
   상태 칸: 가장 넓은 배지 `주문 취소`·`사용 가능` 약 61px + 셀 여백 28 = 89px (글자수 산술 가드 값) — 900px 바닥에서 10% */
.t-tenant-voucher .o-no { width: 14%; }
.t-tenant-voucher .o-date { width: 11%; }
.t-tenant-voucher .o-num { width: 9%; }
.t-tenant-voucher .o-state { width: 10%; }
.t-tenant-voucher .o-act { width: 27%; }

/* 상품 설정 · 추가 면수 발급 내역. 상태 칸은 위 표와 같은 배지다 */
.t-order-list .o-no { width: 18%; }
.t-order-list .o-tenant { width: 24%; }
.t-order-list .o-date { width: 13%; }
.t-order-list .o-num { width: 10%; }
.t-order-list .o-state { width: 15%; }

/* 최근 배치는 전체 폭 패널이다. */
.t-tenant-batch .z-code { width: 12%; }
.t-tenant-batch .z-name { width: 28%; }
.t-tenant-batch .z-state { width: 12%; }
.t-tenant-batch .z-pages { width: 10%; }
.t-tenant-batch .z-when { width: 19%; }
.t-tenant-batch .z-exp { width: 19%; }

/* 열이 12개라 900px 에는 배지·시각이 다 들어가지 않는다. */
.t-export-req { min-width: 1200px; }
.t-export-req .x-when { width: 11%; }
.t-export-req .x-tenant { width: 9%; }
.t-export-req .x-batch { width: 11%; }   /* 묶음명 아래 묶음번호 줄 117px (위 묶음 목록과 같은 값) */
.t-export-req .x-fmt { width: 6%; }
.t-export-req .x-scope { width: 7%; }
.t-export-req .x-flag { width: 10%; }
.t-export-req .x-state { width: 8%; }
.t-export-req .x-pages { width: 6%; }
.t-export-req .x-file { width: 11%; }
.t-export-req .x-size { width: 7%; }
.t-export-req .x-user { width: 7%; }
.t-export-req .x-error { width: 7%; }

.t-download-hist .x-when { width: 17%; }
.t-download-hist .x-tenant { width: 15%; }
.t-download-hist .x-user { width: 14%; }
.t-download-hist .x-fmt { width: 9%; }
.t-download-hist .x-pages { width: 8%; }
.t-download-hist .x-file { width: 23%; }
.t-download-hist .x-ip { width: 14%; }

/* 설정 · 일일 정리 기록. 상태는 배지가 아닌 글자라 좁으면 말줄임된다.
   가장 긴 "중단된 것으로 보임 (확인 필요)" 가 900px 바닥에서도 들어가게 24%. */
.t-maint-runs .m-date { width: 11%; }
.t-maint-runs .m-start { width: 16%; }
.t-maint-runs .m-end { width: 16%; }
.t-maint-runs .m-state { width: 24%; }
.t-maint-runs .m-retry { width: 7%; }
.t-maint-runs .m-detail { width: 26%; }

/* 열이 11개라 900px 에는 건수 헤더와 시각이 다 들어가지 않는다. */
.t-sales-batch-list { min-width: 1150px; }
.t-sales-batch-list .b-code { width: 11%; }
.t-sales-batch-list .b-name { width: 13%; }
.t-sales-batch-list .b-tenant { width: 9%; }
.t-sales-batch-list .b-state { width: 8%; }
.t-sales-batch-list .b-total { width: 7%; }
.t-sales-batch-list .b-ok { width: 7%; }
.t-sales-batch-list .b-fail { width: 7%; }
.t-sales-batch-list .b-wait { width: 8%; }
.t-sales-batch-list .b-ocr { width: 9%; }
.t-sales-batch-list .b-review { width: 9%; }
.t-sales-batch-list .b-when { width: 12%; }

.t-sales-page .g-no { width: 8%; }
.t-sales-page .g-file { width: 45%; }
.t-sales-page .g-review { width: 15%; }
.t-sales-page .g-ocr { width: 13%; }
.t-sales-page .g-low { width: 9%; }
.t-sales-page .g-conf { width: 10%; }

.t-sales-sub .s-start { width: 22%; }
.t-sales-sub .s-end { width: 22%; }
.t-sales-sub .s-pages { width: 23%; }
.t-sales-sub .s-limit { width: 11%; }
.t-sales-sub .s-seats { width: 11%; }
.t-sales-sub .s-state { width: 11%; }

/* 업체 칸은 최고 관리자에게만 보인다. 품목 칸이 그 폭을 내준다. */
.t-sales-order .o-no { width: 14%; }
.t-sales-order .o-when { width: 14%; }
.t-sales-order .o-period { width: 16%; }
.t-sales-order .o-item { width: 24%; }
.t-sales-order .o-item-sm { width: 14%; }
.t-sales-order .o-amount { width: 11%; }
.t-sales-order .o-state { width: 8%; }
.t-sales-order .o-partner { width: 10%; }
.t-sales-order .o-act { width: 13%; }
/* 구독 시작일. 날짜 칸은 start-date.js 가 '날짜 직접 선택' 일 때만 켠다. 아래 흐림은 스크립트가 없을 때(type=date) 규칙이다 */
.start-pick { border: 0; margin: 0; padding: 0; min-width: 0; }
.start-pick legend { padding: 0; margin-bottom: 3px; font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.start-options { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.start-pick:not(:has(input[value="DATE"]:checked)) input[type=date] { opacity: .45; pointer-events: none; }

/* 날짜 달력 (start-date.js 의 data-datepicker). 팝업은 패널 overflow 에 잘리지 않게 body 에 붙는다 */
.dp { position: relative; display: inline-flex; align-items: center; }
.dp input { width: 140px; padding-right: 28px; }
.dp-icon { position: absolute; right: 8px; display: flex; color: var(--muted); pointer-events: none; }
.dp input:disabled + .dp-icon { opacity: .45; }
.dp-pop {
  position: absolute; z-index: 60; width: 268px; padding: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-title { font-weight: 700; }
.dp-nav, .dp-day {
  padding: 0; background: none; border: 1px solid transparent; border-radius: var(--radius); color: var(--text);
}
.dp-nav { width: 28px; height: 28px; font-size: 16px; line-height: 1; }
.dp-nav:hover:not(:disabled) { background: var(--accent-weak); }
.dp-nav:disabled { color: var(--line-strong); cursor: default; }
.dp-week, .dp-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-row { margin-top: 2px; }
.dp-week span { padding: 3px 0; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.dp-day { width: 100%; height: 30px; }
.dp-pop .dp-sun { color: var(--danger); }
.dp-pop .dp-sat { color: var(--accent); }
.dp-day:hover:not([aria-disabled="true"]) { background: var(--accent-weak); }
.dp-day.dp-out { opacity: .5; }
.dp-day.dp-today { border-color: var(--accent-line); font-weight: 700; }
.dp-pop [aria-selected="true"] > .dp-day { background: var(--accent); border-color: var(--accent); color: #fff; opacity: 1; }
.dp-pop .dp-day[aria-disabled="true"] { color: var(--line-strong); cursor: default; }
.dp-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line);
}
.t-sales-order tr:target td { background: var(--accent-weak); }

.t-sales-user .u-id { width: 14%; }
.t-sales-user .u-name { width: 12%; }
.t-sales-user .u-kind { width: 9%; }
.t-sales-user .u-state { width: 10%; }
.t-sales-user .u-dl { width: 8%; }
.t-sales-user .u-when { width: 17%; }
.t-sales-user .u-act { width: 30%; }

/* 영업 업체 칸은 최고 관리자에게만 보인다 (`ha-*` 는 그 경우의 폭). */
.t-sales-home .h-name { width: 20%; }
.t-sales-home .h-login { width: 20%; }
.t-sales-home .h-state { width: 14%; }
.t-sales-home .h-plan { width: 14%; }
.t-sales-home .h-end { width: 14%; }
.t-sales-home .h-count { width: 6%; }
.t-sales-home .h-who { width: 12%; }
.t-sales-home .ha-name { width: 15%; }
.t-sales-home .ha-login { width: 18%; }
.t-sales-home .ha-plan { width: 13%; }
.t-sales-home .ha-who { width: 10%; }
.t-sales-home .ha-partner { width: 10%; }

.t-settle-total .v-name { width: 24%; }
.t-settle-total .v-biz { width: 16%; }
.t-settle-total .v-supply { width: 16%; }
.t-settle-total .v-tax { width: 14%; }
.t-settle-total .v-total { width: 18%; }
.t-settle-total .v-list { width: 12%; }

.t-settle-ledger .l-when { width: 17%; }
.t-settle-ledger .l-tenant { width: 15%; }
.t-settle-ledger .l-kind { width: 8%; }
.t-settle-ledger .l-item { width: 12%; }
.t-settle-ledger .l-qty { width: 6%; }
.t-settle-ledger .l-price { width: 10%; }
.t-settle-ledger .l-amount { width: 12%; }
.t-settle-ledger .l-memo { width: 20%; }
.t-settle-ledger tfoot td { background: #fbfcfd; }
.t-settle-ledger tfoot tr:first-child td { border-top: 2px solid var(--line-strong); }
.table-wrap .t-settle-ledger tfoot td[colspan] { text-align: right; color: var(--muted); }
.t-settle-ledger tfoot tr.total td { font-weight: 700; border-top: 1px solid var(--line); }
.t-settle-ledger tfoot tr.total td[colspan] { color: inherit; }

.t-tenant-sub .s-start { width: 20%; }
.t-tenant-sub .s-end { width: 20%; }
.t-tenant-sub .s-pages { width: 20%; }
.t-tenant-sub .s-limit { width: 10%; }
.t-tenant-sub .s-seats { width: 10%; }
.t-tenant-sub .s-kind { width: 10%; }
.t-tenant-sub .s-state { width: 10%; }

.t-plan-prices .pp-name { width: 28%; }
.t-plan-prices .pp-price { width: 18%; }

/* 공급 단가 입력칸. 이름·설명 줄 수가 칸마다 달라도 입력칸은 칸 아래에 붙어 한 줄에 선다 */
.price-field > input { margin-top: auto; }

.t-partner-list .q-name { width: 22%; }
.t-partner-list .q-biz { width: 12%; }
.t-partner-list .q-contact { width: 18%; }
.t-partner-list .q-state { width: 9%; }
.t-partner-list .q-sales { width: 9%; }
.t-partner-list .q-tenants { width: 7%; }
.t-partner-list .q-price { width: 11%; }
.t-partner-list .q-act { width: 12%; }

/* 관리 칸의 버튼이 줄바꿈되지 않게 바닥을 둔다. 관리 칸은 잠금 풀기·비활성화·상세 관리 264px. */
.t-sys-user { min-width: 1200px; }
.t-sys-user .y-id { width: 11%; }
.t-sys-user .y-name { width: 11%; }
.t-sys-user .y-role { width: 11%; }
.t-sys-user .y-state { width: 11%; }
.t-sys-user .y-fail { width: 8%; }
.t-sys-user .y-release { width: 13%; }
.t-sys-user .y-when { width: 13%; }
.t-sys-user .y-act { width: 22%; }

/* 정산 합계 · 주문 확인. OCR 사이트 app.css 와 같은 값 (두 사이트는 CSS 를 공유하지 않는다) */
.order-summary { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 12px; }
.order-summary dt { color: var(--muted); font-size: 12.5px; }
.order-summary dd { margin: 0; }
.order-summary .total { padding-top: 8px; border-top: 1px solid var(--line); font-size: 15px; }
