/* ============================================
   XPRO 카카오VX 공통 스타일
   Bootstrap 5.3 기반 — 커스터마이즈는 여기에만
============================================ */

/* --- 폼 테이블 라벨 컬럼 폭 (CSP 정합 — inline style 대체) --- */
.col-label-w20 { width: 20%; }
.col-label-w15 { width: 15%; }

/* --- 기본 타이포 --- */
body {
  font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', -apple-system, sans-serif;
  background-color: #f5f7fa;
}

/* --- 헤더/네비 --- */
.navbar-brand {
  font-weight: 700;
}

/* --- 레이아웃 --- */
.container-narrow {
  max-width: 960px;
}

/* --- 유틸리티 --- */
.text-prewrap {
  white-space: pre-wrap;
  word-break: break-word;
}

.col-num  { width: 80px; }
.col-stat { width: 100px; }
.col-date { width: 160px; }

/* --- Form 공통 --- */
.required::after {
  content: ' *';
  color: #dc3545;
}

/* --- Alert 간격 조정 --- */
.alert-compact {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

/* --- 카드 shadow 일관성 --- */
.card.shadow-sm {
  border: 0;
}

/* --- 푸터 --- */
.site-footer {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #6c757d;
  font-size: 0.875rem;
}

/* --- Bootstrap invalid-feedback 항상 표시 --- */
.form-control.is-invalid ~ .invalid-feedback { display: block; }

/* --- XproUI Loading 오버레이 (공통) --- */
.xpro-loading {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1090;
}

/* ==============================================
   웹 접근성 (KWCAG 2.2)
============================================== */

/* "본문 바로가기" — 평상시 화면 밖, 키보드 Tab 포커스 시 노출 */
.skip-nav {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: #000;
  color: #fff;
  text-decoration: none;
}
.skip-nav:focus {
  left: 0;
  outline: 3px solid #ffc107;
}

/* 포커스 가시성 강화 — KWCAG 2.4.7 */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* 스크린 리더 전용 텍스트 (시각적 숨김) */
.sr-only, .visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* 색상 대비 보강 — WCAG AA (4.5:1 이상) */
.text-muted { color: #5a6268 !important; }  /* 기본 #6c757d 대비 3.9 → 개선 */

/* ==============================================
   게시판 / 폼 공통 유틸리티
   (인라인 style 대체 클래스)
============================================== */

/* 필수 입력 표시 (color:red 대체) */
.text-required {
  color: #dc3545;
  font-weight: bold;
}

/* 안내문 블록 (customer/list.jsp .design_info) */
.design-info {
  width: 100%;
  padding: 20px;
  border: 10px solid #ececec;
  margin-top: 30px;
  font-size: 14px;
}
.design-info > div {
  max-width: 700px;
  margin: 0 auto;
}
.design-info > div > p:first-child {
  font-weight: bold;
  color: #0000FE;
}
.design-info > div > p:nth-child(2) {
  font-weight: bold;
  margin-top: 20px;
  color: #000;
}
.design-info > div > ul {
  list-style: square;
}

/* 테이블 컬럼 너비 */
.col-author { width: 8%; }
.col-label  { width: 24%; }

/* 검색 입력 요소 */
.col-search-type { width: auto; }
.col-search-input { width: 200px; }

/* 게시물 본문 뷰 테이블 (#notice_view 대체) */
.notice-view thead tr th {
  background: #f5f5f5;
  padding: 12px;
  font-size: 15px;
}
.notice-view td.writer {
  font-size: 13px;
  color: #555;
  padding: 8px 12px;
}
.notice-view td.writer strong {
  margin-left: 4px;
  margin-right: 12px;
  color: #333;
}
.notice-view td.writer span {
  color: #ccc;
}
.notice-view td.view_con {
  min-height: 50px;
  height: auto;
  line-height: 1.5;
  padding: 12px;
}
.notice-view td {
  line-height: 1.5;
}

/* 게시물 본문 뷰: 첨부파일 행 높이 */
.view-row {
  height: 20px;
  line-height: 40px;
}

/* readonly textarea 콘텐츠 표시 */
.view-content {
  width: 100%;
  height: 200px;
  border: none;
  padding: 10px;
  font-size: 16px;
  resize: none;
}

/* 첨부파일 링크 */
.attach-link {
  display: inline-block;
  margin-right: 20px;
  color: #666;
}

/* 답글 첨부파일 행 */
.reply-file-row {
  height: 20px;
  line-height: 20px;
}

/* 폼 액션 버튼 영역 — 모든 form 페이지 일관 (오른쪽 정렬) */
.form-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* 버튼 줄 (view.jsp .btn-type-list2) — 삭제/수정/목록 전용 컬러 라벨 포함 */
.btn-type-list2 {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.btn-type-list2 a {
  padding: 6px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
}
.btn-type-list2 a.delete { background: #dc3545; color: #fff; }
.btn-type-list2 a.modify { background: #0d6efd; color: #fff; }
.btn-type-list2 a.list2  { background: #6c757d; color: #fff; }

/* OTP 입력 시각 강조 */
.otp-input-large {
  letter-spacing: 0.4em;
  font-size: 1.5rem;
}

/* --- 처리현황 단계 라벨 (ASP step01~step09 1:1) --- */
.step01, .step02, .step03, .step04, .step09 {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.step01 { background: #6c757d; }   /* 등록 — 회색 */
.step02 { background: #0d6efd; }   /* 접수 — 파랑 */
.step03 { background: #fd7e14; }   /* 처리중 — 주황 */
.step04 { background: #198754; }   /* 완료 — 녹색 */
.step09 { background: #dc3545; }   /* 보류 — 빨강 */

/* ============================================
   Admin 검색 폼 — height 축소 (label 작게 + 모바일 숨김)
   - 데스크톱: 라벨 폰트 작게 + 마진 축소 (전체 height ~30% 감소)
   - 모바일: 라벨 자체 숨김 (placeholder/option 으로 의미 전달).
   적용 대상: admin layout 의 검색 카드 (.card.shadow-sm 내 form-label).
============================================ */
/* admin 검색 form — label 자체 비표시 (placeholder 로 의미 전달).
   1줄 한 칸 구조 → 검색 영역 height 최소화. */
.admin-layout main form.card .form-label {
    display: none;
}
.admin-layout main form.card .card-body {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}
@media (max-width: 991.98px) {
    .admin-layout main form.card .card-body {
        padding: 0.5rem;
    }
}

/* ============================================
   반응형 — 모바일 (≤768px) 일괄 패치
   사용자/관리자 공용. 개별 jsp 변경 0 (공통 라이브러리 원칙).
============================================ */
@media (max-width: 768px) {
  /* customer/list 의 검색 form + 글쓰기 버튼 영역 — 모바일에서 wrap 시 가로 overflow 차단 */
  .notice_top {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .notice_top form,
  .notice_top > a { width: 100%; }

  /* 모든 버튼 글자 한 줄 유지 — Bootstrap 기본 nowrap 인데 일부 환경에서 wrap 발생 ("확인"이 "확/인"으로 분리되던 현상) */
  .btn { white-space: nowrap; }

  /* customer/list 검색 영역 — 모바일에서 select(타입) + 키워드 input + 확인 버튼 한 줄 유지하되
     input 이 가용 폭 차지. select 는 폭 줄이고 버튼은 nowrap 유지. */
  .notice_top .srch_set2 {
    width: 100%;
    flex-wrap: nowrap;
  }
  .notice_top .srch_set2 > select {
    flex: 0 0 auto;
    min-width: 6rem;
    max-width: 9rem;
  }
  .notice_top .srch_set2 > input[type="text"],
  .notice_top .srch_set2 > input:not([type]) {
    flex: 1 1 0;
    min-width: 0;
  }
  .notice_top .srch_set2 > .btn {
    flex: 0 0 auto;
  }

  /* 테이블 가로 스크롤 자동 (Bootstrap .table-responsive 동등). 카드/상세 변환 제외. */
  main .table:not(.mobile-card-table):not(.notice-view) {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    font-size: 0.9rem;
  }
  main .table:not(.mobile-card-table):not(.notice-view) th,
  main .table:not(.mobile-card-table):not(.notice-view) td { white-space: nowrap; }

  /* 글 상세(view) — 작성자 메타 한 줄에 다 못 들어가니 wrap, textarea/안 콘텐츠 폭 100%. */
  main .table.notice-view { table-layout: auto; }
  main .table.notice-view td { white-space: normal !important; }
  main .table.notice-view td.writer { line-height: 1.9; font-size: 0.9rem; }
  main .table.notice-view td.writer span { display: inline; }
  main .table.notice-view td .view-content,
  main .table.notice-view textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* 카드 변환 — 사용자 friendly list (table → 행마다 카드).
     각 td 의 data-label 속성을 ::before 로 표기 → 라벨/값 한 줄 정렬.
     데스크톱은 일반 table 그대로 (이 미디어 쿼리 안에서만 적용).
     table·tbody 도 block 으로 (auto width 제거 — 적은 컬럼 테이블이 컨텐츠 폭 만큼만 좁아지는 현상 방지). */
  main .table.mobile-card-table {
    border: 0;
    display: block;
    width: 100%;
  }
  main .table.mobile-card-table thead { display: none; }
  main .table.mobile-card-table tbody { display: block; width: 100%; }
  main .table.mobile-card-table tbody tr {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 10px 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  }
  main .table.mobile-card-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 0 !important;
    padding: 4px 0 !important;
    text-align: right !important;
    white-space: normal;
  }
  main .table.mobile-card-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #666;
    margin-right: 8px;
    flex: 0 0 auto;
    text-align: left;
  }
  /* 제목(긴 텍스트) — 라벨 위, 값 아래 (block stack) */
  main .table.mobile-card-table tbody td.title {
    display: block;
    text-align: left !important;
  }
  main .table.mobile-card-table tbody td.title::before {
    display: block;
    margin-bottom: 4px;
  }
  /* 빈 결과 행 — colspan 단일 셀에선 라벨 표기 X */
  main .table.mobile-card-table tbody td[colspan]::before { content: none; }
  main .table.mobile-card-table tbody td[colspan] { display: block; text-align: center !important; }

  /* customer/list 의 검색 form + 글쓰기 버튼 — 글쓰기 우측 align 유지 */
  .notice_top .positive_btn { margin-left: auto; }

  /* form-actions / btn-type-list2 — 모바일에서도 데스크톱과 동일하게 작은 inline 버튼 유지
     (모바일 prominent stack 불필요 — 폭만 좁아지면 자연 wrap). */
  .form-actions,
  .btn-type-list2 {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .form-actions .btn,
  .form-actions a.btn,
  .btn-type-list2 a { width: auto; flex: 0 0 auto; }

  /* 검색 폼 col-md-auto / col-md-3·6 모바일 stack — Bootstrap 기본 동작 보강 */
  main form .col-md-auto { width: 100%; }
  main form .col-md-auto .btn { width: 100%; }

  /* navbar 햄버거 collapse — 모바일 가독성 보강 (디자인 표준)
     - 펼친 메뉴 항목을 구분선/padding 으로 시각 분리
     - 사용자 정보/로그아웃 영역은 메뉴와 분리 */
  .navbar-dark .navbar-collapse {
    padding: 0.75rem 0;
    border-top: 1px solid rgba(255,255,255,0.15);
    margin-top: 0.5rem;
  }
  .navbar-dark .navbar-collapse .nav-link,
  .navbar-dark .navbar-collapse .dropdown-item {
    padding: 0.6rem 0.5rem;
  }
  .navbar-dark .navbar-collapse .navbar-text {
    padding: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.15);
    margin-top: 0.5rem;
    width: 100%;
  }
  /* 사용자 액션 버튼(비번 변경/로그아웃 등) — 풀폭 + 간격 */
  .navbar-dark .navbar-collapse .btn-outline-light {
    margin: 0.25rem 0;
    width: 100%;
    text-align: center;
  }
  /* dropdown 메뉴 — 모바일에선 inline 펼침 (별도 floating 카드 X) */
  .navbar-dark .navbar-collapse .dropdown-menu {
    background: transparent;
    border: 0;
    padding-left: 1rem;
  }
  .navbar-dark .navbar-collapse .dropdown-item {
    color: rgba(255,255,255,0.85);
  }
  .navbar-dark .navbar-collapse .dropdown-item:hover,
  .navbar-dark .navbar-collapse .dropdown-item:focus {
    background: rgba(255,255,255,0.08);
    color: #fff;
  }

  /* 카드 패딩 축소 */
  main .card-body { padding: 1rem; }
}
