html {
  font-size: 14px;
}

/* Swal 표시 시 스크롤바 사라짐으로 인한 레이아웃 밀림 방지 (메인 레이아웃 페이지) */
html:not(.app-blank) {
  overflow-y: scroll;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* 관리자 공통 입력: 단위 입력 그룹과 동일한 표면·테두리 사용 */
.form-control.form-control-solid,
.form-select.form-select-solid {
  background-color: #fff;
  border-color: #d8dde6;
  color: #344054;
}
.form-control.form-control-solid:focus,
.form-select.form-select-solid:focus {
  background-color: #fff;
  border-color: #8fa2bd;
  box-shadow: none;
}
.form-control.form-control-solid[readonly] {
  background-color: #e8ecf2;
  border-color: #c2cad6;
  color: #667085;
  cursor: not-allowed;
  opacity: 1;
}
.form-control.form-control-solid:disabled,
.form-select.form-select-solid:disabled {
  background-color: #eef1f5;
  border-color: #d8dde6;
  color: #98a2b3;
  cursor: not-allowed;
  opacity: 1;
}

/* 단위가 뒤에 붙는 입력 그룹: 입력값과 단위 영역을 명확히 구분 */
.input-group:has(> .form-control.form-control-solid + .input-group-text) > .form-control {
  background-color: #fff;
  border-color: #d8dde6;
  border-right: 0;
}
.input-group:has(> .form-control.form-control-solid + .input-group-text) > .input-group-text {
  min-width: 4.5rem;
  justify-content: center;
  background-color: #f5f7fa;
  border-color: #d8dde6;
  border-left: 1px solid #d8dde6;
  color: #344054;
  font-weight: 600;
}
.input-group:has(> .form-control.form-control-solid + .input-group-text) > .form-control:focus {
  border-color: #8fa2bd;
  box-shadow: none;
}
.input-group:has(> .form-control.form-control-solid + .input-group-text) > .form-control:focus + .input-group-text {
  border-color: #8fa2bd;
  border-left-color: #8fa2bd;
}
.input-group:has(> .form-control.form-control-solid:disabled + .input-group-text) > .form-control:disabled {
  background-color: #eef1f5;
  border-color: #d8dde6;
  color: #98a2b3;
  cursor: not-allowed;
  opacity: 1;
}
.input-group:has(> .form-control.form-control-solid:disabled + .input-group-text) > .input-group-text {
  background-color: #dfe5ed;
  border-color: #d8dde6;
  border-left: 1px solid #aab5c4;
  color: #667085;
  cursor: not-allowed;
  opacity: 1;
}
.input-group:has(> .form-control.form-control-solid[readonly] + .input-group-text) > .form-control[readonly] {
  background-color: #eef1f5;
  border-color: #c2cad6;
  color: #667085;
  cursor: not-allowed;
  opacity: 1;
}
.input-group:has(> .form-control.form-control-solid[readonly] + .input-group-text) > .input-group-text {
  background-color: #dfe5ed;
  border-color: #c2cad6;
  border-left: 1px solid #aab5c4;
  color: #475467;
  cursor: not-allowed;
  opacity: 1;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* 공통 검색 버튼 높이: form-control/form-select 기본 높이에 맞춤 */
#BtnSearch.btn {
  /* 테마 form-control( padding: 0.75rem 1rem ) 높이에 맞춤 */
  min-height: calc(1.5rem + 1.5rem + 2px);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
#BtnSearch.btn.btn-sm {
  min-height: calc(1.5rem + 1.5rem + 2px);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

/* 리스트/필터 헤더 영역: 검색/추가 버튼 높이 통일 */
.card-header .btn.btn-sm,
.card-header a.btn.btn-sm {
  min-height: calc(1.5rem + 1.5rem + 2px);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

/* 헤더 액션(검색/추가): 입력/셀렉트 높이에 완전 일치 */
.card-header .btn-header-action {
  /* btn-sm 포함해도 input/select(기본) 높이와 동일하게 */
  height: calc(1.5rem + 1.5rem + 2px);
  min-height: calc(1.5rem + 1.5rem + 2px);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

/* btn-sm이 붙어도 위 규칙을 우선 적용 */
.card-header .btn-header-action.btn-sm,
.card-header a.btn-header-action.btn-sm {
  height: calc(1.5rem + 1.5rem + 2px);
  min-height: calc(1.5rem + 1.5rem + 2px);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 500;
}

.faq-category-drag-handle {
  cursor: grab;
  color: #99a1b7;
  font-size: 1.25rem;
}

.faq-category-row.is-dragging {
  opacity: 0.45;
}

/* Select 필터 - 글자 안잘리게, 여러 개일 때 동일 크기 */
.select-filter-equal {
  display: flex;
  gap: 0.5rem;
}
.select-filter-equal .SelectParam {
  flex: 1 1 0;
  min-width: 180px;
}
.select-filter-equal .SelectParam option {
  white-space: normal;
}

/* 테이블 행 내 뱃지 크기 통일 - 같은 열의 badge는 동일한 width 유지 */
.table td:has(> .badge) {
  white-space: nowrap;
}
.table .badge {
  min-width: 6em;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
}

/* 파트너 상태 뱃지: 최소 넓이 보장 */
.table .badge-partner-state {
  min-width: 11em;
}

/* 리스트 테이블 공통 가독성 */
#table-section {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
#table-section .table {
  width: 100%;
  min-width: 960px;
  margin-bottom: 0;
}
#table-section .table th,
#table-section .table td {
  min-width: 96px;
  padding: 1rem 1.15rem;
  vertical-align: middle;
}
#table-section .table thead th {
  color: #7e8299;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 1px solid #e4e6ef;
}
#table-section .table tbody td {
  color: #3f4254;
  white-space: nowrap;
}
#table-section .table th:first-child,
#table-section .table td:first-child {
  padding-left: 1.25rem;
}
#table-section .table th:last-child,
#table-section .table td:last-child {
  padding-right: 1.25rem;
}
#table-section .table tbody tr {
  transition: background-color 0.12s ease;
}
#table-section .table tbody tr:hover {
  background-color: #f8fafd;
}
#table-section .table tbody tr.table-row-clickable {
  cursor: pointer;
}
#table-section .table tbody tr.table-row-clickable [data-partner-action] {
  cursor: pointer;
}

