  * { font-family: 'Malgun Gothic', '맑은 고딕', sans-serif; font-size: 12px; }
  html, body { height: 100%; }
  body { background: #f0f0f0; margin: 0; padding: 0; min-width: 1880px; display: flex; flex-direction: column; }
  
  /* Header */
  #hd { background: #1a4a8a; position: sticky; top: 0; left: 0; right: 0; z-index: 1000; }
  #gnb { background: #1a4a8a; }
  .gnb-inner { width: 100%; padding: 0 20px; box-sizing: border-box; }
  
  /* 메뉴바 */
  .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-divider { width: 1px; height: 20px; background: #4a7ac0; margin: 0 4px; }
  /* 로그인 정보 (메뉴바 우측) */
  .menubar-login { margin-left: auto; display: flex; align-items: center; gap: 10px; color: #cce0ff; padding: 0 14px; white-space: nowrap; }
  .menubar-login .login-user { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: bold; }
  .menubar-login .login-user i { font-size: 16px; color: #7fb8ff; }
  .menubar-login .login-sep { color: #4a7ac0; font-size: 13px; }
  .menubar-login a { color: #cce0ff; text-decoration: none; font-size: 12px; font-weight: bold; display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 3px; }
  .menubar-login a:hover { background: #4fdfd0; color: #000; }
  .menubar-login .btn-logout { color: #ffaaaa !important; }
  .menubar-login .btn-logout:hover { background: #cc3333 !important; color: #fff !important; }
  
  /* Search Area */
  .search-panel-wrap { overflow-x: auto; margin-bottom: 15px; }
  .search-panel { background: #6699cc; padding: 6px 8px; border-radius: 4px; display: flex; flex-wrap: nowrap; gap: 4px; align-items: center; overflow: visible; min-width: max-content; }
  .search-group { display: flex; flex-wrap: nowrap; gap: 4px; align-items: center; flex-shrink: 0; }
  .search-group + .search-group { margin-left: 56px; padding-left: 56px; border-left: 3px solid #3a6bbf; }
  .search-group-label { background: #206cb9; color: #fff; padding: 4px 10px; font-weight: bold; border-radius: 2px; white-space: nowrap; flex-shrink: 0; font-size: 12px; }
  .search-row { display: flex; gap: 4px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
  .search-label { background: #83ddd2; padding: 3px 8px; font-weight: bold; white-space: nowrap; border-radius: 2px; }
  .search-input { height: 24px; border: 1px solid #aaa; padding: 0 6px; font-size: 12px; border-radius: 2px; }
  .search-select { height: 24px; border: 1px solid #aaa; padding: 0 2px; font-size: 12px; border-radius: 2px; }
  
  /* Buttons */
  .btn { padding: 3px 10px; border: none; border-radius: 3px; cursor: pointer; font-size: 12px; font-weight: bold; }
  .btn-search { background: #3366cc; color: #fff; }
  .btn-search:hover { background: #2255bb; }
  .btn-reset { background: #ff9900; color: #fff; }
  .btn-reset:hover { background: #ee8800; }
  .btn-blue { background: #4488cc; color: #fff; }
  .btn-blue:hover { background: #3377bb; }
  .btn-red { background: #cc3333; color: #fff; }
  .btn-red:hover { background: #bb2222; }
  .btn-green { background: #33aa66; color: #fff; }
  .btn-green:hover { background: #229955; }
  .btn-sm { padding: 2px 8px; font-size: 11px; }
  .btn-img-del { background: none; border: none; padding: 0; cursor: pointer; display:inline-flex; align-items:center; }
  .btn-img-del:hover { opacity: 0.8; }
  .btn-del-row { background: #c0392b; color: #fff; border: none; border-radius: 3px; cursor: pointer; }
  .btn-del-row:hover { background: #a93226; }
  
  /* Info Panel */
  .info-panel { background: #fff; border: 1px solid #ccc; border-radius: 4px; margin-bottom: 6px; }
  .info-panel-header { background: #e8f0ff; padding: 6px 10px; border-bottom: 1px solid #ccc; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
  .info-panel-body { padding: 8px; }

  /* ── 블럭 구분 ── */
  .section-block-1 {
    border: 2px solid #3a6bbf;
    border-radius: 5px;
    margin-bottom: 15px;
    background: #f4f8ff;
    padding: 3px 4px 2px 4px;
    box-shadow: 0 1px 4px rgba(58,107,191,0.10);
  }
  .section-block-2 {
    border: 2px solid #27a87c;
    border-radius: 5px;
    margin-bottom: 4px;
    background: #f2fcf8;
    padding: 3px 4px 3px 4px;
    box-shadow: 0 1px 4px rgba(39,168,124,0.10);
    flex: 1; display: flex; flex-direction: column; min-height: 0;
  }
  .section-block-1 .info-panel,
  .section-block-2 .info-panel { margin-bottom: 3px; }
  .section-block-1 .info-panel:last-child,
  .section-block-2 .info-panel:last-child { margin-bottom: 0; }
  /* 블럭 내부 info-panel 헤더/바디 압축 */
  .section-block-1 .info-panel-header,
  .section-block-2 .info-panel-header { padding: 4px 8px; }
  .section-block-1 .info-panel-body,
  .section-block-2 .info-panel-body { padding: 4px 6px; }
  /* 상품리스트 패널(section-block-2 마지막 info-panel)이 남은 공간을 모두 채움 */
  .section-block-2 .info-panel:last-child { flex: 1; display: flex; flex-direction: column; min-height: 0; }
  .section-block-2 .info-panel:last-child .info-panel-body { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 5px; }
  #service-list-wrap { flex: 1; min-height: 0; overflow-y: auto; overflow-x: auto; }
  /* thead + 입력폼행 + 구분선 sticky 고정 */
  #service-table thead { position: sticky; top: 0; z-index: 4; }
  #ir_input_body tr  { position: sticky; z-index: 3; background: #fffde7; }
  #ir_divider_body tr { position: sticky; z-index: 3; }

  /* ── 상담이력 블럭 ── */
  .section-block-3 {
    border: 2px solid #3a6bbf;
    border-radius: 5px;
    margin-top: 8px;
    margin-bottom: 4px;
    background: #f4f8ff;
    padding: 3px 4px 3px 4px;
    box-shadow: 0 1px 4px rgba(58,107,191,0.10);
  }
  .section-block-3 .info-panel { margin-bottom: 3px; }
  .section-block-3 .info-panel:last-child { margin-bottom: 0; }
  .section-block-3 .info-panel-header { padding: 4px 8px; background: #e8f0ff; border-bottom: 1px solid #b0c8ef; }
  .section-block-3 .info-panel-body { padding: 6px 8px; }
  /* 상담 입력폼 — cs-* 클래스 재사용 (통합상담관리와 동일) */
  #consult-form-wrap { margin-bottom: 6px; }
  /* 상담 리스트 테이블 */
  .consult-list-table { width: 100%; border-collapse: collapse; font-size: 11px; }
  .consult-list-table thead { position: sticky; top: 0; z-index: 2; }
  .consult-list-table th { background: #3366cc; color: #fff; padding: 4px 6px; border: 1px solid #2255aa; text-align: center; white-space: nowrap; }
  .consult-list-table td { padding: 3px 5px; border: 1px solid #ddd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
  .consult-list-table tr:hover td { background: #e8f4ff !important; cursor: pointer; }
  .consult-list-table tr.csl-selected td { background: #ccffcc !important; }
  /* 상담 댓글 영역 */
  #consult-reply-list { }
  #consult-reply-input { width: 100%; font-size: 11px; border: none; outline: none; padding: 2px 4px; }

  /* Table */
  table.info-table { width: 100%; border-collapse: collapse; font-size: 12px; }
  table.info-table th { background: #dde8ff; padding: 4px 8px; border: 1px solid #bbb; text-align: center; white-space: nowrap; font-weight: bold; }
  table.info-table td { padding: 3px 6px; border: 1px solid #ddd; background: #fff; }
  
  /* Service List */
  .list-table { width: 100%; border-collapse: collapse; font-size: 11px; }
  .list-table thead { position: sticky; top: 0; z-index: 2; will-change: transform; }
  .list-table th { background: #3366cc; color: #fff; padding: 4px 6px; border: 1px solid #2255aa; text-align: center; white-space: nowrap; position: relative; cursor: pointer; overflow: visible; text-overflow: ellipsis; height: 32px; box-sizing: border-box; }
  .list-table th:hover { background: #4477dd; }
  .list-table td { padding: 3px 5px; border: 1px solid #ddd; white-space: nowrap; }
  .list-table tr:hover td { background: #e8f4ff !important; }
  .list-table tr.selected td { background: #b6f5c8 !important; border-color: #7ee8a2 !important; }
  .list-table tr:nth-child(even) { background: #f8f8ff; }
  .list-table th[data-col="charge"],  .list-table td[data-col="charge"],
  .list-table th[data-col="join"],    .list-table td[data-col="join"],
  .list-table th[data-col="product"], .list-table td[data-col="product"],
  .list-table th[data-col="gear2"],   .list-table td[data-col="gear2"] { padding-left: 2px; padding-right: 2px; }
  /* 컬럼 드래그 리사이저 */
  .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); }
  .ji-resize-handle:hover, .ji-resize-handle.dragging { background: linear-gradient(#3366cc,#3366cc) center/2px 80% no-repeat !important; }
  .info-table td, .info-table th { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .list-table td input.ir-f, .list-table td select.ir-f { max-width:100%; width:100%; box-sizing:border-box; }
  .list-table td input[type=date].ir-f { max-width:100%; width:100%; box-sizing:border-box; font-size:10px; }
  /* 필수 필드 표시: 기본은 마킹만, 저장 오류 시 req-error 추가 */
  .ir-f.req-error { border:1.5px solid #e53e3e !important; background:#fff5f5 !important; }
  .ir-f.req-error:focus { border-color:#c53030 !important; outline:none; box-shadow:0 0 0 2px rgba(229,62,62,0.2); }

  /* ── 3개 tbody 공통: input/select 완전 투명 (border 없음, 포커스 시만 박스 복원) ── */
  #ir_input_body input.ir-f,
  #ir_input_body select.ir-f,
  #ir_copy_body input.ir-f,
  #ir_copy_body select.ir-f,
  #service-list-body input.ir-f,
  #service-list-body select.ir-f {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 1px 2px;
    outline: none;
    box-shadow: none;
    transition: border-color .15s, background .15s;
  }
  #ir_input_body input.ir-f:focus,
  #ir_input_body select.ir-f:focus,
  #ir_copy_body input.ir-f:focus,
  #ir_copy_body select.ir-f:focus,
  #service-list-body input.ir-f:focus,
  #service-list-body select.ir-f:focus {
    border: 1px solid #4a7fcb;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(74,127,203,0.15);
  }
  /* date input은 브라우저 기본 아이콘 영역 감안해 패딩 최소화 */
  #ir_input_body input[type=date].ir-f,
  #ir_copy_body input[type=date].ir-f,
  #service-list-body input[type=date].ir-f { padding: 0 1px; }
  
  /* State badges */
  .state-badge { padding: 1px 6px; border-radius: 10px; font-size: 10px; font-weight: bold; }
  .state-open { background: #ccffcc; color: #006600; }
  .state-sub { background: #ffffcc; color: #666600; }
  .state-close { background: #ffcccc; color: #660000; }
  .state-cancel { background: #e0e0e0; color: #444; }
  .state-rent { background: #ffe0cc; color: #884400; }
  .state-reagree { background: #cce0ff; color: #003388; }
  
  /* Search result modal */
  #search-modal-bg { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.45); z-index:9998; align-items:flex-start; justify-content:center; padding-top:80px; }
  #search-modal-bg.open { display:flex; }
  #search-modal-box { background:#fff; border-radius:8px; box-shadow:0 8px 32px rgba(0,0,0,0.25); width:440px; max-width:92vw; max-height:65vh; display:flex; flex-direction:column; overflow:hidden; }
  #search-modal-header { background:#4fdfd0; padding:10px 16px; font-weight:bold; font-size:14px; display:flex; align-items:center; justify-content:space-between; flex-shrink:0; }
  #search-modal-header .smh-title { display:flex; align-items:center; gap:8px; }
  #search-modal-close { background:none; border:none; font-size:20px; cursor:pointer; color:#1a4a8a; line-height:1; padding:0 4px; font-weight:bold; }
  #search-modal-close:hover { color:#e53e3e; }
  #search-modal-list { overflow-y:auto; flex:1; }
  .sidebar-item { padding:10px 16px; border-bottom:1px solid #eee; cursor:pointer; display:flex; align-items:center; gap:8px; font-size:13px; transition:background .1s; }
  .sidebar-item:hover { background:#e8f8f8; }
  .sidebar-item .si-name { color:#1a4a8a; font-weight:bold; }
  .sidebar-item .si-biz { color:#999; font-size:11px; margin-left:auto; }

  /* Main content */
  #main-content { margin-top: 0; padding: 6px 12px; flex: 1; display: flex; flex-direction: column; min-height: 0; }
  
  /* Scrollable list */
  .scroll-list { overflow-y: auto; overflow-x: auto; }
  
  /* Loading */
  #loading { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,0.6); color: #fff; padding: 20px 30px; border-radius: 8px; z-index: 99999; font-size: 14px; }
  
  /* Product count */
  .product-count-badge { display: inline-block; background: #3366cc; color: #fff; padding: 2px 8px; border-radius: 3px; margin: 2px; font-size: 11px; }
  .product-count-badge.state-close { background: #cc3333; }
  .product-count-badge.state-sub { background: #999900; }
  .cnt-section { display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px 1px 0; border-right: 1px solid #ccc; margin-right: 6px; }
  .cnt-section:last-child { border-right: none; margin-right: 0; }
  .cnt-section-label { font-size: 11px; font-weight: bold; color: #2563a8; background: #e8f0fb; border: 1px solid #b0c8ef; border-radius: 3px; padding: 1px 7px; margin-right: 3px; white-space: nowrap; }

  .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; }
  textarea { resize: vertical; }
  /* ── 파트너 검색 드롭다운 ── */
  .ptn-wrap{position:relative;width:100%;}
  .ptn-display{display:flex;align-items:center;background:#fff;border:1px solid #ccc;border-radius:3px;padding:1px 4px;cursor:pointer;min-height:22px;font-size:11px;gap:3px;}
  .ptn-display:hover{border-color:#3366cc;}
  .ptn-display .ptn-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#333;}
  .ptn-display .ptn-label.empty{color:#aaa;}

  .ptn-display .ptn-arrow{flex-shrink:0;color:#888;font-size:9px;}
  .ptn-dropdown{display:none;position:absolute;top:calc(100% + 2px);left:0;min-width:160px;max-width:260px;background:#fff;border:1px solid #aaa;border-radius:4px;box-shadow:0 4px 12px rgba(0,0,0,0.18);z-index:3000;padding:4px 0;}
  .ptn-dropdown.open{display:block;}
  .ptn-search-wrap{padding:4px 6px 3px;}
  .ptn-search-input{width:100%;box-sizing:border-box;border:1px solid #bbb;border-radius:3px;padding:3px 6px;font-size:11px;}
  .ptn-search-input:focus{outline:1px solid #3366cc;border-color:#3366cc;}
  .ptn-list{max-height:160px;overflow-y:auto;}
  .ptn-item{padding:4px 10px;font-size:11px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .ptn-item:hover,.ptn-item.focused{background:#e8f0fe;}
  .ptn-item.selected{background:#ddeeff;font-weight:bold;}
  .ptn-empty{padding:6px 10px;font-size:11px;color:#aaa;text-align:center;}
  .ptn-group-header{padding:4px 8px 2px;font-size:10px;font-weight:bold;color:#555;background:#f4f4f4;border-top:1px solid #e0e0e0;border-bottom:1px solid #e8e8e8;cursor:pointer;user-select:none;display:flex;align-items:center;gap:4px;}
  .ptn-group-header:first-child{border-top:none;}
  .ptn-group-header:hover{background:#eaeaea;}
  .ptn-group-body{}
  .ptn-group-body.collapsed{display:none;}
  .ptn-unreg-badge{display:inline-block;font-size:9px;background:#e0e0e0;color:#666;border-radius:2px;padding:0 4px;margin-left:4px;vertical-align:middle;}

  /* 입력폼 ↔ 복사행/리스트 영역 5px 구분: HTML에 ir_divider_body 삽입 */
  .ir-section-divider td {
    height: 6px;
    padding: 0;
    border: none;
    background: #d0daf0;
  }
  .btn-row-reset{background:none;border:none;cursor:pointer;padding:0;color:#555;font-size:10px;line-height:1;}
  .btn-row-reset:hover{color:#1a4a8a;}
  /* 선택일괄변경 헤더 체크박스 */
  .ir-col-header{user-select:none;position:relative;}
  .ir-fld-label{display:flex;flex-direction:column;align-items:center;gap:1px;cursor:pointer;font-size:11px;line-height:1.2;}
  .ir-fld-label input[type=checkbox]{margin:0;cursor:pointer;accent-color:#d97706;width:12px;height:12px;}
  .ir-col-header.fld-selected{background:#d97706 !important;color:#fff !important;}
  .list-table td[data-col="no"],
  .list-table td[data-col="seq"],
  .list-table td[data-col="info"]{padding:1px 0;}
  /* 신규행 존재 시 기존행 잠금 */
  #service-list-body.exist-locked tr td{
    opacity:0.38; pointer-events:none; user-select:none;
  }
  #service-list-body.exist-locked tr{cursor:default !important;}
  /* 잠금 상태에서도 클릭(조회)만 허용 - tr 자체는 pointer-events 살림 */
  #service-list-body.exist-locked tr{pointer-events:auto;}
  #service-list-body.exist-locked tr td:first-child{pointer-events:none;} /* 체크박스 td */
  #service-list-body.exist-locked tr td:nth-child(3){pointer-events:none;} /* 삭제버튼 td */
  #service-list-body.exist-locked input,
  #service-list-body.exist-locked select,
  #service-list-body.exist-locked button{pointer-events:none;}
  /* 아이콘 전용 접기/펴기 버튼 */
  .btn-icon-fold {
    width: 22px; height: 22px;
    border: none; border-radius: 3px;
    color: #fff; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; padding: 0; flex-shrink: 0;
  }
  .btn-icon-fold:hover { opacity: 0.8; }
