/* CI/PL · FTA 서류 · FTA 이력. 목록과 편집 크롬만 다룬다. 발행 용지(.pl-paper)는 그대로 둔다.
   색은 디자인 시안의 쿨그레이 계열만 쓴다 (베이지/갈색 금지).
   ink #1c2433 · muted-bg #f2f4f6 · th-bg #f7f8f9 · line #e5e8ec · input-line #dfe2e6 · muted-text #6b7385 */

.docs-page{color:#1c2433;font-family:'Pretendard','Noto Sans KR',sans-serif;}
.docs-page > .card,#tab-fta > .card{background:transparent;border:0;box-shadow:none;min-height:0;padding:0;}
.docs-page > * + *{margin-top:20px!important;}
.docs-ic{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.docs-kicker{margin:0 0 4px;font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:#6b7385;}
.docs-h2{margin:0 0 16px;font-size:17px;font-weight:700;letter-spacing:-.02em;color:#1c2433;}

/* 헤더 (제일 위 Workspace 줄은 제거. 상단바와 중복) */
.docs-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap;margin:0;}
.docs-head h1,#tab-fta > .card > div:first-child h1{margin:0;font-family:'Pretendard','Noto Sans KR',sans-serif;font-size:24px;font-weight:700;letter-spacing:-.03em;color:#1c2433;line-height:1.25;}
.docs-head p,#tab-fta > .card > div:first-child p{margin:6px 0 0;font-size:14px;color:#6b7385;line-height:1.5;}
#tab-fta > .card > div:first-child{margin-bottom:20px!important;}
.docs-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;}

.docs-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:40px;border-radius:999px;padding:0 18px;font-weight:600;font-size:14px;cursor:pointer;font-family:'Pretendard','Noto Sans KR',sans-serif;border:1px solid transparent;background:#fff;color:#1c2433;transition:background .15s,border-color .15s,color .15s;white-space:nowrap;}
.docs-btn--primary{background:#1c2433;color:#fff;}
.docs-btn--primary:hover{background:#0d1926;}
.docs-btn--lime{background:#dfff9f;color:#1c2433;}
.docs-btn--lime:hover{background:#d3f98a;}
.docs-btn--danger{background:#b3261e;color:#fff;}
.docs-btn--danger:hover{background:#9a1f18;}
.docs-btn--ghost{background:transparent;color:#fff;border-color:rgba(255,255,255,.3);}
.docs-btn--ghost:hover{background:rgba(255,255,255,.1);}
.docs-btn--text{height:32px;padding:0 12px;font-size:13px;color:#6b7385;background:transparent;}
.docs-btn--text:hover{background:#f2f4f6;color:#1c2433;}
.docs-sel .docs-btn{height:34px;font-size:13px;}

/* 툴바 */
.docs-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;background:#fff;border:1px solid #e5e8ec;border-radius:26px;padding:12px 14px;margin:0;}
.docs-pills{display:inline-flex;background:#f2f4f6;border-radius:999px;padding:4px;gap:2px;flex-wrap:wrap;}
.docs-pill{border:0;background:transparent;color:#6b7385;border-radius:999px;height:34px;padding:0 16px;font-weight:600;font-size:14px;cursor:pointer;font-family:'Pretendard','Noto Sans KR',sans-serif;transition:background .15s,color .15s;}
.docs-pill:hover{color:#1c2433;}
.docs-pill span:not(:empty){margin-left:6px;font-size:12px;opacity:.7;font-weight:600;}
.docs-pill.on,.docs-pills .sub-tab-btn.active{background:#1c2433;color:#fff;}
.docs-search-wrap{position:relative;display:block;margin:0;flex:0 1 300px;min-width:min(240px,100%);}
.docs-search-wrap .docs-ic{position:absolute;left:14px;top:50%;margin-top:-8px;color:#9aa1ae;pointer-events:none;}
.docs-search{height:40px;width:100%;box-sizing:border-box;border-radius:999px;border:1px solid #dfe2e6;background:#f7f8f9;padding:0 16px;min-width:0;font:14px 'Pretendard','Noto Sans KR',sans-serif;color:#1c2433;}
.docs-search-wrap .docs-search{padding-left:38px;}
.docs-search::placeholder{color:#9aa1ae;}
.docs-search:focus{outline:none;border-color:#1c2433;box-shadow:0 0 0 3px rgba(198,245,74,.45);background:#fff;}
.docs-stages{display:flex;flex-wrap:wrap;gap:6px;margin:0;}
.docs-stages .docs-pill{height:32px;border:1px solid #e5e8ec;background:#fff;font-size:13px;}
.docs-stages .docs-pill.on{background:#1c2433;color:#fff;border-color:#1c2433;}
.docs-sel{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;background:#1c2433;color:#fff;border-radius:20px;padding:8px 10px 8px 20px;margin:0;}
.docs-sel p{margin:0;font-size:14px;font-weight:600;}
.docs-sel[hidden]{display:none!important;}

/* 카드 + 표 */
.docs-card{background:#fff;border:1px solid #e5e8ec;border-radius:26px;overflow:hidden;margin:0;}
.docs-card-head{display:flex;justify-content:space-between;align-items:center;padding:20px 24px 14px;}
.docs-card-head h2{margin:0;font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:#6b7385;font-weight:700;}
.docs-card-head p{margin:0;font-size:13px;color:#6b7385;}
.docs-card-head b{color:#1c2433;font-weight:700;}
#tab-cipl .data-table,#tab-fta-history .data-table,#tab-fta .data-table{width:100%;border-collapse:collapse;border-top:1px solid #e5e8ec;}
#tab-cipl .data-table th,#tab-fta-history .data-table th,#tab-fta .data-table th{background:#f7f8f9;color:#6b7385;font-size:12px;font-weight:600;letter-spacing:0;text-transform:none;padding:12px 14px;border-bottom:1px solid #e5e8ec;text-align:left;white-space:nowrap;}
#tab-cipl .data-table td,#tab-fta-history .data-table td,#tab-fta .data-table td{padding:14px;border-bottom:1px solid #eef0f2;font-size:14px;color:#1c2433;background:#fff;vertical-align:middle;}
#tab-cipl .data-table tr:last-child td,#tab-fta-history .data-table tr:last-child td,#tab-fta .data-table tr:last-child td{border-bottom:0;}
#tab-cipl .data-table tr:hover td,#tab-fta-history .data-table tr:hover td,#tab-fta .data-table tr:hover td{background:#f9fafb;}
#tab-cipl .data-table input[type=checkbox],#tab-fta-history .data-table input[type=checkbox]{width:16px;height:16px;accent-color:#1c2433;cursor:pointer;}
.docs-empty{text-align:center;padding:56px 16px!important;color:#6b7385!important;background:#fff!important;font-size:14px;line-height:1.7;}
.docs-empty--err{color:#b3261e!important;}
.docs-pdf{display:inline-flex;align-items:center;height:24px;padding:0 10px;border-radius:999px;background:#dfff9f;color:#1c2433!important;font-size:12px;font-weight:700;text-decoration:none;}
.docs-pdf:hover{background:#d3f98a;}
.docs-dash{color:#9aa1ae;}
.docs-agree{display:inline-flex;align-items:center;height:24px;padding:0 10px;border-radius:8px;background:#f2f4f6;color:#1c2433;font-size:12px;font-weight:600;white-space:nowrap;}
.docs-state{display:inline-flex;align-items:center;height:24px;padding:0 10px;border-radius:999px;font-size:12px;font-weight:600;text-decoration:none;white-space:nowrap;}
.docs-state--done{background:#d2e8ff;color:#0d1926!important;}
.docs-state--signed{background:#dfff9f;color:#1c2433!important;}
.docs-state--none{background:transparent;border:1px dashed #cfd4da;color:#9aa1ae;}
.docs-mini{display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 12px;border-radius:999px;border:1px solid #dfe2e6;background:#fff;color:#1c2433;font:600 12px 'Pretendard','Noto Sans KR',sans-serif;cursor:pointer;white-space:nowrap;}
.docs-mini:hover{border-color:#c6f54a;background:#f7ffe0;}
.docs-mini .docs-ic{width:13px;height:13px;}
.docs-mini:disabled{opacity:.5;cursor:wait;}

/* 이력 하위 탭 */
#tab-fta-history .sub-tabs{border:0;margin:0;padding:4px;background:#f2f4f6;border-radius:999px;gap:2px;}
#tab-fta-history .sub-tab-btn{border-radius:999px;padding:0 16px;height:34px;background:transparent;color:#6b7385;font-size:14px;font-weight:600;border:0;}
#tab-fta-history .sub-tab-btn.active{background:#1c2433;color:#fff;}
#tab-fta-history .sub-tab-btn span:not(:empty){margin-left:6px;font-size:12px;opacity:.7;}
/* 작성이력: 서류 종류 탭은 흰 영역 위에, 진행단계 필터는 흰 툴바 안에 둔다.
   세로 리듬은 수출·수입(.ops-board)과 같다: 머리말 → 20 → 탭 → 16 → 필터 → 16 → 표 */
.main-content:has(#tab-fta-history.active){background:#f4f5f7;}
#tab-fta-history #fta-list{display:flex;flex-direction:column;gap:16px;}
#tab-fta-history .docs-head{padding:14px 0;margin:0 0 4px;}
#tab-fta-history .docs-tabrow{display:flex;margin:0;}
#tab-fta-history .docs-tabrow .sub-tabs{width:fit-content;max-width:100%;gap:4px;padding:4px;border:0;background:#fff;overflow-x:auto;}
#tab-fta-history .docs-tabrow .sub-tab-btn{height:40px;padding:0 20px;}
#tab-fta-history .docs-toolbar{box-sizing:border-box;min-height:72px;padding:16px 20px;border:0;border-radius:24px;}
#tab-fta-history .docs-toolbar .docs-search-wrap{margin-left:auto;}
#tab-fta-history .docs-toolbar .docs-stages .docs-pill{height:36px;padding:0 14px;background:#f4f5f7;}
#tab-fta-history .docs-toolbar .docs-stages .docs-pill.on{background:#1c2433;border-color:#1c2433;}
#tab-fta-history .docs-sel{margin:0;}

/* FTA 서류작성 */
.docs-cert{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;background:#fff;border:1px solid #e5e8ec;border-radius:26px;padding:18px 24px;margin:0 0 20px;}
.docs-cert-main{display:flex;align-items:center;gap:14px;min-width:0;}
.docs-cert-ic{width:44px;height:44px;border-radius:16px;background:#f2f4f6;color:#6b7385;display:flex;align-items:center;justify-content:center;flex:none;}
.docs-cert-ic.on{background:#dfff9f;color:#1c2433;}
.docs-cert-ic svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.docs-cert-text{min-width:0;}
.docs-cert-text .docs-kicker{margin:0 0 2px;font-size:10px;}
.docs-cert-title{margin:0;font-size:16px;font-weight:700;color:#1c2433;}
.docs-cert-no{margin:2px 0 0;font-size:12px;color:#6b7385;}
.docs-cert-no:empty{display:none;}
.docs-tools{display:flex;gap:8px;flex-wrap:wrap;}
.docs-tool{display:inline-flex;align-items:center;gap:6px;height:38px;padding:0 16px;border-radius:999px;border:1px solid #dfe2e6;background:#fff;color:#1c2433;font:600 13px 'Pretendard','Noto Sans KR',sans-serif;cursor:pointer;transition:border-color .15s,background .15s;}
.docs-tool:hover:not(:disabled){border-color:#c6f54a;background:#f7ffe0;}
.docs-tool .docs-ic{color:#6b7385;}
#tab-fta #fta-cert-edit{background:#f7f8f9!important;border:1px solid #e5e8ec!important;border-radius:20px!important;margin:-8px 0 20px!important;}
#tab-fta #fta-form-selector > div{background:transparent!important;border:0!important;padding:0!important;margin-bottom:0!important;}
#tab-fta .fta-form-pick{gap:20px!important;}
#tab-fta .fta-pick{background:#1c2433!important;border:1px solid transparent!important;border-radius:26px!important;padding:26px!important;box-shadow:none;}
#tab-fta .fta-pick > div:first-child div[style*="width:36px"]{width:44px!important;height:44px!important;background:#dfff9f!important;border:0!important;border-radius:16px!important;}
#tab-fta .fta-pick svg{stroke:#1c2433!important;}
#tab-fta .fta-pick svg.docs-chk{stroke:#dfff9f!important;}
#tab-fta .fta-pick span[style*="font-size:10px"]{background:transparent!important;border-color:transparent!important;color:rgba(255,255,255,.55)!important;letter-spacing:.14em;}
#tab-fta .fta-pick h3{color:#fff!important;}
#tab-fta .fta-pick span[style*="var(--gold)"]{color:#dfff9f!important;}
.docs-chk{width:14px;height:14px;fill:none;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;vertical-align:-2px;margin-right:8px;}
#tab-fta #fta-form-selector h3{font-family:'Pretendard','Noto Sans KR',sans-serif!important;font-weight:700!important;font-size:17px!important;}
#tab-fta #fta-form-selector .card{border:1px solid #e5e8ec!important;border-radius:26px!important;background:#fff!important;box-shadow:none!important;}
#tab-fta span[onclick^="ftaGoHistoryTab"]{color:#1c2433!important;font-weight:600;}
#tab-fta #fta-agreement-selector > div:first-child{background:#1c2433!important;border-radius:26px!important;}
#tab-fta #fta-agreement-selector span[style*="color:var(--gold)"],
#tab-fta #fta-agreement-selector div[style*="color:var(--gold)"]{color:#dfff9f!important;}
#tab-fta #fta-agreement-selector > div:nth-child(2) > div{border-radius:22px!important;}
#tab-fta #fta-form-title-badge{color:#1c2433!important;}
#tab-fta #fta-back-btn,#tab-fta .btn-small{border-radius:999px;}
#tab-fta .stage-badge-임시저장{background:#f2f4f6!important;color:#6b7385!important;}
#tab-fta .stage-badge-작성완료{background:#d2e8ff!important;color:#0d1926!important;}
#tab-fta .stage-badge-검토요청중{background:#fff4d6!important;color:#8a5a00!important;}
#tab-fta .stage-badge-검토완료{background:#dfff9f!important;color:#1c2433!important;}
#tab-fta .stage-badge-임시저장,#tab-fta .stage-badge-작성완료,#tab-fta .stage-badge-검토요청중,#tab-fta .stage-badge-검토완료,
#tab-fta-history [class*="stage-badge-"],#tab-cipl [class*="stage-badge-"]{display:inline-flex;align-items:center;height:24px;padding:0 10px;border-radius:999px;font-size:12px;font-weight:600;white-space:nowrap;}
#tab-fta-history .stage-badge-임시저장,#tab-cipl .stage-badge-임시저장{background:#f2f4f6!important;color:#6b7385!important;}
#tab-fta-history .stage-badge-작성완료,#tab-cipl .stage-badge-작성완료{background:#d2e8ff!important;color:#0d1926!important;}
#tab-fta-history .stage-badge-검토요청중,#tab-cipl .stage-badge-검토요청중{background:#fff4d6!important;color:#8a5a00!important;}
#tab-fta-history .stage-badge-검토완료,#tab-cipl .stage-badge-검토완료{background:#dfff9f!important;color:#1c2433!important;}

/* 버전 말풍선: 첫 행에서 위로 잘리지 않게 아래로 */
.cipl-ver-badge{background:#f2f4f6!important;color:#1c2433!important;}
.cipl-ver-badge .cipl-ver-tip{background:#1c2433!important;border-radius:12px!important;}
.cipl-ver-badge .cipl-ver-tip::after{border-top-color:#1c2433!important;}
#tab-cipl tbody tr:first-child .cipl-ver-tip{bottom:auto!important;top:130%!important;}
#tab-cipl tbody tr:first-child .cipl-ver-tip::after{top:auto!important;bottom:100%!important;border-top-color:transparent!important;border-bottom-color:#1c2433!important;}

/* 신규 서류 선택 모달 */
.cipl-scope #newDocModal{background:rgba(28,36,51,.46);}
.cipl-scope #newDocModal > div{background:#fff!important;border-radius:28px;padding:28px 24px!important;}
.cipl-scope #newDocModal [style*="color:#ECE8E1"]{color:#1c2433!important;font-family:'Pretendard','Noto Sans KR',sans-serif!important;font-weight:700!important;}
.cipl-scope #newDocModal [style*="color:var(--gold)"]{color:#6b7385!important;}
.cipl-scope #newDocModal .nd-cancel{color:#6b7385;font-size:13px;font-weight:600;padding:8px 16px;border-radius:999px;}
.cipl-scope #newDocModal .nd-cancel:hover{background:#f2f4f6;color:#1c2433;}
.cipl-scope .newdoc-card{border-radius:22px;border-color:#e5e8ec;}
.cipl-scope .newdoc-card:hover{border-color:#c6f54a;box-shadow:none;}
.cipl-scope .newdoc-card:first-child .nd-badge{background:#d2e8ff!important;color:#0d1926!important;}
.cipl-scope .newdoc-card:last-child .nd-badge{background:#1c2433!important;color:#dfff9f!important;}
.cipl-scope [style*="Cormorant"]{font-family:'Pretendard','Noto Sans KR',sans-serif!important;font-weight:700!important;}

/* CI/PL 편집기 (흰 상단바) */
.cipl-scope #ciplModal .modal-shell{background:#f4f5f6;}
.cipl-scope #ciplModal .modal-topbar{background:#fff;border-bottom:1px solid #e5e8ec;color:#1c2433;}
.cipl-scope #ciplModal .modal-topbar::before{display:none;}
.cipl-scope #ciplModal .modal-title{font-family:'Pretendard','Noto Sans KR',sans-serif;font-size:18px;font-weight:700;color:#1c2433;}
.cipl-scope .close-btn{color:#6b7385;}
.cipl-scope .close-btn:hover{color:#1c2433;}
.cipl-scope #ciplModal .topbar-btn,
.cipl-scope #ciplModal .topbar-issue{color:#1c2433;border-color:#dfe2e6;border-radius:999px;background:#fff;}
.cipl-scope #ciplModal .topbar-btn:hover,
.cipl-scope #ciplModal .topbar-issue:hover{border-color:#1c2433;color:#1c2433;}
.cipl-scope #ciplModal .topbar-issue.main,
.cipl-scope #ciplModal .topbar-btn-main{background:#1c2433;color:#fff;border-color:#1c2433;border-radius:999px;}
.cipl-scope #ciplModal .topbar-issue.main:hover,
.cipl-scope #ciplModal .topbar-btn-main:hover{background:#0d1926;color:#fff;}
.cipl-scope #ciplConvertBtn{background:#dfff9f!important;color:#1c2433!important;border-color:#dfff9f!important;}
.cipl-scope .cipl-tab{border:1px solid #dfe2e6;background:#fff;color:#6b7385;border-radius:999px;padding:5px 14px;}
.cipl-scope .cipl-tab:hover:not(:disabled):not(.on){border-color:#1c2433;color:#1c2433;}
.cipl-scope .cipl-tab.on,.cipl-scope .settings-scope-tab.on{background:#dfff9f;color:#1c2433;border-color:#dfff9f;}
.cipl-scope .sidebar-panel{background:#fff;}
.cipl-scope .sidebar-panel [style*="color:var(--gold)"],.cipl-scope .sidebar-panel .sidebar-edit{color:#1c2433!important;}
.cipl-scope .sidebar-eyebrow,.cipl-scope .settings-section-title,.cipl-scope .ph-eyebrow{color:#6b7385;}
.cipl-scope .form-input:focus,.cipl-scope .doc-field-input:focus{border-color:#1c2433;box-shadow:0 0 0 3px rgba(198,245,74,.45);}
.cipl-scope .doc-field-input{border-color:#dfe2e6;background:#f7f8f9;}
.cipl-scope .btn-small:hover{border-color:#c6f54a;color:#1c2433;}
.cipl-scope .doc-page-area{background:#e8ebee;}
.cipl-scope .chk-row input,.cipl-scope input{accent-color:#1c2433;}
.cipl-scope .pack-guide{margin:0 0 12px;padding:14px 16px;background:#f2f4f6;border:0;border-radius:16px;font-size:12px;line-height:1.65;color:#1c2433;}
.cipl-scope .pack-guide .pack-kicker{font-size:10px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:#6b7385;}
.cipl-scope .pack-assign{border-radius:16px;overflow:hidden;}
.cipl-scope .pack-assign th{background:#f7f8f9;color:#6b7385;}
.cipl-scope .pack-assign .pack-desc{background:#f7fbe8;}
.cipl-scope .pack-pallet,.cipl-scope .pack-carton,.cipl-scope .pack-group{border-radius:16px;border-color:#e5e8ec;}
.cipl-scope .pack-pallet{background:#f7f8f9;}
.cipl-scope .pack-carton{background:#fff;padding:10px 12px;}
.cipl-scope .pack-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:8px;background:#fff;border-radius:12px;padding:8px 10px;}
.cipl-scope .pack-pallet .pack-metrics{background:#fff;}
.cipl-scope .pack-metrics dt{font-size:11px;color:#6b7385;font-weight:600;}
.cipl-scope .pack-metrics dd{margin:2px 0 0;font-size:13px;font-weight:700;color:#1c2433;}
.cipl-scope .pack-warn{margin:6px 0 0;font-size:12px;font-weight:700;color:#b3261e;}
.cipl-scope .pack-bulk .btn-small,.cipl-scope .pack-fold-btn{border-radius:999px;}
.cipl-scope .pack-spec-head .t{color:#6b7385;letter-spacing:.14em;}
.cipl-scope td.cipl-paste-on,.cipl-scope .pack-mini.cipl-paste-on .form-input{outline-color:#c6f54a;background:#f7fbe8;}

@container lounge-main (max-width:1200px){
  #tab-fta #fta-form-selector .fta-form-pick{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
}
@container lounge-main (max-width:820px){
  #tab-fta #fta-form-selector .fta-form-pick{grid-template-columns:1fr!important;}
}
@media (max-width:760px){
  .docs-head h1,#tab-fta > .card > div:first-child h1{font-size:21px;}
  .docs-search-wrap{flex:1 1 100%;}
  .docs-cert{padding:16px;}
}