/* 현재 페이지 hover 시 테마 hover 색상이 active 글자색을 덮지 않도록 유지 */
.pagination .page-item.active:hover .page-link,
.pagination .page-item.active .page-link:focus {
  color: #FFFFFF;
}

/* Lending/Farming 탭 강조 */
.service-list-tabs.nav-line-tabs .nav-item {
  margin-bottom: -3px;
}
.service-list-tabs.nav-line-tabs .nav-item .nav-link {
  border-bottom-width: 3px;
  font-size: 1.05rem;
  font-weight: 800;
}
.service-list-tabs.nav-line-tabs .nav-item .nav-link.active,
.service-list-tabs.nav-line-tabs .nav-item.show .nav-link,
.service-list-tabs.nav-line-tabs .nav-item .nav-link:hover:not(.disabled) {
  border-bottom: 3px solid #4FC9DA;
}

/* ---------- 공통 인라인 스타일 제거용 유틸 ---------- */
.min-w-90 { min-width: 90px !important; }
.min-w-110 { min-width: 110px !important; }
.min-w-120 { min-width: 120px !important; }
.min-w-140 { min-width: 140px !important; }
.min-w-100 { min-width: 100px !important; }
.min-w-160 { min-width: 160px !important; }

.max-w-140 { max-width: 140px !important; }
.max-w-200 { max-width: 200px !important; }
.w-120 { width: 120px !important; }
.w-140 { width: 140px !important; }
.w-200 { width: 200px !important; }
.w-400 { width: 400px !important; }
.w-600 { width: 600px !important; }

.label-w-200 { width: 200px !important; }
.label-w-150 { width: 150px !important; }

.upload-zone {
  min-height: 100px !important;
  cursor: pointer !important;
}
.upload-zone.w-400 { width: 400px !important; }
.upload-zone.w-600 { width: 600px !important; }

.img-preview-contain-120 {
  max-width: 100% !important;
  max-height: 120px !important;
  object-fit: contain !important;
}
.img-preview-contain-220 {
  max-width: 100% !important;
  max-height: 220px !important;
  object-fit: contain !important;
}

.stats-period-select {
  width: 120px !important;
  min-width: 120px !important;
  max-width: 120px !important;
  flex: 0 0 120px !important;
}

.chart-h-300 {
  min-height: 300px !important;
  height: 300px !important;
}

#ActivatedSwitch.esg-activated-switch {
  width: 4.5rem !important;
}
.esg-detail-page #frmEsg .card-body > .mb-4 > label + div {
  flex: 1 1 0;
  min-width: 0;
}
.esg-detail-page #frmEsg .w-400,
.esg-detail-page #frmEsg .upload-zone.w-400 {
  width: 100% !important;
  max-width: 400px !important;
}

/* 로그인 페이지(레이아웃 null) 보정 */
html.app-blank,
body.app-blank {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
}
#kt_app_page.app-blank-root {
  min-height: 100vh;
  overflow: auto;
}
.login-illustration {
  background-image: url(/assets/media/illustrations/sketchy-1/2.png);
}

/* 정책관리 에디터 영역 */
.terms-editor {
  width: 100%;
  min-height: 300px;
}

/* 배너 리스트 테이블 */
.tbl-col-w-140 { width: 140px !important; }
.tbl-col-w-160 { width: 160px !important; }
.tbl-col-w-45p { width: 45% !important; }
.tbl-col-w-150 { width: 150px !important; }
.text-truncate-w-260 { max-width: 260px !important; }
.text-truncate-w-200 { max-width: 200px !important; }
.banner-thumb-frame {
  width: 100%;
  max-width: 360px;
  height: 96px;
  padding: 6px;
  border: 1px solid #eee;
  border-radius: 6px;
  background-color: #fafafa;
}
.banner-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 클릭 가능한 행/뱃지 */
.cursor-pointer { cursor: pointer !important; }

