/* 공개재분류 시스템 - 기본 스타일 (기반 셋업) */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Malgun Gothic", "맑은 고딕", sans-serif;
    color: #222;
    background: #f4f6f9;
}

/* ---------- 공통 레이아웃 ---------- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 20px;
    background: #1f3a5f;
    color: #fff;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.app-header .brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.app-header .brand-icon { color: #6ea8e0; }
.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: none;
    background: transparent;
    color: #cdd8e6;
    border-radius: 4px;
    cursor: pointer;
}
.nav-toggle:hover { background: #ffffff1a; color: #fff; }
.user-box { display: flex; align-items: center; gap: 12px; }
.user-box .user-name { font-size: 14px; }
.logout-form { margin: 0; }
.btn-logout {
    padding: 6px 12px;
    border: 1px solid #ffffff66;
    background: transparent;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
}
.btn-logout:hover { background: #ffffff22; }

.app-body { display: flex; min-height: calc(100vh - 56px); }

.app-nav {
    width: 230px;
    flex-shrink: 0;
    background: #1f3a5f;
    color: #cdd8e6;
    padding: 12px 0;
    overflow-y: auto;
    transition: width .2s ease;
}
.app-nav ul { list-style: none; margin: 0; padding: 0; }
.nav-list > .nav-item { margin: 1px 0; }

/* 메뉴 링크 / 그룹 토글 공통 */
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 18px;
    color: #cdd8e6;
    text-decoration: none;
    font-size: 14px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}
