/* 결재-승인시스템 (apprsys.js, 2026-10-21) — KaiLabsPlatform approval.css 를 이 프로그램 색(--panel · --line · --head2 · --acc · --mute)으로 */
.doc[data-id="apprsys"] .ap-sub { color: var(--mute); font-size: 13px; }

/* 탭 : 같은 폭 */
.ap-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ap-tab { width: 130px; height: 38px; border: 1px solid var(--line); border-radius: 19px; background: var(--panel); color: var(--ink); font: inherit; font-size: var(--fs-title);
  font-weight: 700; cursor: pointer; }   /* 18px (2026-10-24) */
.ap-tab:hover { background: var(--head2); }
.ap-tab.on { background: var(--acc); border-color: var(--acc); color: #fff; }

/* 검색 : 기간 · 항목 · 검색어 · [상세검색] */
.ap-search { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.ap-search select, .ap-search input { height: auto; padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--ink); font: inherit; font-size: var(--fs-title); }   /* 다른 화면 조회 줄과 같게 18px (2026-10-24) */
.ap-search .btn { font-size: var(--fs-title); }
.ap-search input { width: 220px; }

/* 왼쪽 목록 | 막대 | 오른쪽 문서 */
.ap-split { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--apw, 440px) 8px minmax(0, 1fr); }
.ap-split.dragging { user-select: none; cursor: col-resize; }
.ap-list, .ap-doc { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.ap-bar { cursor: col-resize; position: relative; }
.ap-bar::after { content: ""; position: absolute; left: 3px; top: 40%; height: 48px; width: 2px; border-radius: 2px; background: var(--line); }
.ap-bar:hover::after, .ap-split.dragging .ap-bar::after { background: var(--acc); }
.ap-list-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--head2); }
.ap-list-bar .sp { flex: 1; }
.ap-list-bar select { height: auto; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; font: inherit; font-size: var(--fs-title); }   /* 18px (2026-10-24) */
.ap-chk { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-title); font-weight: 700; white-space: nowrap; }
.ap-chk input { width: 17px; height: 17px; }
.ap-count { font-size: var(--fs-title); color: var(--mute); }
.ap-items { flex: 1; overflow-y: auto; }
.ap-empty { padding: 40px 16px; text-align: center; color: var(--mute); font-size: 14px; }
.ap-item { padding: 9px 12px 8px; border-bottom: 1px solid var(--line); cursor: pointer; border-left: 3px solid transparent; }
.ap-item:hover { background: var(--head2); }
.ap-item.sel { background: var(--sel); border-left-color: var(--acc); }
.ap-r1, .ap-r2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ap-r1 input { margin: 0; }
.ap-title { flex: 1; min-width: 0; font-size: var(--fs-cell); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-r2 { margin-top: 4px; font-size: 13px; color: var(--mute); padding-left: 21px; }
.ap-r2 > span { white-space: nowrap; }
.ap-no { font-family: Consolas, "D2Coding", monospace; }
.ap-date { margin-left: auto; font-size: 13px; color: var(--mute); white-space: nowrap; }
.ap-date.ing { color: #2457c5; font-weight: 700; }
.ap-st { font-weight: 700; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--head2); color: var(--ink); white-space: nowrap; }
.ap-st.st-done { background: #e3f6ea; color: #17803d; }
.ap-st.st-ing { background: #e6efff; color: #2457c5; }
.ap-st.st-rej { background: #fde8e8; color: #c22; }
.ap-st.st-tmp { background: #eef1f6; color: #5b6578; }
.ap-pager { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 6px; font-size: 13px; }
.ap-pager:empty { display: none; }

/* 오른쪽 문서 */
.ap-doc { overflow-y: auto; padding: 0 18px 18px; display: block; }
.ap-doc-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 10px 0; background: var(--panel); border-bottom: 1px solid var(--line); }
.ap-doc-bar .sp { flex: 1; }
.ap-doc-title { margin: 14px 0 6px; font-size: 19px; }
.ap-flow { font-size: 14px; line-height: 1.9; }
.ap-flow i { font-style: normal; color: var(--mute); margin: 0 2px; }
.ap-flow .fl.ok { color: #17803d; font-weight: 700; }
.ap-flow .fl.now { color: #8b2fc9; font-weight: 700; }
.ap-flow .fl.rej { color: #c22; font-weight: 700; }
.ap-flow small { color: var(--mute); }
.ap-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 4px 0 12px; font-size: 14px; }
.ap-meta em { font-style: normal; color: var(--mute); margin-right: 6px; }
.ap-info { margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--head2); font-size: 14px; }
.ap-info[hidden], .ap-subbody[hidden] { display: none; }
.ap-info dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.ap-info dl div { display: flex; gap: 8px; }
.ap-info dt { color: var(--mute); min-width: 56px; }
.ap-info dd { margin: 0; }
/* 결재 처리 칸 (내 차례일 때) : 의견 + [검토/승인/합의] [반려] */
.ap-act { margin: 0 0 12px; padding: 10px 14px; border: 2px solid var(--acc); border-radius: 8px; background: color-mix(in srgb, var(--acc) 6%, var(--panel)); }
.ap-act-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; font-size: 14px; }
.ap-act-h .mute { color: var(--mute); font-size: 13px; }
.ap-act .ap-bad { color: var(--err); font-weight: 700; font-size: 13px; }
.ap-act textarea { width: 100%; min-height: 56px; resize: vertical; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 14px; box-sizing: border-box; }
.ap-act-b { display: flex; gap: 8px; margin-top: 6px; }
.ap-act-b .sp { flex: 1; }
.ap-act-b .btn { min-width: 84px; font-weight: 700; }
.ap-act-b .btn:disabled { opacity: .45; }
.ap-act-b .ap-rej { color: var(--err); border-color: var(--err); }
.ap-lines { width: 100%; border-collapse: collapse; }
.ap-lines th, .ap-lines td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.ap-subtabs { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.ap-subtabs button { height: 34px; border: 0; border-right: 1px solid var(--line); background: var(--panel); font: inherit; font-size: 14px; cursor: pointer; }
.ap-subtabs button:last-child { border-right: 0; }
.ap-subtabs button.on { background: var(--acc); color: #fff; font-weight: 700; }
.ap-subbody { margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
/* 종이 (2026-10-21) : 상신 창과 같은 크기 (폭 900px · 높이는 내용대로), 왼쪽 정렬.  Shift + 휠 = 확대 · 축소 (style.zoom) */
.ap-paper-wrap { overflow: auto; padding: 14px; background: var(--head2); border: 1px solid var(--line); border-radius: 6px; }
.ap-paper { background: #fff; color: #111; padding: 16px 20px; width: 900px; box-sizing: border-box; margin: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.ap-zoom { font-size: 13px; color: var(--mute); cursor: pointer; user-select: none; white-space: nowrap; }
.ap-none { display: grid; place-items: center; height: 100%; min-height: 300px; color: var(--mute); font-size: 14px; }

/* [결재작성] (2026-10-24) : 위 = 결재유형 · 작성자 · 부서 · [+ 새 문서] / 결재선 · [임시저장] [상신] / 본문 = 일반상신(제목 + 결재란 + 편집기) 또는 양식 종이 */
.ap-write { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.ap-write[hidden] { display: none; }
.ap-wbar, .ap-ebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; font-size: var(--fs-title); }
.ap-wbar label, .ap-ebar label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.ap-wbar select, .ap-wbar input, .ap-ebar select { font: inherit; font-size: var(--fs-title); font-weight: 400; padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--ink); }
.ap-wbar input[readonly] { background: var(--line2); color: var(--mute); width: 160px; }
.ap-wbar .ap-dept { width: 140px; }
.ap-wbar .btn, .ap-ebar .btn { font-size: var(--fs-title); }
.ap-ebar .sp { flex: 1; }
.ap-sep { width: 1px; height: 24px; background: var(--line); }
.ap-wtitle { font-size: var(--fs-title); }
.ap-lineinfo { font-size: 15px; color: var(--mute); }
.ap-lineinfo b { color: var(--acc); }
.ap-lineinfo em { font-style: normal; }
.ap-werr { margin: 0; color: var(--err); font-weight: 700; font-size: 15px; }
.ap-wbody { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.ap-wpaper { flex: 1; max-height: none; }
.ap-gen { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.ap-gtop { display: flex; align-items: center; gap: 16px; }   /* 제목 + 맨 오른쪽 본문양식 (2026-10-24) */
.ap-gtitle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: var(--fs-title); font-weight: 700; }
.ap-gform { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; font-size: var(--fs-title); color: #e00; white-space: nowrap; }
.ap-gform input { width: 520px; max-width: 36vw; font: inherit; font-size: var(--fs-title); color: var(--ink); padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); }
.ap-bfsave { flex: 0 0 auto; font-size: var(--fs-title); color: #e00; border-color: #e00; font-weight: 700; }   /* [양식저장] (2026-10-24) */
.ap-gtitle em { color: var(--err); font-style: normal; }
.ap-gtitle input { flex: 1; font: inherit; font-size: var(--fs-title); font-weight: 400; padding: 4px 8px; border: 1px solid var(--line); border-radius: 5px; }
.ap-gsign { display: flex; align-items: stretch; gap: 18px; min-height: 96px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 6px; color: #333; flex-wrap: wrap; }
.ap-sgrp { display: flex; align-items: stretch; gap: 4px; }   /* 결재 · 합의 · 수신 묶음 (2026-10-24) */
.ap-gsign .sf-abox { height: 92px; }
.ap-gsign .mute { align-self: center; color: var(--mute); font-size: 15px; }
.ap-gsign-cap { writing-mode: vertical-rl; display: grid; place-items: center; padding: 0 4px; font-weight: 700; background: #e9e9e9; border: 1px solid #8a8a8a; }
.ap-geditor { flex: 1; min-height: 420px; display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.ap-geditor .lp-embed { flex: 1; width: 100%; border: 0; }
.ap-gview .ap-gsign { margin-bottom: 10px; }
.ap-gframe { display: block; width: 100%; min-height: 200px; border: 1px solid var(--line); background: #fff; }
.sf-abox.rej { border-color: #c22; }
.ap-rejmark { color: #c22; font-size: 10pt; }
.sf-in.bad { outline: 2px solid var(--err); }

@media (max-width: 900px) {
  .ap-split { grid-template-columns: 1fr; }
  .ap-bar { display: none; }
  .ap-list { max-height: 50vh; }
}