.editor-h-200 {
  width: 100% !important;
  min-height: 200px !important;
}

.swal-issued-pw {
  user-select: text;
  font-family: monospace;
  font-size: 16px;
  line-height: 1.6;
  padding: 10px 12px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  background: #fafafa;
  word-break: break-all;
}

.card-max-w-720 { max-width: 720px !important; }
.page-bg-gray { background: #f5f8fa !important; }
.swal-z-5000 .swal2-container { z-index: 5000; }

/* 회원 상세 */
.user-detail-page .card-body {
  padding: 2rem;
}
.user-detail-page .detail-section {
  padding: 1.35rem 0;
  border-bottom: 1px solid #eff2f5;
}
.user-detail-page .detail-section:first-child {
  padding-top: 0;
}
.user-detail-page .detail-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.user-detail-page .detail-title {
  margin: 0 0 1rem;
  color: #181c32;
  font-size: 1.05rem;
  font-weight: 700;
}
.user-detail-page .detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem 1.5rem;
}
.user-detail-page .detail-grid-wide {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.user-detail-page .member-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1199.98px) {
  .user-detail-page .member-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 767.98px) {
  .user-detail-page .member-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.user-detail-page .detail-service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem 2rem;
}
.user-detail-page .detail-service-block,
.user-detail-page .detail-field {
  min-width: 0;
}
.user-detail-page .detail-service-title {
  margin-bottom: 0.75rem;
  color: #3f4254;
  font-weight: 700;
}
.user-detail-page .detail-mini-grid {
  display: grid;
  gap: 0.75rem;
}
.user-detail-page .detail-label {
  display: block;
  margin-bottom: 0.3rem;
  color: #7e8299;
  font-size: 0.85rem;
  font-weight: 700;
}
.user-detail-page .detail-value {
  display: flex;
  min-height: 1.8rem;
  align-items: center;
  color: #181c32;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.user-detail-page .detail-value-number {
  font-variant-numeric: tabular-nums;
}
.user-detail-page .detail-value-lines {
  display: block;
  white-space: pre-line;
}
.user-detail-page .detail-card-table {
  min-width: 760px;
}

/* 입출금 상세 */
.transaction-detail-page .transaction-summary-card {
  border: 0;
  box-shadow: 0 0 20px rgba(76, 87, 125, 0.08);
}
.transaction-detail-page .transaction-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.transaction-detail-page .transaction-summary-main {
  min-width: 0;
}
.transaction-detail-page .transaction-summary-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.transaction-detail-page .transaction-summary-title {
  margin: 0 0 0.65rem;
  color: #181c32;
  font-size: 1.45rem;
  font-weight: 800;
}
.transaction-detail-page .transaction-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  color: #7e8299;
  font-weight: 600;
}
.transaction-detail-page .transaction-amount-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}
.transaction-detail-page .transaction-amount-item {
  min-width: 0;
  padding: 1rem;
  border: 1px solid #eff2f5;
  border-radius: 8px;
  background: #f9fafb;
}
.transaction-detail-page .transaction-amount-primary {
  border-color: #dbeafe;
  background: #eff6ff;
}
.transaction-detail-page .transaction-amount-label {
  display: block;
  margin-bottom: 0.4rem;
  color: #7e8299;
  font-size: 0.8rem;
  font-weight: 700;
}
.transaction-detail-page .transaction-amount-item strong {
  display: block;
  color: #181c32;
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.transaction-detail-page .transaction-amount-item span:last-child {
  display: block;
  margin-top: 0.35rem;
  color: #5e6278;
  font-weight: 700;
}
.transaction-detail-page .transaction-info-list,
.transaction-detail-page .transaction-chain-stack {
  display: grid;
  gap: 0.8rem;
}
.transaction-detail-page .transaction-info-list-wide {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem 1.5rem;
}
.transaction-detail-page .transaction-info-list > div,
.transaction-detail-page .transaction-chain-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #eff2f5;
}
.transaction-detail-page .transaction-info-list > div:last-child,
.transaction-detail-page .transaction-chain-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.transaction-detail-page .transaction-info-list > div > span:first-child,
.transaction-detail-page .transaction-chain-row > span:first-child {
  color: #7e8299;
  font-size: 0.85rem;
  font-weight: 700;
}
.transaction-detail-page .transaction-info-list strong,
.transaction-detail-page .transaction-chain-row strong {
  min-width: 0;
  color: #181c32;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.transaction-detail-page .transaction-badge-cell {
  min-width: 0;
  display: flex;
  align-items: center;
}
.transaction-detail-page .transaction-chain-row-long {
  padding: 0.85rem;
  border: 1px solid #eff2f5;
  border-radius: 8px;
  background: #fafafa;
}
.transaction-detail-page .transaction-deposit-log-card {
  margin-bottom: 2rem;
}
@media (max-width: 575.98px) {
  .transaction-detail-page .transaction-summary {
    display: block;
  }
  .transaction-detail-page .transaction-summary .btn {
    margin-top: 1rem;
  }
  .transaction-detail-page .transaction-info-list > div,
  .transaction-detail-page .transaction-chain-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}