.nav-link:hover { background: #2c4f7c; color: #fff; }
.nav-link.active { background: #2f6bbf; color: #fff; }
.nav-text { flex: 1; white-space: nowrap; overflow: hidden; }

/* 그룹 펼침 화살표 */
.nav-arrow { width: 16px; height: 16px; flex-shrink: 0; transition: transform .2s ease; }
.nav-group.open > .nav-group-toggle .nav-arrow { transform: rotate(90deg); }

/* 하위 메뉴 */
.nav-sub {
    max-height: 0;
    overflow: hidden;
    background: #18304e;
    transition: max-height .25s ease;
}
.nav-group.open > .nav-sub { max-height: 400px; }
.nav-sublink {
    display: block;
    padding: 10px 18px 10px 50px;
    color: #aebfd4;
    text-decoration: none;
    font-size: 13.5px;
}
.nav-sublink:hover { background: #243f63; color: #fff; }
.nav-sublink.active { color: #fff; font-weight: 600; }
.nav-sub-label {
    padding: 10px 18px 6px 50px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .04em;
    color: #6d83a3;
    text-transform: uppercase;
}

/* 사이드바 접힘 상태 */
body.nav-collapsed .app-nav { width: 0; padding: 0; overflow: hidden; }

.app-main { flex: 1; padding: 24px 32px; }

/* ---------- iframe(멀티탭) 안에서 열린 콘텐츠: 크롬 숨김 ---------- */
body.framed .app-header,
body.framed .app-nav { display: none; }
/* iframe 안에서는 콘텐츠가 프레임 높이를 꽉 채우도록 */
body.framed { height: 100vh; }
body.framed .app-body { height: 100%; min-height: 0; }

/* ---------- 멀티탭 셸 ---------- */
body.shell .app-body { height: calc(100vh - 56px); }
body.shell .app-main { padding: 0; display: flex; }

.tab-system { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.tab-bar {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    flex-wrap: wrap;
    padding: 8px 10px 0;
    background: #e9eef3;
    border-bottom: 1px solid #d4dce5;
}
.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 210px;
    padding: 8px 12px;
    background: #f1f4f8;
    color: #5a6b80;
    border: 1px solid #d4dce5;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}
.tab:hover { background: #e7edf4; }
.tab.active {
    background: #fff;
    color: #1f3a5f;
    font-weight: 600;
    box-shadow: inset 0 2px 0 #2f6bbf;
    margin-bottom: -1px;
}
.tab-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-close {
    border: none;
    background: transparent;
    color: #9aa7b8;
    font-size: 16px;
    line-height: 1;
    padding: 0 3px;
    border-radius: 3px;
    cursor: pointer;
}
.tab-close:hover { background: #d8e0ea; color: #33455c; }
/* 탭이 1개뿐이면 닫기 버튼 숨김 */
.tab-bar.single .tab-close { display: none; }

.tab-frames { position: relative; flex: 1; min-height: 0; background: #fff; }
.tab-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: none;
}
.tab-frame.active { display: block; }

/* ---------- 기록물 철/건 관리 (2패널) ---------- */
.rec-page { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.rec-breadcrumb { font-size: 12px; color: #8a97a8; margin-bottom: 4px; }
.rec-breadcrumb span { margin: 0 4px; color: #c3ccd8; }
.rec-page .page-title { margin: 0 0 14px; }

.two-panel-wrap { display: flex; gap: 14px; flex: 1; min-height: 0; }
.rec-panel {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
    border: 1px solid #e1e5ea;
    border-radius: 8px;
    overflow: hidden;
}

.rec-search { padding: 12px 14px; border-bottom: 1px solid #eef0f6; }
.sf-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.sf-label { font-size: 12px; color: #6b7280; font-weight: 600; white-space: nowrap; }
.rec-input {
    font-size: 13px;
    padding: 6px 9px;
    border: 1px solid #d3ddda;
    border-radius: 6px;
    background: #f7f9fb;
}
.rec-input:focus { outline: none; border-color: #2f6bbf; background: #fff; box-shadow: 0 0 0 3px rgba(47,107,191,.12); }
.sf-actions { display: flex; justify-content: flex-end; gap: 8px; }

.rec-btn { padding: 6px 16px; font-size: 13px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.rec-btn-primary { background: #2f6bbf; color: #fff; }
.rec-btn-primary:hover { background: #27569b; }
.rec-btn-outline { background: #fff; color: #5a6b80; border-color: #cdd5df; }
.rec-btn-outline:hover { background: #f1f4f8; }
.rec-btn-green { background: #059669; color: #fff; }
.rec-btn-green:hover { background: #047857; }
.rec-btn-danger { background: #fff; color: #c0392b; border-color: #e3b4ae; }
.rec-btn-danger:hover { background: #fdecec; }
.rec-btn-sm { padding: 5px 11px; font-size: 12px; }

.rec-actions { display: flex; gap: 6px; }
.rec-icon-btn {
    border: 1px solid #d8e0ea; background: #fff; color: #5a6b80;
    width: 26px; height: 26px; border-radius: 5px; cursor: pointer; font-size: 13px; line-height: 1;
}
.rec-icon-btn:hover { background: #eef4fc; color: #2f6bbf; border-color: #b9cdec; }

/* ── 등록/수정 모달 ── */
.rec-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 1100;
    background: rgba(0,0,0,.45); align-items: center; justify-content: center;
}
.rec-modal-overlay.show { display: flex; }
/* 선택 팝업(부서/단위과제)은 등록/수정 모달 위에 뜨도록 */
#orgPickerModal, #clssPickerModal { z-index: 1200; }
.rec-modal {
    background: #fff; border-radius: 12px; width: 440px; max-width: 94vw;
    box-shadow: 0 10px 36px rgba(0,0,0,.22); display: flex; flex-direction: column; overflow: hidden;
}
.rec-modal.rec-modal-lg { width: 560px; }
.rec-form-2 { display: flex; gap: 12px; }
.rec-form-2 > .rec-form-row { flex: 1; min-width: 0; }

/* 클릭 선택 입력(읽기전용) */
.rec-input.rec-picker { background: #f3f6fa; cursor: pointer; }

/* 선택 목록(생산부서 등) */
.rec-picker-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; border: 1px solid #e5e9f0; border-radius: 8px; }
.rec-picker-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; font-size: 13px; color: #33455c; cursor: pointer; border-bottom: 1px solid #f0f2f5; }
.rec-picker-item:last-child { border-bottom: none; }
.rec-picker-item:hover { background: #eef4fc; }
.rec-picker-cd { font-size: 11px; color: #9aabcc; }
.rec-picker-empty { padding: 20px; text-align: center; color: #9aabcc; font-size: 12px; }
.rec-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid #eef0f6;
    font-size: 15px; font-weight: 700; color: #1f3a5f;
}
.rec-modal-close { border: none; background: none; cursor: pointer; font-size: 15px; color: #9aabcc; padding: 4px; }
.rec-modal-close:hover { color: #374151; }
.rec-modal-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.rec-form-row { display: flex; flex-direction: column; gap: 5px; }
.rec-form-row label { font-size: 12px; font-weight: 600; color: #4b5563; }
.rec-form-row label em { color: #c0392b; font-style: normal; }
.rec-form-row .rec-input { width: 100%; }
.rec-modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 18px; border-top: 1px solid #eef0f6; background: #fafbfc;
}

/* 폼 섹션 구분선 */
.rec-section {
    font-size: 12px; font-weight: 700; color: #132244;
    margin: 6px 0 2px; padding-bottom: 5px; border-bottom: 1px solid #e5e9f0;
}
/* 비공개호수 체크박스 그룹 */
.rec-ho-group { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 4px 0; }
.rec-ho-group label { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; color: #374151; cursor: pointer; }
textarea.rec-input { resize: vertical; min-height: 56px; font-family: inherit; }

/* 첨부파일 드롭/목록 */
.rec-filedrop {
    border: 2px dashed #d1d5db; border-radius: 8px; padding: 18px;
    text-align: center; color: #9aabcc; font-size: 12.5px; cursor: pointer; transition: border-color .15s, color .15s;
}
.rec-filedrop:hover, .rec-filedrop.drag { border-color: #2f6bbf; color: #2f6bbf; }
.rec-attach-list { list-style: none; margin: 10px 0 0; padding: 0; }
.rec-attach-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; margin-bottom: 6px;
    background: #f8fafc; border: 1px solid #e5e9f0; border-radius: 6px;
}
.rec-attach-item.pending { opacity: .75; }
.rec-attach-nm { flex: 1; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #33455c; }
.rec-attach-size { font-size: 11px; color: #9aabcc; white-space: nowrap; }
.rec-attach-del { border: none; background: none; cursor: pointer; color: #c0392b; font-size: 13px; padding: 2px 4px; }
.rec-attach-del:hover { color: #922b21; }
.rec-attach-empty { list-style: none; text-align: center; padding: 16px; color: #9aabcc; font-size: 12px; }

.rec-table-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid #eef0f6; }
.rec-table-title { font-size: 13px; font-weight: 700; color: #1f3a5f; }
.rec-folder-label { font-size: 12px; color: #2f6bbf; font-weight: 600; margin-left: 4px; }
.rec-sub-label { font-size: 12px; color: #6b7280; font-weight: 500; margin-left: 4px; }

.rec-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.rec-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.rec-table thead th {
    position: sticky; top: 0;
    background: #f4f6f9; color: #5a6b80; font-weight: 600; font-size: 12px;
    padding: 9px 8px; border-bottom: 1px solid #e1e5ea; text-align: center;
}
.rec-table tbody td { padding: 9px 8px; border-bottom: 1px solid #f0f2f5; text-align: center; color: #33455c; }
.rec-table td.td-left { text-align: left; }
.rec-table td.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-row { cursor: pointer; }
.rec-row:hover { background: #f6f9fe; }
.rec-table tbody tr.selected { background: #eaf2ff; }
.rec-table tbody tr.selected td { color: #1d4ed8; font-weight: 600; }
.rec-msg { text-align: center; color: #9aabcc; padding: 24px; }
.rec-msg.err { color: #c0392b; }

.rec-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: #eef1f5; color: #5a6b80; }
.rec-badge.open { background: #e7f6ec; color: #1e7d44; }
.rec-badge.partial { background: #fff3e0; color: #b9710a; }
.rec-badge.closed { background: #fdecec; color: #c0392b; }

.rec-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 8px; color: #9aabcc; font-size: 13px; }
.rec-empty-icon { font-size: 30px; }

.rec-paging-wrap { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-top: 1px solid #eef0f6; flex-shrink: 0; }
.rec-pagination { display: flex; gap: 3px; }
.rec-page-btn { min-width: 28px; height: 28px; padding: 0 6px; border: 1px solid #d8e0ea; background: #fff; border-radius: 5px; font-size: 12px; cursor: pointer; color: #5a6b80; }
.rec-page-btn:hover:not(.disabled):not(.active) { background: #f1f4f8; }
.rec-page-btn.active { background: #2f6bbf; color: #fff; border-color: #2f6bbf; }
.rec-page-btn.disabled { color: #c3ccd8; cursor: default; }
.rec-ellip { padding: 0 4px; color: #9aabcc; }
.rec-pagesize { font-size: 12px; color: #6b7280; display: flex; align-items: center; gap: 6px; }
.rec-pagesize select { font-size: 12px; padding: 3px 6px; border: 1px solid #d3ddda; border-radius: 5px; }

/* ---------- 공개재분류 심사 ---------- */
.rv-search { background: #fff; border: 1px solid #e1e5ea; border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; }
/* 테두리 표 형태 검색폼 (8칸 = 라벨1 + 입력2) */
.sf-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sf-table th, .sf-table td { padding: 6px 10px; border: 1px solid #e2e8f0; vertical-align: middle; font-size: 12.5px; }
.sf-table th { background: #f4f7fb; color: #4a5568; font-weight: 600; text-align: center; white-space: nowrap; width: 8.33%; }
.sf-table td { background: #fff; width: 16.67%; }
.sf-table .rec-input { font-size: 12.5px; padding: 6px 8px; width: 100%; }
.sf-table select.rec-input { width: 100%; }
.sf-radio { display: flex; align-items: center; gap: 16px; }
.sf-radio label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: #374151; cursor: pointer; }
.sf-radio small { color: #9aabcc; font-size: 11px; }
.sf-range { display: flex; align-items: center; gap: 6px; }
.sf-range .rec-input { width: 0; flex: 1; }
.sf-pick { display: flex; align-items: center; gap: 6px; }
.sf-pick .rec-input { flex: 1; min-width: 0; }
.rec-clear { flex-shrink: 0; padding: 6px 9px; border: 1px solid #cdd5df; background: #f1f4f8; border-radius: 6px; cursor: pointer; color: #5a6b80; font-size: 11px; }
.rec-clear:hover { background: #e2e8f0; }

.rv-search-btns { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.btn-detail-toggle { padding: 6px 14px; background: #fff; border: 1px solid #cbd5e0; border-radius: 6px; cursor: pointer; color: #4a5568; font-size: 12.5px; }
.btn-detail-toggle:hover { background: #f1f5f9; }
.btn-detail-toggle.active { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }

.rv-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 12px; }
.rv-card { border: 1px solid #e1e5ea; border-radius: 10px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff; }
.rv-card-txt { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: #5a6b80; }
.rv-card-label { font-weight: 600; }
.rv-card-txt b { font-size: 22px; color: #1f3a5f; margin-right: 2px; }
.rv-card-ic { font-size: 22px; opacity: .9; }
.rv-card.c-total { background: #eff4ff; border-color: #dbe6fb; }
.rv-card.c-s1 { background: #f7f9fc; }
.rv-card.c-s2 { background: #fffaf0; border-color: #f7e6c8; }
.rv-card.c-s2 b { color: #b9710a; }
.rv-card.c-s3 { background: #f0faf4; border-color: #cdeed8; }
.rv-card.c-s3 b { color: #1e7d44; }
.rv-card.c-s4 { background: #f1f5fd; border-color: #d8e3f7; }
.rv-card.c-s4 b { color: #2f6bbf; }
.rv-card.c-s5 { background: #f7f2fe; border-color: #e6d8fb; }
.rv-card.c-s5 b { color: #7c3aed; }

/* ── 의견등록 2단 모달 ── */
.rec-modal.op-modal { width: 1400px; max-width: 96vw; }
.op-body { display: flex; gap: 12px; padding: 14px; max-height: 72vh; overflow-y: auto; background: #f8fafc; }
.op-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.op-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.op-card-head { padding: 8px 14px; font-size: 12.5px; font-weight: 700; color: #132244; border-bottom: 1px solid #e2e8f0; }
.op-card-head.head-dept { background: #f0f9ff; }
.op-card-head.head-ai { background: #f5f3ff; }
.op-card-head.head-user { background: #f0fdf4; }
.op-ft { width: 100%; border-collapse: collapse; table-layout: fixed; height: 175px; }
.op-ft th, .op-ft td { padding: 6px 8px; border: 1px solid #e2e8f0; font-size: 12px; vertical-align: middle; word-break: break-word; }
.op-ft th { background: #f4f7fb; color: #4a5568; font-weight: 600; white-space: nowrap; width: 92px; }
.op-ft td { background: #fff; }
.op-ft th.req::after { content: ' *'; color: #ef4444; }
.op-ft .rec-input { width: 100%; font-size: 12px; padding: 5px 7px; }
.op-ft input[type="date"].rec-input { width: 160px; }
.op-ft textarea.rec-input { resize: vertical; min-height: 70px; }
.op-chk { display: flex; flex-wrap: wrap; gap: 4px 9px; align-items: center; }
.op-chk label { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; cursor: pointer; white-space: nowrap; }

.page-title { font-size: 22px; margin: 0 0 16px; }
.welcome { margin-bottom: 16px; }
.card {
    background: #fff;
    border: 1px solid #e1e5ea;
    border-radius: 6px;
    padding: 20px;
    line-height: 1.7;
}
.error-message { color: #c0392b; }

/* ---------- 로그인 (청록 테마) ---------- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0e2a2c 0%, #143d3b 55%, #1b4f49 100%);
}
.login-box {
    width: 400px;
    background: linear-gradient(180deg, #ffffff 0%, #f3faf8 100%);
    border: 1px solid #d6e6e2;
    border-radius: 14px;
    padding: 44px 40px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}
.login-title {
    font-size: 30px;
    font-weight: 800;
    text-align: center;
    margin: 0 0 8px;
    color: #16302e;
}
.login-subtitle {
    text-align: center;
    margin: 0 0 28px;
    font-size: 14px;
    color: #7c8a87;
}
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e3b;
}
.form-group input,
.form-group select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #d3ddda;
    border-radius: 8px;
    font-size: 15px;
    background: #f7f9f9;
    transition: border-color .15s, box-shadow .15s;
}
.form-group select { height: 48px; }
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1aa085;
    box-shadow: 0 0 0 3px rgba(26, 160, 133, 0.15);
    background: #fff;
}
.btn-login {
    width: 100%;
    padding: 14px;
    margin-top: 6px;
    background: #1a9e8b;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.btn-login:hover { background: #15846f; }

/* 하단 링크 (준비중 placeholder) */
.login-links { margin-top: 22px; text-align: center; }
.login-links p { margin: 8px 0; font-size: 13px; color: #7c8a87; }
.login-links a { color: #5b6b68; text-decoration: none; }
.login-links a:hover { text-decoration: underline; }
.login-links .link-strong { color: #15846f; font-weight: 700; }
.login-links .sep { margin: 0 10px; color: #c4d0cd; }

.alert { padding: 11px 13px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.alert-error { background: #fdecea; color: #c0392b; border: 1px solid #f5c6cb; }
.alert-info { background: #e7f6f2; color: #15846f; border: 1px solid #b9e3da; }
.alert-success { background: #e7f6ec; color: #1e7d44; border: 1px solid #bce3cb; }
