/* PG 통합관리자 - 참고 이미지 구조 정확 반영 */
* { box-sizing: border-box; }
:root {
  --table-row-padding-y: 6px;
  --app-base-font-size: 13px;
  --app-table-font-size: 12px;
  --app-form-sm-font-size: 12px;
}
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif; font-size: var(--app-base-font-size); }

/* OBSERVER(조회전용): ziobim/NOTI의 비활성 버튼 톤과 유사하게 회색 고정 */
.pg-perm-observer .btn:disabled,
.pg-perm-observer .btn.disabled,
.pg-perm-observer button:disabled,
.pg-perm-observer a.btn.disabled {
  background-color: #e9ecef !important;
  border-color: #ced4da !important;
  color: #6c757d !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}
.pg-perm-observer input:disabled,
.pg-perm-observer select:disabled,
.pg-perm-observer textarea:disabled {
  background-color: #f1f3f5 !important;
  color: #6c757d !important;
  cursor: not-allowed !important;
}
.wrapper { display: flex; flex-direction: column; min-height: 100vh; }
/* 세로로 메뉴가 길면 사이드바 내부 스크롤 대신 본 행 전체를 스크롤 */
.wrapper-body { display: flex; flex-direction: row; flex: 1; min-height: 0; min-width: 0; overflow-x: hidden; overflow-y: auto; align-items: stretch; }

/* ========== 좌측 사이드바: layout/left-side-menu.html 구조 (로고 → 접기 → 메뉴) ========== */
.left-side-menu {
  width: 260px;
  min-width: 260px;
  min-height: 100vh;
  height: auto;
  max-height: none;
  background: #2c3138;
  color: #a6b0bf;
  flex-shrink: 0;
  transition: width 0.2s, min-width 0.2s;
  display: flex;
  flex-direction: column;
  overflow: visible;
  position: relative;
  z-index: 100;
}
.left-side-menu.collapsed {
  width: 70px !important;
  min-width: 70px !important;
}
.left-side-menu.collapsed .menu-arrow,
.left-side-menu.collapsed .side-nav-link span,
.left-side-menu.collapsed #leftSideFoldSpan { display: none !important; }
.left-side-menu.collapsed .side-nav-second-level { display: none !important; }
.left-side-menu.collapsed .logo-icopay-sub { display: none !important; }
.left-side-menu.collapsed .side-nav-link { justify-content: center; padding: 10px; }
.left-side-menu.collapsed .side-nav-link i { margin-right: 0; }
/* 접힘: 상단 로고 영역·이미지 축소 (브랜딩 업로드 후에도 동일) */
.left-side-menu.collapsed .logo-icopay-wrap {
  padding: 8px 4px;
}
.left-side-menu.collapsed .logo-icopay-title {
  font-size: 0.72rem;
  line-height: 1.15;
}
.left-side-menu.collapsed #sidebar-logo-img,
.left-side-menu.collapsed .sidebar-logo-img {
  max-height: 32px !important;
  max-width: 56px !important;
}
.logo-icopay-wrap,
.logo-icopay-title,
.logo-icopay-sub,
#sidebar-logo-img,
.sidebar-logo-img {
  transition: padding 0.2s ease, font-size 0.2s ease, max-height 0.2s ease, max-width 0.2s ease;
}
.menuFoldDiv { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.06); }
/* 접힌 상태 플라이아웃: 사이드바 오른쪽에 떠 있는 서브메뉴 */
.flyout-submenu {
  position: fixed;
  left: 70px;
  top: 0;
  width: 190px;
  min-height: 100px;
  max-height: min(85vh, 560px);
  overflow-y: auto;
  scrollbar-width: thin;
  background: #2c3138;
  color: #a6b0bf;
  box-shadow: 4px 0 12px rgba(0,0,0,0.3);
  z-index: 1000;
  border-radius: 0 4px 4px 0;
  border-left: 1px solid rgba(255,255,255,0.08);
}
.flyout-submenu .side-nav-second-level {
  display: block !important;
  max-height: none;
  background: transparent;
}
.flyout-submenu .child-li a {
  padding: 8px 18px;
  font-size: var(--app-base-font-size);
}
.logo-icopay-wrap {
  display: block;
  padding: 16px 12px;
  text-align: center;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.logo-icopay-wrap:hover { color: #fff; opacity: 0.9; }
.logo-icopay-title { display: block; font-weight: 700; font-size: 1.05rem; color: #e74c3c; }
.logo-icopay-sub { display: block; font-size: 0.75rem; color: rgba(231,76,60,0.9); margin-top: 2px; }
#sidebar-logo-img,
.sidebar-logo-img {
  max-height: 50px;
  max-width: 180px;
  display: none;
  object-fit: contain;
}
/* 내부 스크롤 없이 메뉴 전체 높이만큼 펼침 → 부모 .wrapper-body 세로 스크롤 */
#left-side-menu-container {
  flex: 0 0 auto;
  overflow: visible;
}
.left-side-menu .btn-secondary {
  background: #3a4149 !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: #fff !important;
  font-size: var(--app-base-font-size);
  padding: 6px 10px;
}
.left-side-menu .btn-secondary:hover { background: #454d56 !important; color: #fff !important; }
.side-nav { list-style: none; margin: 0; padding: 8px 0 12px; }
.side-nav-item { margin: 0; }
.side-nav-link {
  display: flex;
  align-items: center;
  padding: 10px 18px;
  color: #a6b0bf;
  text-decoration: none;
  cursor: pointer;
  border-left: 3px solid transparent;
  font-size: var(--app-base-font-size);
}
.side-nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
/* 대메뉴 선택: 연한 그레이, 보라색 포인트는 왼쪽 라인 */
.side-nav-item.mm-active > .side-nav-link {
  color: #fff;
  border-left-color: #6658dd;
  background: #3a4149;
}
.side-nav-link i { margin-right: 10px; width: 20px; text-align: center; font-size: 1.05rem; }
/* 대메뉴 우측: 접힘 ▶ / 펼침 ▼ (회전으로 전환) */
.menu-arrow {
  margin-left: auto;
  flex-shrink: 0;
  width: 1em;
  text-align: center;
  font-size: var(--app-base-font-size);
  font-weight: 700;
  line-height: 1;
  color: rgba(255,255,255,0.55);
  transition: transform 0.2s ease;
}
.menu-arrow::before {
  content: '>';
  display: inline-block;
}
.side-nav-item.mm-active > .side-nav-link .menu-arrow { transform: rotate(90deg); }
.side-nav-second-level {
  list-style: none;
  margin: 0;
  padding: 0;
  background: rgba(0,0,0,0.2);
  display: none;
  max-height: none;
  overflow: visible;
}
.side-nav-second-level.mm-show { display: block !important; }
.child-li { margin: 0; }
.child-li a {
  display: block;
  padding: 8px 18px 8px 48px;
  color: #a6b0bf;
  text-decoration: none;
  font-size: var(--app-base-font-size);
  white-space: nowrap;
}
.child-li a:hover { color: #fff; background: #3a4149; }
/* 실제 선택된 메뉴(클릭된 서브메뉴)는 보라색 */
.child-li.mm-active a { color: #fff; background: #6658dd; font-weight: 500; }
/* ========== 상단 헤더: 우측만 - 접속IP·접속시간·사용자(아이콘+ID+이름)·전체닫기 ========== */
.content-page { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 100vh; width: auto; background: #f5f5f5; overflow: hidden; position: relative; z-index: 1; }
.header-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 52px;
  padding: 0 20px;
  background: #e8e8e8;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
}
.header-top-right { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 20px; }
.header-top-info { font-size: var(--app-base-font-size); color: #333; font-weight: 500; }
.header-user-link { display: flex; align-items: center; gap: 8px; color: #333; text-decoration: none; }
.header-user-link:hover { color: #111; }
.header-user-icon { font-size: 1.5rem; color: #555; }
.header-user-text { font-size: var(--app-base-font-size); line-height: 1.4; text-align: left; }
.header-user .dropdown-menu .dropdown-item { font-size: var(--app-base-font-size); }
.btn-header-close {
  background: #c00 !important;
  border: 1px solid #a00 !important;
  color: #fff !important;
  font-size: var(--app-base-font-size);
  padding: 6px 14px;
  font-weight: 500;
}
.btn-header-close:hover { background: #a00 !important; border-color: #800 !important; color: #fff !important; }

/* ========== 탭 바: 다크 그레이 (참고 이미지) ========== */
.content-body { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: #fff; }
.content-tab-row {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  background: #4a4a4a;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}
.content-tabs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  align-items: stretch;
}
.content-tabs .nav-item.copyTopTab {
  display: flex;
  align-items: center;
  border-right: 1px solid #555;
  background: #4a4a4a;
  flex-shrink: 0;
}
.content-tabs .nav-item.copyTopTab .tab-a { color: #ccc; }
.content-tabs .nav-item.copyTopTab .tab-a.active { background: #5a5a5a; color: #fff; font-weight: 600; }
.content-tabs .tab-a {
  padding: 8px 14px;
  font-size: var(--app-base-font-size);
  text-decoration: none;
  display: inline-block;
}
.content-tabs .tab-close-button {
  margin: 0 4px;
  padding: 0 6px;
  font-size: var(--app-base-font-size);
  line-height: 1.2;
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
}
.content-tabs .tab-close-button:hover { color: #fff; }

/* ========== 본문 내부 (흰 배경, 너비 자동 조절) ========== */
.content-inner { padding: 16px 20px; flex: 1; min-height: 0; min-width: 0; width: 100%; max-width: none; background: #fff; overflow-x: auto; overflow-y: auto; font-size: var(--app-base-font-size); }
/* 본문 공통: sm 입력·셀렉트는 사용자관리와 동일 10px */
.content-inner .form-control-sm,
.content-inner .form-select-sm,
.tab-pane.tabConDiv .form-control-sm,
.tab-pane.tabConDiv .form-select-sm {
  font-size: var(--app-form-sm-font-size);
}
.content-inner .form-label,
.tab-pane.tabConDiv .form-label {
  font-size: var(--app-base-font-size);
}
.content-inner .form-control:not(.form-control-sm),
.tab-pane.tabConDiv .form-control:not(.form-control-sm) {
  font-size: var(--app-base-font-size);
}
/* 스크롤바: 얇은 연한 회색 */
.content-inner,
.tab-pane.tabConDiv,
.content-tabs,
#contentsMain .table-responsive,
.table-responsive.table-scrollable {
  scrollbar-width: thin;
  scrollbar-color: #c8c8c8 #f0f0f0;
}
.content-inner::-webkit-scrollbar,
.tab-pane.tabConDiv::-webkit-scrollbar,
.content-tabs::-webkit-scrollbar,
#contentsMain .table-responsive::-webkit-scrollbar,
.table-responsive.table-scrollable::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.content-inner::-webkit-scrollbar-track,
.tab-pane.tabConDiv::-webkit-scrollbar-track,
.content-tabs::-webkit-scrollbar-track,
#contentsMain .table-responsive::-webkit-scrollbar-track,
.table-responsive.table-scrollable::-webkit-scrollbar-track {
  background: #f0f0f0;
}
.content-inner::-webkit-scrollbar-thumb,
.tab-pane.tabConDiv::-webkit-scrollbar-thumb,
.content-tabs::-webkit-scrollbar-thumb,
#contentsMain .table-responsive::-webkit-scrollbar-thumb,
.table-responsive.table-scrollable::-webkit-scrollbar-thumb {
  background: #c8c8c8;
  border-radius: 3px;
}
.content-inner::-webkit-scrollbar-thumb:hover,
.tab-pane.tabConDiv::-webkit-scrollbar-thumb:hover,
.content-tabs::-webkit-scrollbar-thumb:hover,
#contentsMain .table-responsive::-webkit-scrollbar-thumb:hover,
.table-responsive.table-scrollable::-webkit-scrollbar-thumb:hover {
  background: #b0b0b0;
}

/* 필수 입력값 통일 표현: 파스텔 배경 */
.comp-reg-form .form-control.required-input:not([readonly]):not(:disabled),
.comp-reg-form .form-select.required-input:not([readonly]):not(:disabled),
.comp-reg-form textarea.form-control.required-input:not([readonly]):not(:disabled) {
  background-color: #fff4e8 !important;
  border-color: #f2d4b6;
}
.comp-reg-form .form-control.required-input:not([readonly]):not(:disabled):focus,
.comp-reg-form .form-select.required-input:not([readonly]):not(:disabled):focus,
.comp-reg-form textarea.form-control.required-input:not([readonly]):not(:disabled):focus {
  background-color: #ffefdf !important;
  border-color: #f0c99d;
  box-shadow: 0 0 0 0.18rem rgba(240, 201, 157, 0.28);
}
/* 정산방법 시간 입력(정산마감/정산자동개시/이체시간): 기존 대비 50% 확대 */
.comp-reg-form input[type="time"].settle-time-wide {
  width: 100%;
  min-width: 0;
  max-width: none;
}
/* 겹침 방지: 시간 필드 블록 자체를 넓혀 간격 유지 */
.comp-reg-form .form-field-block.settle-time-wide-block {
  flex: 0 0 16.6667%;
  max-width: 16.6667%;
  padding-right: 10px;
}
@media (max-width: 992px) {
  .comp-reg-form input[type="time"].settle-time-wide {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .comp-reg-form .form-field-block.settle-time-wide-block {
    flex: 0 0 100%;
    max-width: 100%;
    padding-right: calc(var(--bs-gutter-x, 1.5rem) * .5);
  }
}
.content-page .container-fluid { max-width: none; width: 100%; overflow: hidden; }
.page-title-box { margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.page-title-box .page-title { margin: 0; order: 1; font-size: var(--app-base-font-size); font-weight: 600; color: #333; }
.page-title-box .breadcrumb { margin: 0; padding: 0; background: none; font-size: var(--app-base-font-size); color: #666; order: 2; }
.page-title-box .breadcrumb-item.navi { font-weight: 600; color: #333; }
.page-title-box .page-title.empty-title { display: none; }
#contentsMain { flex: 1; min-height: 0; overflow: hidden; }
.tab-pane.tabConDiv { height: 100%; min-height: 0; display: none; padding: 0; overflow-y: auto; font-size: var(--app-base-font-size); }
.tab-pane.tabConDiv.show.active { display: block; }

/* 목록 화면 통일 간격: 검색 줄·알림·요약·테이블 구분 (결제내역·결제실패 등 전체) */
.screen-search-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 20px;
  font-size: var(--app-base-font-size);
}
/* 검색 행: 한 줄 고정, 글자수 연동 자동 너비 → 줄바꿈 없이 가로 스크롤 */
.screen-search-form .search-form-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: 0;
  overflow-x: auto;
  min-width: 0;
}
.screen-search-form .search-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 0;
}
.screen-search-form .search-cell--with-label .search-cell-label {
  flex-shrink: 0;
  width: auto;
  min-width: 36px;
  font-size: var(--app-base-font-size);
  color: #495057;
  text-align: right;
  white-space: nowrap;
}
.screen-search-form .search-cell-input {
  flex: 0 0 auto;
  min-width: 0;
}
.screen-search-form .search-cell-input--right {
  display: flex;
  justify-content: flex-end;
}
/* 입력창: 너비는 글자수 자동(ch), 높이/폰트는 30% 확대 */
.screen-search-form .search-cell-input .form-control-sm,
.screen-search-form .search-cell-input select.form-control-sm {
  font-size: var(--app-base-font-size);
  height: 28px;
  padding: 2px 8px;
  line-height: 1.3;
}
.screen-search-form .search-cell-input input[type="text"].form-control-sm,
.screen-search-form .search-cell-input select.form-control-sm {
  max-width: none;
}
/* 조회일자: 달력 40% 확대 */
.screen-search-form .search-cell-input--daterange { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.screen-search-form .search-date-input {
  font-size: var(--app-base-font-size);
  height: 30px;
  padding: 2px 8px;
  width: 154px;
  min-width: 140px;
  max-width: none;
}
/* 결제관리 검색: 라벨 글자길이와 무관하게 입력칸 시작선/폭을 통일 */
.screen-search-form.pay-mng-search-form .search-cell--with-label .search-cell-label {
  width: 74px;
  min-width: 74px;
}
.screen-search-form.pay-mng-search-form .search-cell-input input.form-control-sm,
.screen-search-form.pay-mng-search-form .search-cell-input select.form-control-sm {
  width: 190px !important;
  min-width: 190px !important;
}
.screen-search-form.pay-mng-search-form .search-cell-input select[name="searchTranFactor"],
.screen-search-form.pay-mng-search-form .search-cell-input select[name="searchPayDivCd"],
.screen-search-form.pay-mng-search-form .search-cell-input select[name="searchPg"] {
  width: 220px !important;
  min-width: 220px !important;
}
/* 퀵 날짜 버튼: 당일·당월 핑크 톤, 나머지 기존 톤 */
.quick-date { font-size: var(--app-base-font-size); padding: 4px 8px; }
.quick-date--pink {
  background: linear-gradient(180deg, #fce4ec 0%, #f8bbd9 100%) !important;
  border-color: #f48fb1 !important;
  color: #ad1457 !important;
}
.quick-date--pink:hover {
  background: linear-gradient(180deg, #f8bbd9 0%, #f48fb1 100%) !important;
  border-color: #ec407a !important;
  color: #880e4f !important;
}

/* 업체관리: 검색 영역 2~3줄 배치, 스크롤바 없음 */
.comp-mng-search-multiline .search-form-row {
  flex-wrap: wrap;
  overflow-x: visible;
  overflow-y: visible;
  gap: 8px 16px;
  align-items: flex-end;
}
.comp-mng-search-multiline .search-cell { margin-bottom: 4px; }
/* 업체관리: 라벨·입력창 고정 너비로 위아래 정렬 (입력창 30% 확대, 모든 입력 동일 사이즈) */
.comp-mng-search-multiline .search-cell--with-label {
  width: 268px;
  min-width: 268px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.comp-mng-search-multiline .search-cell--with-label .search-cell-label {
  width: 90px;
  min-width: 90px;
  flex-shrink: 0;
  text-align: right;
}
.comp-mng-search-multiline .search-cell-input {
  flex: 0 0 auto;
}
/* 업체관리: 검색 입력창 너비 통일 - 130px의 30% 확대(169px), 업체구분/대표자명/업체사용상태/휴대폰 등 모두 동일 */
.comp-mng-search-multiline .search-cell-input input.form-control-sm,
.comp-mng-search-multiline .search-cell-input select.form-control-sm {
  width: 169px !important;
  min-width: 169px !important;
  max-width: 169px !important;
}
/* 업체관리: 하위업체포함 + 검색 한 셀에 배치 */
.comp-mng-search-multiline .comp-mng-search-actions-wrap { gap: 8px 12px; }

/* 타블렛/모바일: 한 줄 유지, 가로 스크롤로 전체 표시 */
@media (max-width: 992px) {
  .screen-search-form:not(.comp-mng-search-multiline) .search-form-row { -webkit-overflow-scrolling: touch; }
}
@media (max-width: 768px) {
  .screen-search-form .search-cell--with-label .search-cell-label { min-width: 28px; font-size: var(--app-base-font-size); }
  .screen-search-form .search-date-input { min-width: 90px; }
}

/* 알림 박스 (파스텔 톤): 오류 이월… ↔ 건수 줄 간격 (위·아래 동일, 전체 페이지 공통) */
.search-notice {
  background: #fff5f5;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 10px 14px 10px 36px;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: var(--app-base-font-size);
  border-radius: 2px;
  position: relative;
}
.search-notice::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 12px;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23dc3545' viewBox='0 0 16 16'%3E%3Cpath d='M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.267.267 0 0 1 .02-.022z'/%3E%3C/svg%3E") no-repeat;
}
.search-notice ul { margin: 0; padding-left: 18px; }
.summary-bar-wrap .summary-item { font-weight: 500; color: #333; }

/* 총합(요약) 한 줄: 위·아래 동일 간격 (전체 페이지 공통) */
.screen-summary-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 20px;
  margin-bottom: 20px;
  min-height: 40px;
}
/* 총합 영역: 파스텔 보라 톤 (중요 사항) */
.summary-total-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
  border: 1px solid #ce93d8;
  color: #4a148c;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: var(--app-base-font-size);
  font-weight: 600;
}
.summary-total-bar .summary-total-item { white-space: nowrap; }
.comp-mng-sort-label { display: inline; font-weight: 500; margin: 0; }
.comp-mng-sort-select { display: inline-block; width: auto; min-width: 90px; }
/* 액션 버튼은 항상 오른쪽 (요약 있든 없든, 목록/폼/정산실행 동일) */
.screen-summary-action-row .screen-action-buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-left: auto;
}
.screen-summary-action-row .screen-action-buttons .btn { margin: 0; }

/* 예전 구조 호환: .screen-action-row 사용처도 동일하게 오른쪽 정렬 */
.screen-action-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.screen-action-row .screen-action-buttons,
.screen-action-buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}
.screen-action-buttons .btn { margin: 0; }

/* 액션 버튼: 등록(노랑), 엑셀다운로드(연파랑) */
#contentsMain .btn-warning { background: #f0ad4e; border-color: #eea236; color: #fff; }
#contentsMain .btn-warning:hover { background: #ec971f; border-color: #d58512; color: #fff; }
#contentsMain .btn-info { background: #5bc0de; border-color: #46b8da; color: #fff; }
#contentsMain .btn-info:hover { background: #31b0d5; border-color: #269abc; color: #fff; }
#contentsMain .btn-primary { background: #337ab7; border-color: #2e6da4; }
#contentsMain .btn-primary:hover { background: #286090; border-color: #204d74; }
#contentsMain .btn-danger { background: #c00; border-color: #a00; }
#contentsMain .btn-danger:hover { background: #a00; border-color: #800; }
#contentsMain .btn,
.tab-pane.tabConDiv .btn,
.modal-body .btn {
  font-size: var(--app-base-font-size);
}
#contentsMain .btn-sm,
.tab-pane.tabConDiv .btn-sm,
.modal-body .btn-sm {
  font-size: var(--app-form-sm-font-size);
}

/* 요약 바 (연파랑) */
.summary-bar { background: #d9edf7; border: 1px solid #bce8f1; padding: 8px 14px; margin-bottom: 10px; font-size: var(--app-base-font-size); border-radius: 2px; }
.summary-bar label { margin: 0 12px 0 0; font-weight: 500; color: #31708f; }

/* 테이블: 제목·내용 상하좌우 가운데 정렬 (모든 테이블 공통 규칙) */
#contentsMain .table { font-size: var(--app-table-font-size); }
#contentsMain .table thead th,
#contentsMain .table tbody td { text-align: center; vertical-align: middle; }
#contentsMain .card { border: 1px solid #ddd; border-radius: 2px; }
#contentsMain .card-header { font-size: var(--app-base-font-size); }
#contentsMain .card-body { padding: 16px 20px; }
#contentsMain .table thead th { background: #d9edf7; border: 1px solid #bce8f1; font-weight: 600; color: #31708f; padding: 8px 10px; }
#contentsMain .table td { padding: var(--table-row-padding-y) 10px; border-color: #ddd; }
/* 과거 버전에서 삽입된 행 리사이즈 줄(점선) — 더 이상 생성하지 않음; 남아 있으면 숨김 */
#contentsMain .table-row-resize-handle { display: none !important; }
#contentsMain .table-bordered th { border-color: #bce8f1; }

/*
 * 데이터 테이블 공통 UI: 줄무늬(홀·짝 행 배경) + 행 사이 가로 구분선 제거
 * - org-perm-table 제외: 조직 권한 행은 NONE/OBSERVER 등 배경이 이미 있음
 * - 업체관리 트리(grid_comp_compMngTree)·결제내역(screen-pay-list) 등은 아래 더 구체 규칙이 덮어씀
 */
#contentsMain .table:not(.org-perm-table) > tbody > tr:nth-child(odd),
.tab-pane.tabConDiv .table:not(.org-perm-table) > tbody > tr:nth-child(odd),
.modal-body .table:not(.org-perm-table) > tbody > tr:nth-child(odd) {
  background-color: #fff;
}
#contentsMain .table:not(.org-perm-table) > tbody > tr:nth-child(even),
.tab-pane.tabConDiv .table:not(.org-perm-table) > tbody > tr:nth-child(even),
.modal-body .table:not(.org-perm-table) > tbody > tr:nth-child(even) {
  background-color: #eef6fc;
}
#contentsMain .table:not(.org-perm-table) > tbody > tr > td,
#contentsMain .table:not(.org-perm-table) > tbody > tr > th,
.tab-pane.tabConDiv .table:not(.org-perm-table) > tbody > tr > td,
.tab-pane.tabConDiv .table:not(.org-perm-table) > tbody > tr > th,
.modal-body .table:not(.org-perm-table) > tbody > tr > td,
.modal-body .table:not(.org-perm-table) > tbody > tr > th {
  border-top: none;
}
#contentsMain .table:not(.org-perm-table) tbody tr.table-active,
#contentsMain .table:not(.org-perm-table) tbody tr.table-active > td,
.tab-pane.tabConDiv .table:not(.org-perm-table) tbody tr.table-active,
.tab-pane.tabConDiv .table:not(.org-perm-table) tbody tr.table-active > td,
.modal-body .table:not(.org-perm-table) tbody tr.table-active,
.modal-body .table:not(.org-perm-table) tbody tr.table-active > td {
  background-color: #d6e9ff !important;
}
#contentsMain .table.table-hover:not(.org-perm-table) > tbody > tr:hover,
#contentsMain .table.table-hover:not(.org-perm-table) > tbody > tr:hover > td,
.tab-pane.tabConDiv .table.table-hover:not(.org-perm-table) > tbody > tr:hover,
.tab-pane.tabConDiv .table.table-hover:not(.org-perm-table) > tbody > tr:hover > td,
.modal-body .table.table-hover:not(.org-perm-table) > tbody > tr:hover,
.modal-body .table.table-hover:not(.org-perm-table) > tbody > tr:hover > td {
  background-color: #dfeaf5 !important;
}
#contentsMain .table.table-hover:not(.org-perm-table) > tbody > tr.table-active:hover,
#contentsMain .table.table-hover:not(.org-perm-table) > tbody > tr.table-active:hover > td {
  background-color: #d6e9ff !important;
}

/* 가맹점정산내역: 2단 헤더/합계바를 스크린샷 톤으로 보정 */
.screen-calc-gm-list .summary-total-bar {
  background: #f8fbff;
  border: 1px solid #d7e8fb;
  padding: 8px 12px;
}
.screen-calc-gm-list [data-summary] {
  color: #2b5f8d;
  font-weight: 600;
}
.screen-calc-gm-list #contentsMain .table thead tr:first-child th {
  background: #eaf4ff;
  color: #275a84;
  font-weight: 700;
  border-color: #cfe1f6;
  text-align: center;
}
.screen-calc-gm-list #contentsMain .table thead tr:nth-child(2) th {
  background: #f4f9ff;
  color: #34668f;
  border-color: #dbe8f7;
  text-align: center;
}
.screen-calc-gm-list #contentsMain .table th,
.screen-calc-gm-list #contentsMain .table td {
  white-space: nowrap;
  font-size: var(--app-table-font-size);
}
.screen-calc-gm-list #contentsMain .table th[data-key="merchantNm"] { min-width: 150px; }
.screen-calc-gm-list #contentsMain .table th[data-key="compId"] { min-width: 105px; }
.screen-calc-gm-list #contentsMain .table th[data-key="bizType"] { min-width: 82px; }
.screen-calc-gm-list #contentsMain .table th[data-key="bizNo"] { min-width: 120px; }
.screen-calc-gm-list #contentsMain .table th[data-key="cardAprvNo"] { min-width: 120px; }
.screen-calc-gm-list #contentsMain .table th[data-key="terminalId"] { min-width: 110px; }
.screen-calc-gm-list #contentsMain .table th[data-key="amount"],
.screen-calc-gm-list #contentsMain .table th[data-key="feeAmt"],
.screen-calc-gm-list #contentsMain .table th[data-key="feeVat"],
.screen-calc-gm-list #contentsMain .table th[data-key="holdAmt"],
.screen-calc-gm-list #contentsMain .table th[data-key="settleAmt"] { min-width: 96px; text-align: right; }
.screen-calc-gm-list #contentsMain .table th[data-key="feeCnt"],
.screen-calc-gm-list #contentsMain .table th[data-key="feeRate"],
.screen-calc-gm-list #contentsMain .table th[data-key="holdRate"] { min-width: 78px; text-align: right; }
.screen-calc-gm-list #contentsMain .table th[data-key="calcDt"],
.screen-calc-gm-list #contentsMain .table th[data-key="approveDt"],
.screen-calc-gm-list #contentsMain .table th[data-key="cancelDt"] { min-width: 138px; }

/* 결제내역(통합·파생): 참고 UI — 연한 블루 2단 헤더, 요약 숫자 색 구분, 행 줄무늬 */
.screen-pay-list .summary-total-bar {
  background: #f8fbff;
  border: 1px solid #cde6f3;
  color: #1a3a52;
  font-weight: 600;
}
.screen-pay-list .summary-total-item#summary_건수 { color: #222; font-weight: 700; }
.screen-pay-list .summary-total-item#summary_승인금액 { color: #198754; }
.screen-pay-list .summary-total-item#summary_취소금액 { color: #dc3545; }
.screen-pay-list .summary-total-item#summary_결제금액,
.screen-pay-list .summary-total-item#summary_총수수료,
.screen-pay-list .summary-total-item#summary_보류금액,
.screen-pay-list .summary-total-item#summary_지급액 { color: #0d6efd; }
.screen-pay-list #contentsMain .table thead tr:first-child th {
  background: #eaf4ff;
  color: #275a84;
  font-weight: 700;
  border-color: #cfe1f6;
  text-align: center;
}
.screen-pay-list #contentsMain .table thead tr:nth-child(2) th {
  background: #f4f9ff;
  color: #34668f;
  border-color: #dbe8f7;
  text-align: center;
}
.screen-pay-list #contentsMain .table tbody tr:nth-child(odd) { background: #fff; }
.screen-pay-list #contentsMain .table tbody tr:nth-child(even) { background: #eef6fc; }
.screen-pay-list #contentsMain .table th,
.screen-pay-list #contentsMain .table td { font-size: var(--app-table-font-size); }

#contentsMain .table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* 업체관리 등: 가로·세로 스크롤로 모든 자료 한 화면에서 볼 수 있게 */
#contentsMain .table-responsive.table-scrollable {
  max-height: 60vh;
  overflow: auto;
  overflow-x: auto;
  overflow-y: auto;
}
#contentsMain .table { width: 100%; }
/* 데이터 없음 메시지: 항상 가운데 (공공사항, 업체정보조회, 업체관리 포함) */
#contentsMain .table-responsive .table { min-width: 100%; }
/* 업체관리 등 컬럼 많은 테이블: 가로 스크롤, 컬럼 최소 너비 보장 */
#contentsMain .table-responsive .table[id^="grid_comp_compMngTree"] { table-layout: auto; min-width: 1400px; }
#contentsMain .table-responsive .table[id^="grid_comp_compMngTree"] th,
#contentsMain .table-responsive .table[id^="grid_comp_compMngTree"] td { white-space: nowrap; min-width: 70px; }
#contentsMain .table-responsive .table[id^="grid_comp_compMngTree"] th:nth-child(1),
#contentsMain .table-responsive .table[id^="grid_comp_compMngTree"] td:nth-child(1) { min-width: 40px; }
#contentsMain .table-responsive .table[id^="grid_comp_compMngTree"] th:nth-child(4),
#contentsMain .table-responsive .table[id^="grid_comp_compMngTree"] td:nth-child(4),
#contentsMain .table-responsive .table[id^="grid_comp_compMngTree"] th:nth-child(5),
#contentsMain .table-responsive .table[id^="grid_comp_compMngTree"] td:nth-child(5) { min-width: 90px; }
/* 업체관리: 한 줄 흰색, 한 줄 파스텔 블루 교차 + 칸 구분선 제거 */
#contentsMain .table-responsive .table[id^="grid_comp_compMngTree"] tbody tr:nth-child(odd) { background: #fff; }
#contentsMain .table-responsive .table[id^="grid_comp_compMngTree"] tbody tr:nth-child(even) { background: #E6F7FF; }
#contentsMain .table-responsive .table[id^="grid_comp_compMngTree"] td,
#contentsMain .table-responsive .table[id^="grid_comp_compMngTree"] th { border: none !important; }
/* 유통망정산내역: 3단 헤더(승인/취소·수수료 하위) — 좁은 칸도 한 줄로 보이게 */
.screen-distribution-list .screen-distribution-grid.table {
  table-layout: auto;
  min-width: 1280px;
  font-size: var(--app-table-font-size);
}
.screen-distribution-list .screen-distribution-grid thead th {
  vertical-align: middle;
}
.screen-distribution-list .screen-distribution-grid .dist-th-group {
  font-weight: 600;
}
.screen-distribution-list .screen-distribution-grid .dist-th-fee,
.screen-distribution-list .screen-distribution-grid .dist-th-fee-sub {
  white-space: nowrap;
  font-size: var(--app-table-font-size);
  padding-left: 4px;
  padding-right: 4px;
}

/* 본사설정 — 노티매핑 JSON 편집 */
#hqNotifyMappingForm textarea[name="mappingDefinitionJson"] {
  font-family: ui-monospace, Consolas, "Cascadia Code", monospace;
  font-size: var(--app-base-font-size);
  line-height: 1.35;
}

/* 업체관리 VIEW SETTING: 항목 한 줄 좌측 정렬 + 우측 액션 고정 */
.table-column-guide { font-size: var(--app-table-font-size); display: flex; flex-direction: column; align-items: stretch; justify-content: center; }
.table-column-guide .column-guide-row { margin-bottom: 4px; }
.table-column-guide .column-guide-row:last-child { margin-bottom: 0; }
.table-column-guide .column-guide-title { font-weight: 600; color: #495057; font-size: var(--app-table-font-size); padding-left: 0; margin-bottom: 2px; }
.table-column-guide .column-guide-body { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 10px; width: 100%; }
.table-column-guide .column-guide-list {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-top: 0;
}
/* 결제내역 등: VIEW SETTING 2행 — 1행 제목+버튼, 2행 컬럼 체크 줄바꿈 */
.table-column-guide.table-column-guide--two-row {
  gap: 8px;
}
.table-column-guide--two-row .column-guide-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  width: 100%;
  margin-bottom: 0;
}
.table-column-guide--two-row .column-guide-top .column-guide-title {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 8em;
  line-height: 1.4;
}
.table-column-guide--two-row .column-guide-top .column-guide-actions {
  flex: 0 0 auto;
  margin-left: 0;
  display: inline-flex !important;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.table-column-guide--two-row .column-guide-checkboxes {
  width: 100%;
  margin-bottom: 0;
}
.table-column-guide--two-row .column-guide-checkboxes .column-guide-list {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  gap: 6px 12px;
  overflow-x: visible;
  overflow-y: visible;
  max-width: 100%;
}
.table-column-guide--two-row .column-guide-label {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.table-column-guide .column-guide-actions {
  flex: 0 0 auto !important;
  margin-left: auto;
  width: auto;
  display: inline-flex !important;
  flex-direction: row;
  justify-content: flex-end !important;
  align-items: center;
  gap: 6px;
  white-space: nowrap !important;
}
.table-column-guide .column-guide-actions .btn {
  display: inline-block !important;
  width: auto !important;
  flex: 0 0 auto !important;
  min-width: 44px;
  white-space: nowrap !important;
}
.table-column-guide:not(.table-column-guide--two-row) .column-guide-item { margin: 0; font-weight: 500; cursor: pointer; white-space: nowrap; font-size: var(--app-table-font-size); display: inline-flex; align-items: center; }
.table-column-guide.table-column-guide--two-row .column-guide-item { margin: 0; font-weight: 500; cursor: pointer; white-space: normal; font-size: var(--app-table-font-size); display: inline-flex; align-items: flex-start; max-width: 100%; }
.table-column-guide .column-guide-item input { margin-right: 3px; }
.table-column-guide .btn.btn-xs { font-size: var(--app-form-sm-font-size); padding: 2px 6px; width: 100%; min-height: 24px; }
/* 업체관리 트리 접기/펼치기 (계층 구조 유지를 위해 좌측 정렬) */
.tree-toggle-cell { white-space: nowrap; }
.tree-comp-cell { white-space: nowrap; text-align: left !important; }
.tree-comp-cell .tree-icon {
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}
.tree-comp-cell .tree-icon-folder { color: #337ab7; }
.tree-comp-cell .tree-icon-doc { color: #999; }
.tree-toggle {
  display: inline-block;
  width: 18px;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  user-select: none;
  margin-right: 4px;
}
.tree-toggle.expanded { color: #198754; }
.tree-toggle.expanded:hover { color: #157347; }
.tree-toggle.collapsed { color: #6c757d; }
.tree-toggle.collapsed:hover { color: #495057; }
.tree-toggle-placeholder {
  display: inline-block;
  width: 18px;
  margin-right: 4px;
  visibility: hidden;
}
td.empty-state-cell {
  width: 100%;
  text-align: center !important;
  min-height: 200px;
  padding: 48px 20px !important;
  vertical-align: middle !important;
}

/* 페이지네이션: 한 번에 보기 + 페이지 번호, 파스텔 스카이블루 톤 */
.pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: 6px;
  background: linear-gradient(180deg, #e8f4fc 0%, #f0f8ff 100%);
  border: 1px solid #bce8f1;
}
.pagination-view-at-once {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
}
.pagination-label { font-size: var(--app-base-font-size); color: #31708f; font-weight: 500; }
.pagination-size-options { display: flex; align-items: center; gap: 4px; }
.pagination-size-opt {
  min-width: 32px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #bce8f1;
  background: #fff;
  color: #5a6c7d;
  font-size: var(--app-form-sm-font-size);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.pagination-size-opt:hover { background: #e8f4fc; border-color: #5bc0de; color: #31708f; }
.pagination-size-opt--active {
  background: #5bc0de;
  border-color: #46b8da;
  color: #fff;
  font-weight: 600;
}
.pagination-size-opt--active:hover { background: #46b8da; color: #fff; }
.pagination-total { font-size: var(--app-base-font-size); color: #31708f; }
.pagination-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 100px;
}
.pagination-pages { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.pagination-num {
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid #bce8f1;
  background: #fff;
  color: #31708f;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.pagination-num:hover { background: #e8f4fc; border-color: #5bc0de; color: #2e6da4; }
.pagination-num--current {
  background: #337ab7;
  border-color: #2e6da4;
  color: #fff;
  font-weight: 600;
}
.pagination-num--current:hover { background: #286090; color: #fff; }
.pagination-ellipsis {
  padding: 0 4px;
  color: #5a6c7d;
  font-size: var(--app-base-font-size);
  user-select: none;
}
#contentsMain .pagination { margin: 0; }
#contentsMain .pagination .page-link { font-size: var(--app-base-font-size); }

/* 각 페이지 하단 회사명 (목록/폼 공통) */
.page-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e8e8e8;
  font-size: var(--app-base-font-size);
  color: #888;
  text-align: center;
}

/* 전역 푸터: 회사명은 각 페이지 하단으로 이동 후 유지 또는 제거용 */
.footer { flex-shrink: 0; background: #fff; padding: 8px 20px; border-top: 1px solid #e8e8e8; font-size: var(--app-base-font-size); color: #999; }
.dimmed { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dimmed-icon { width: 3rem; height: 3rem; }
.dimmed-text { margin-top: 12px; font-weight: 600; color: #fff !important; }
#content-frame { display: block; width: 100%; height: 100%; min-height: 500px; border: 0; }

/* ========== 업체등록폼: 레이블 위·입력 아래·입력 간격 ========== */
.comp-reg-form .form-field-block {
  margin-bottom: 2rem;
}
.comp-reg-form .form-field-block .form-label {
  display: block;
  margin-bottom: 6px;
  white-space: nowrap;
  font-size: var(--app-base-font-size);
  font-weight: 500;
  color: #333;
}
/* 입력창+버튼 같은 줄 (상위 본사, 로그인ID 등): 입력창 우측확장, 버튼 오른쪽 정렬 */
.comp-reg-form .form-input-with-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.comp-reg-form .form-input-with-btn .form-input-wrap {
  flex: 1;
  min-width: 0;
}
.comp-reg-form .form-input-with-btn .form-input-wrap .form-control,
.comp-reg-form .form-input-with-btn .form-input-wrap input,
.comp-reg-form .form-input-with-btn .form-input-wrap select {
  width: 100%;
}
.comp-reg-form .form-input-with-btn .btn {
  flex-shrink: 0;
  white-space: nowrap;
}
/* 보류율 설정, 수수료정책: 파스텔 스카이블루 */
#holdRateCard.card,
#commissionPolicyCard.card {
  background: linear-gradient(135deg, #e8f4fc 0%, #d4edff 100%);
  border-color: #b3d9f2;
}
#holdRateCard .card-header,
#commissionPolicyCard .card-header {
  background: rgba(179, 217, 242, 0.5);
  border-bottom-color: #b3d9f2;
}
/* 결제대행사 설정: 복수 추가 테이블 */
.pg-binding-list-wrap {
  overflow-x: auto;
}
.pg-binding-table { font-size: var(--app-table-font-size); }
.pg-binding-table th, .pg-binding-table td { vertical-align: middle; }
.pg-binding-table input, .pg-binding-table select { min-width: 80px; }

/* ========== 브랜딩 테마 (본사/총판) ========== */
/* DEFAULT: 현재 색톤 */
body.theme-default { --theme-bg: #f5f6f8; --theme-text: #333; --theme-sidebar-bg: #2c3138; --theme-sidebar-text: #a6b0bf; }
/* LIGHT: 흰배경/검정글씨 */
body.theme-light { --theme-bg: #fff; --theme-text: #000; --theme-sidebar-bg: #f8f9fa; --theme-sidebar-text: #212529; }
body.theme-light .left-side-menu { background: var(--theme-sidebar-bg); color: var(--theme-sidebar-text); }
body.theme-light .content-page { background: var(--theme-bg); color: var(--theme-text); }
/* DARK: 어두운배경/흰글씨 */
body.theme-dark { --theme-bg: #1a1d21; --theme-text: #fff; --theme-sidebar-bg: #0d0f11; --theme-sidebar-text: #e9ecef; }
body.theme-dark .left-side-menu { background: var(--theme-sidebar-bg); color: var(--theme-sidebar-text); }
body.theme-dark .content-page { background: var(--theme-bg); color: var(--theme-text); }
body.theme-dark .content-body { background: var(--theme-bg); }
/* 파스텔 1~5 */
body.theme-pastel_1 { --theme-bg: #fff5f5; --theme-text: #4a2c2a; --theme-sidebar-bg: #ffe4e1; --theme-sidebar-text: #5c3d3b; }
body.theme-pastel_2 { --theme-bg: #f0fff4; --theme-text: #2d4a32; --theme-sidebar-bg: #d1fae5; --theme-sidebar-text: #2d4a32; }
body.theme-pastel_3 { --theme-bg: #f0f9ff; --theme-text: #1e3a5f; --theme-sidebar-bg: #bae6fd; --theme-sidebar-text: #1e3a5f; }
body.theme-pastel_4 { --theme-bg: #faf5ff; --theme-text: #4c1d95; --theme-sidebar-bg: #e9d5ff; --theme-sidebar-text: #4c1d95; }
body.theme-pastel_5 { --theme-bg: #fffbeb; --theme-text: #78350f; --theme-sidebar-bg: #fef3c7; --theme-sidebar-text: #78350f; }
body.theme-pastel_1 .left-side-menu, body.theme-pastel_2 .left-side-menu, body.theme-pastel_3 .left-side-menu,
body.theme-pastel_4 .left-side-menu, body.theme-pastel_5 .left-side-menu {
  background: var(--theme-sidebar-bg); color: var(--theme-sidebar-text);
}
body.theme-pastel_1 .content-page, body.theme-pastel_2 .content-page, body.theme-pastel_3 .content-page,
body.theme-pastel_4 .content-page, body.theme-pastel_5 .content-page {
  background: var(--theme-bg); color: var(--theme-text);
}

/* ========== 상위업체 검색 모달 ========== */
#parentCompSearchModal .modal-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
}
#parentCompSearchModal .modal-header .btn-close {
  position: absolute;
  right: 16px;
}
#parentCompSearchModal .modal-title {
  font-size: var(--app-base-font-size);
  font-weight: 600;
  text-align: center;
}
#parentCompSearchModal .modal-body {
  padding: 12px 20px 16px;
  text-align: center;
  font-size: var(--app-base-font-size);
}
#parentCompSearchModal .modal-body .row.mb-3 {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px !important;
}
#parentCompSearchModal .modal-body .row.mb-3 .col-md-8,
#parentCompSearchModal .modal-body .row.mb-3 .col-md-4 {
  display: flex;
  align-items: center;
  justify-content: center;
}
#parentCompSearchModal .modal-body .form-control {
  font-size: var(--app-base-font-size);
  text-align: center;
}
#parentCompSearchModal .modal-body .btn {
  font-size: var(--app-base-font-size);
  padding: 4px 12px;
}
#parentCompSearchModal .table {
  font-size: var(--app-table-font-size);
  margin-bottom: 10px;
}
#parentCompSearchModal .table th,
#parentCompSearchModal .table td {
  text-align: center;
  vertical-align: middle;
  padding: 6px 8px;
}
#parentCompSearchModal .table th {
  font-weight: 600;
  font-size: var(--app-table-font-size);
}
#parentCompSearchModal .table td .btn {
  font-size: var(--app-base-font-size);
  padding: 2px 8px;
}
#parentCompSearchModal .text-muted.small {
  font-size: var(--app-base-font-size);
  text-align: center;
  margin-bottom: 0;
}

/* 사용자관리: 권한그룹(본사설정과 동일 정책) 기준 구간 구분 — 참고 UI(거래목록 그룹) 스타일 */
.table tbody tr.tr-user-group-start td:first-child {
  box-shadow: inset 4px 0 0 #fd7e14;
}

/* 사용자관리: 전역 변수와 동일 스케일, 검색줄 입력·사용여부(select) 너비만 유지 */
.screen-user-mng .table,
.screen-user-mng .table thead th,
.screen-user-mng .table tbody td {
  font-size: var(--app-table-font-size);
}
.screen-user-mng .table .form-control-sm,
.screen-user-mng .table .form-select-sm {
  font-size: var(--app-form-sm-font-size);
}
.screen-user-mng .screen-search-form {
  font-size: var(--app-base-font-size);
}
.screen-user-mng .screen-search-form .search-cell-input input.form-control-sm,
.screen-user-mng .screen-search-form .search-cell-input select.form-control-sm {
  font-size: var(--app-base-font-size);
  width: 24ch !important;
  min-width: 24ch !important;
  max-width: none !important;
}
.screen-user-mng .summary-bar {
  font-size: var(--app-base-font-size);
}
.screen-user-mng .user-mng-draft-remove {
  font-size: var(--app-form-sm-font-size);
  line-height: 1.2;
  padding: 0.1rem 0.35rem;
}
.screen-user-mng .user-mng-otp-badge {
  font-size: var(--app-form-sm-font-size);
  line-height: 1.15;
  padding: 0.15rem 0.45rem;
  font-weight: 500;
}
.screen-user-mng .user-mng-pwd-menu-toggle {
  font-size: var(--app-form-sm-font-size);
  line-height: 1.2;
}
.screen-user-mng .user-mng-pwd-dropdown {
  font-size: var(--app-base-font-size);
  min-width: 7.5rem;
}
.screen-user-mng .user-mng-pwd-dropdown .dropdown-item {
  font-size: var(--app-base-font-size);
}
.column-guide-item { user-select: none; }
.column-guide-item .column-guide-label {
  font-weight: 600;
}
.column-guide-item--on .column-guide-label {
  color: #212529;
}
.column-guide-item--off .column-guide-label {
  color: #9aa0a6;
}

/* 수수료관리 2단 헤더: 컬럼 전체 선택 시에도 하위 헤더 한 줄 유지 */
.commission-split-grid thead th {
  vertical-align: middle;
}
.commission-split-grid thead tr:first-child th {
  white-space: nowrap;
}
.commission-split-grid thead th[data-key$="Rate"],
.commission-split-grid thead th[data-key$="PerTxFee"] {
  white-space: nowrap;
  min-width: 3rem;
}
.commission-split-grid thead th[data-key$="Nm"] {
  white-space: nowrap;
  min-width: 4rem;
}

/* 본사(REGIONAL) 휴일 미니달력 */
.hq-holiday-mini-table td {
  padding: 2px !important;
  vertical-align: middle;
  min-width: 1.75rem;
}
.hq-holiday-day {
  min-height: 1.6rem;
  line-height: 1.2;
  font-size: var(--app-base-font-size);
  background: #f8f9fa;
  color: #212529;
}
.hq-holiday-day:hover {
  background: #e9ecef;
}
.hq-holiday-day--off {
  background: #d0d4da !important;
  color: #343a40 !important;
  font-weight: 600;
}
.hq-holiday-day--off:hover {
  background: #c2c8cf !important;
}
/* 영업일설정: 일자 구분별 색 (휴일 표시) */
.hq-holiday-day.hq-holiday-day--kind[data-holiday-kind="공휴일"] { background: #fecdd3 !important; color: #7f1d1d !important; font-weight: 600; }
.hq-holiday-day.hq-holiday-day--kind[data-holiday-kind="국경일"] { background: #fed7aa !important; color: #7c2d12 !important; font-weight: 600; }
.hq-holiday-day.hq-holiday-day--kind[data-holiday-kind="기념일"] { background: #bfdbfe !important; color: #1e3a5f !important; font-weight: 600; }
.hq-holiday-day.hq-holiday-day--kind[data-holiday-kind="종교휴일"] { background: #ddd6fe !important; color: #4c1d95 !important; font-weight: 600; }
.hq-holiday-day.hq-holiday-day--kind[data-holiday-kind="임시공휴일"] { background: #fef08a !important; color: #713f12 !important; font-weight: 600; }
.hq-holiday-day.hq-holiday-day--kind[data-holiday-kind="대체공휴일"] { background: #99f6e4 !important; color: #115e59 !important; font-weight: 600; }
.hq-holiday-ui-wrap .hq-holiday-calendar-grid {
  max-height: none;
}

/* 전산노티·결제환경 — 총판 노티: 노티 대상명 ↔ 아래 표 간격 축소 */
.comp-reg-form .hq-notify-new-target-name-col.form-field-block {
  margin-bottom: 0.5rem;
}
.comp-reg-form .hq-notify-target-table-wrap {
  margin-top: 0.2rem;
}

/* 전산노티·결제환경 — 총판 노티: 노티 대상명 입력·표 열 기본(120px) 대비 30% 확대 */
.comp-reg-form .hq-notify-new-target-name-col.col-sm-2 {
  flex: 0 0 calc(100% * 2 / 12 * 1.3);
  max-width: calc(100% * 2 / 12 * 1.3);
}
#hqNotifyTargetTable thead th.hq-notify-target-name-th {
  min-width: 156px;
}

/* 전산노티·결제환경 — 총판 노티 대상 테이블 */
#hqNotifyTargetTable .hq-notify-url-cell {
  font-size: var(--app-base-font-size);
  line-height: 1.45;
  vertical-align: middle;
}
#hqNotifyTargetTable .hq-notify-copy-cell {
  vertical-align: middle;
  white-space: nowrap;
}
#hqNotifyTargetTable .hq-notify-url-code {
  font-size: var(--app-base-font-size);
  word-break: break-all;
  background: transparent;
}
/* 노티 주소 글자색 — 성격과 동일 계열 */
#hqNotifyTargetTable .hq-notify-url-cell--callback .hq-notify-url-code {
  color: #087990;
  font-weight: 600;
}
#hqNotifyTargetTable .hq-notify-url-cell--result .hq-notify-url-code {
  color: #b45309;
  font-weight: 600;
}
#hqNotifyTargetTable .hq-notify-channel-cell {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
  text-align: center;
  font-size: var(--app-base-font-size);
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}
#hqNotifyTargetTable .hq-notify-channel-badge {
  display: inline-block;
  box-sizing: border-box;
  min-width: 7.25rem;
  width: 7.25rem;
  padding: 0.25rem 0.35rem;
  border-radius: 0.35rem;
  font-size: var(--app-base-font-size);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}
/* CALLBACK: 서버 노티 — 청록 계열 */
#hqNotifyTargetTable .hq-notify-channel-cell--callback .hq-notify-channel-badge {
  background: #cff4fc;
  color: #055160;
  border: 1px solid #9eeaf9;
}
/* RESULT: 브라우저·리다이렉트 — 주황 계열 */
#hqNotifyTargetTable .hq-notify-channel-cell--result .hq-notify-channel-badge {
  background: #ffe5d0;
  color: #984c0c;
  border: 1px solid #ffc9a3;
}
#hqNotifyTargetTable th.hq-notify-channel-th {
  white-space: nowrap;
  width: 132px;
  min-width: 132px;
}

/* 노티 대상 선택 모달 — 선택 열 가운데 정렬, CALLBACK/RESULT 색 구분 */
#notifyTargetPickerModal .notify-picker-select-cell {
  text-align: center;
  vertical-align: middle !important;
  width: 104px;
}
#notifyTargetPickerModal .notify-picker-select-cell .btn {
  display: inline-block;
  vertical-align: middle;
}
#notifyTargetPickerModal .notify-target-picker-table thead th {
  vertical-align: middle;
}
#notifyTargetPickerModal .notify-picker-badge {
  display: inline-block;
  min-width: 6.5rem;
  padding: 0.25rem 0.4rem;
  border-radius: 0.35rem;
  font-size: var(--app-base-font-size);
  font-weight: 700;
  letter-spacing: 0.02em;
}
#notifyTargetPickerModal .notify-picker-badge--callback {
  background: #cff4fc;
  color: #055160;
  border: 1px solid #9eeaf9;
}
#notifyTargetPickerModal .notify-picker-badge--result {
  background: #ffe5d0;
  color: #984c0c;
  border: 1px solid #ffc9a3;
}
#notifyTargetPickerModal .notify-picker-channel-th-cb {
  color: #055160;
  font-weight: 600;
}
#notifyTargetPickerModal .notify-picker-channel-th-rs {
  color: #984c0c;
  font-weight: 600;
}
#notifyTargetPickerModal .notify-picker-url-cell--callback .notify-picker-url-code {
  color: #087990;
  font-weight: 600;
  word-break: break-all;
}
#notifyTargetPickerModal .notify-picker-url-cell--result .notify-picker-url-code {
  color: #b45309;
  font-weight: 600;
  word-break: break-all;
}

/* 조직별 권한 세팅 — 조직 탭 + 매트릭스 */
.org-perm-matrix .org-perm-level-tabs .nav-link {
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: var(--app-base-font-size);
  border: 1px solid #dee2e6;
  background: #fff;
  color: #495057;
}
.org-perm-matrix .org-perm-level-tabs .nav-link.active {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}
.org-perm-table-wrap {
  max-height: min(70vh, 560px);
  overflow: auto;
  border: 1px solid #e9ecef;
  border-radius: 0.375rem;
}
.org-perm-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8f9fa;
  font-size: var(--app-table-font-size);
  white-space: nowrap;
}
.org-perm-table .org-perm-th-no,
.org-perm-table td.org-perm-td-no {
  width: 3.25rem;
  max-width: 3.5rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  vertical-align: middle;
}
.org-perm-table tbody tr.org-perm-group-header td.org-perm-group-title {
  background: linear-gradient(180deg, #f1f3f5 0%, #e9ecef 100%);
  border-top: 2px solid #ced4da;
  letter-spacing: -0.02em;
}
.org-perm-group-bar {
  padding: 0.45rem 0.65rem;
}
.org-perm-group-name {
  font-weight: 700;
  font-size: var(--app-base-font-size);
  color: #212529;
}
.org-perm-bulk-hint {
  font-size: var(--app-base-font-size);
  white-space: nowrap;
}
.org-perm-table .org-perm-bulk-select {
  min-width: 10.5rem;
  max-width: 16rem;
  font-size: var(--app-base-font-size);
}
.org-perm-table tbody tr.org-perm-group-header:first-child td.org-perm-group-title {
  border-top: 1px solid #dee2e6;
}
.org-perm-table tbody td {
  font-size: var(--app-table-font-size);
  vertical-align: middle;
}
.org-perm-table .org-perm-select {
  min-width: 220px;
}
/* 권한별 행 배경·왼쪽 강조 — NONE / OBSERVER / MODIFY / DELETE */
.org-perm-table tbody tr.org-perm-row {
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.org-perm-table tbody tr.org-perm-row--NONE {
  background: linear-gradient(90deg, rgba(220, 53, 69, 0.22) 0, rgba(220, 53, 69, 0.06) 12px, #fff5f5 28px);
  box-shadow: inset 4px 0 0 0 #dc3545;
}
.org-perm-table tbody tr.org-perm-row--OBSERVER {
  background: linear-gradient(90deg, rgba(13, 110, 253, 0.18) 0, rgba(13, 110, 253, 0.05) 12px, #f0f7ff 28px);
  box-shadow: inset 4px 0 0 0 #0d6efd;
}
.org-perm-table tbody tr.org-perm-row--MODIFY {
  background: linear-gradient(90deg, rgba(253, 126, 20, 0.2) 0, rgba(253, 126, 20, 0.06) 12px, #fff9f0 28px);
  box-shadow: inset 4px 0 0 0 #fd7e14;
}
.org-perm-table tbody tr.org-perm-row--DELETE {
  background: linear-gradient(90deg, rgba(25, 135, 84, 0.18) 0, rgba(25, 135, 84, 0.05) 12px, #f4fbf7 28px);
  box-shadow: inset 4px 0 0 0 #198754;
}
/* 조직별 권한 — 개별 조직 선택 컨트롤 */
.org-perm-unit-control-row .form-label {
  color: #6c757d;
  font-weight: 600;
}
.org-perm-unit-control-row .form-control[readonly] {
  background-color: #f8f9fa;
}

.org-perm-matrix .org-perm-legend {
  font-size: var(--app-base-font-size);
  gap: 0.75rem 1rem;
}
.org-perm-matrix .org-perm-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.org-perm-matrix .org-perm-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.org-perm-legend .org-perm-legend-none { background: #dc3545; }
.org-perm-legend .org-perm-legend-observer { background: #0d6efd; }
.org-perm-legend .org-perm-legend-modify { background: #fd7e14; }
.org-perm-legend .org-perm-legend-delete { background: #198754; }
.pg-perm-observer .btn:not(#searchBtn):not(.pagination-size-opt),
.pg-perm-modify .btn-danger {
  opacity: 0.65;
}

/* 도메인구성: URL·호스트 링크 (새 탭) */
.hq-domain-url-link {
  cursor: pointer;
}
.hq-domain-url-link:hover code.hq-domain-url-cell {
  text-decoration: underline;
  color: var(--bs-link-hover-color, #0a58ca);
}
.hq-domain-config-wrap a[target="_blank"]:not(.hq-domain-url-link) {
  cursor: pointer;
}
.hq-domain-config-wrap a[target="_blank"]:not(.hq-domain-url-link):hover {
  text-decoration: underline;
}
