* { font-family: 'Malgun Gothic', '맑은 고딕', sans-serif; font-size: 12px; box-sizing: border-box; margin: 0; padding: 0; }
body { background: #f0f0f0; min-width: 1400px; overflow-x: auto; }
/* GNB */
#hd { background: #1a4a8a; position: sticky; top: 0; z-index: 1000; }
.gnb-inner { padding: 0 20px; }
.menubar { display: flex; flex-wrap: nowrap; align-items: center; background: #2563a8; padding: 0; min-height: 36px; position: relative; z-index: 200; overflow: visible; }
.menu-item { position: relative; flex-shrink: 0; }
.menu-item > a { color: #cce0ff; padding: 8px 14px; border-radius: 3px; text-decoration: none; white-space: nowrap; font-weight: bold; display: flex; align-items: center; gap: 4px; line-height: 36px; }
.menu-item > a:hover, .menu-item > a.active { background: #4fdfd0; color: #000; }
.menu-item > a.has-sub::after { content: " ▾"; font-size: 9px; opacity: 0.8; }
.submenu { display: none; position: absolute; top: 100%; left: 0; background: #1a3a6a; min-width: 140px; border-radius: 0 0 4px 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.35); z-index: 1001; }
.menu-item:hover .submenu { display: block; }
.submenu a { display: block; color: #cce0ff; padding: 8px 16px; text-decoration: none; white-space: nowrap; font-size: 12px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.submenu a:last-child { border-bottom: none; }
.submenu a:hover { background: #4fdfd0; color: #000; }
.menubar-login { margin-left: auto; display: flex; align-items: center; gap: 10px; color: #cce0ff; padding: 0 14px; white-space: nowrap; }
.menubar-login a { color: #cce0ff; text-decoration: none; font-size: 12px; font-weight: bold; padding: 4px 8px; border-radius: 3px; }
.menubar-login a:hover { background: #4fdfd0; color: #000; }
/* 로더 */
#loader { display: none; position: fixed; inset: 0; background: rgba(255,255,255,.5); z-index: 9998; align-items: center; justify-content: center; }
#loader.show { display: flex; }
#loader::after { content: ''; width: 36px; height: 36px; border: 4px solid #ccc; border-top-color: #3366cc; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* 토스트 */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #333; color: #fff; padding: 8px 20px; border-radius: 6px; font-size: 12px; z-index: 9999; opacity: 0; transition: opacity .3s; pointer-events: none; white-space: nowrap; }
#toast.show { opacity: 1; }
#toast.err { background: #cc3333; }
/* 레이아웃 — 3단 세로 */
.counsel-wrap { display: flex; flex-direction: column; height: calc(100vh - 36px); overflow: hidden; }
/* 1단: 검색바 */
.cs-search-bar { background: #6699cc; padding: 6px 8px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; flex-shrink: 0; }
.cs-search-label { background: #83ddd2; color: #000; padding: 3px 8px; font-weight: bold; white-space: nowrap; border-radius: 2px; font-size: 11px; }
.cs-search-bar input, .cs-search-bar select { height: 24px; border: 1px solid #aaa; padding: 0 6px; font-size: 12px; border-radius: 2px; background: #fff; }
.cs-search-btn { padding: 3px 10px; background: #3366cc; color: #fff; border: none; border-radius: 3px; cursor: pointer; font-size: 12px; font-weight: bold; }
.cs-search-btn:hover { background: #2255bb; }
.cs-reset-btn { padding: 3px 10px; background: #ff9900; color: #fff; border: none; border-radius: 3px; cursor: pointer; font-size: 12px; font-weight: bold; }
.cs-reset-btn:hover { background: #ee8800; }
/* 2단: 입력폼 */
.cs-form-section { background: #fff; border-bottom: 2px solid #3a6bbf; flex-shrink: 0; }
.cs-form-header { background: #3366cc; color: #fff; padding: 5px 12px; font-weight: bold; font-size: 12px; display: flex; align-items: center; gap: 6px; }
/* 필드 라벨 */
.cs-lbl { font-size: 11px; font-weight: bold; background: #83ddd2; color: #000; padding: 2px 6px; border-radius: 2px; white-space: nowrap; }
.cs-inp { font-size: 12px; border: 1px solid #aaa; border-radius: 2px; padding: 2px 5px; background: #fff; }
/* 등록자/수정자 */
.cs-reg-info { font-size: 10px; color: #888; }
/* 버튼 */
.cs-btn { padding: 3px 10px; border: none; border-radius: 3px; cursor: pointer; font-size: 12px; font-weight: bold; color: #fff; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.cs-btn-new { background: #4488cc; } .cs-btn-new:hover { background: #3377bb; }
.cs-btn-save { background: #4488cc; } .cs-btn-save:hover { background: #3377bb; }
.cs-btn-del { background: #cc3333; } .cs-btn-del:hover { background: #bb2222; }
.cs-btn-del:disabled { background: #ccc; cursor: not-allowed; }
.cs-btn-col { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; padding: 6px 8px; border-left: 1px solid #dde8ff; border-right: 1px solid #dde8ff; background: #f4f8ff; justify-content: center; }
/* 처리내역 */
/* 댓글 영역 */
.cs-reply-section { flex: 1; min-width: 0; overflow: hidden; }
#cs-reply-list { }
#cs-reply-input { width: 100%; font-size: 11px; border: none; outline: none; padding: 2px 4px; }
/* 3단: 목록 */
.cs-list-section { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.cs-list-header { background: #3366cc; color: #fff; padding: 5px 12px; font-weight: bold; font-size: 12px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.cs-list-toolbar { background: #e8f0ff; border-bottom: 1px solid #b0c8ef; padding: 4px 10px; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cs-pg-sel { font-size: 12px; border: 1px solid #aaa; border-radius: 2px; padding: 2px 4px; }
.cs-bulk-del { padding: 3px 10px; background: #cc3333; color: #fff; border: none; border-radius: 3px; cursor: pointer; font-size: 11px; font-weight: bold; }
.cs-bulk-del:disabled { background: #ccc; cursor: not-allowed; }
.cs-list-body { flex: 1; overflow-y: auto; overflow-x: auto; }
/* 테이블 */
table.cs-table { width: max-content; border-collapse: collapse; font-size: 11px; table-layout: fixed; }
table.cs-table thead { position: sticky; top: 0; z-index: 2; }
table.cs-table th { background: #3366cc; color: #fff; padding: 5px 6px; border: 1px solid #2255aa; text-align: center; white-space: nowrap; cursor: pointer; user-select: none; position: relative; overflow: hidden; }
table.cs-table th:hover { background: #4477dd; }
table.cs-table td { padding: 4px 6px; border: 1px solid #ddd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 0; }
table.cs-table tr:nth-child(even) { background: #f8f8ff; }
table.cs-table tr:hover td { background: #e8f4ff !important; cursor: pointer; }
table.cs-table tr.cs-selected td { background: #ccffcc !important; }
/* 페이지네이션 */
.cs-pagination { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 6px; border-top: 1px solid #ddd; flex-shrink: 0; background: #fff; }
.cs-page-btn { padding: 3px 9px; border: 1px solid #aaa; border-radius: 3px; background: #fff; cursor: pointer; font-size: 11px; }
.cs-page-btn.active { background: #3366cc; color: #fff; border-color: #3366cc; }
.cs-page-btn:hover:not(.active) { background: #e8f4ff; }
/* 비연결 배지 */
.cs-unlinked-badge { font-size: 9px; background: #ff9900; color: #fff; border-radius: 2px; padding: 1px 4px; margin-left: 3px; vertical-align: middle; }
/* 컬럼 리사이저 핸들 */
.col-resizer { position: absolute; right: 0; top: 0; width: 5px; height: 100%; cursor: col-resize; user-select: none; z-index: 10; }
.col-resizer:hover, .col-resizer.dragging { background: rgba(255,255,255,0.5); }
/* 스크롤바 */
.scrollbar-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollbar-thin::-webkit-scrollbar-track { background: #f1f1f1; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #999; border-radius: 3px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #3366cc; }
