/* Global Font Settings */
/* 🔤 본문 글꼴 = **Noto Sans KR** (2026-08-17 사용자 결정 — 시안 N6).
   🔥 실제로 화면에 그려지는 글꼴을 정하는 자리는 여기다 — 번들의 sans-serif 토큰보다
      !important 로 세다. 🕘 2026-08-17 이전에는 이 줄이 Pretendard 였다(jsDelivr CDN).
   🔥 **!important 를 지우지 말 것** — 다크 번들(style.dark.bundle.css 47330행)이
      html · body 에 Poppins 를 **변수 없이 박아** 두었다. 지우면 다크 화면이 통째로
      Poppins(설치돼 있지 않으므로 실제로는 대체 글꼴)로 떨어진다.
   📌 글꼴 파일은 head.html 의 구글 폰트 링크가 받는다(자체 호스팅하지 않는 이유도 그 주석에).
   📌 번들 토큰 교정과 html 요소는 design-system.css 0-1 절이 맡는다. */
body, button, input, select, textarea {
    font-family: 'Noto Sans KR', sans-serif !important;
}

/* Summernote Editor Styles */
.note-icon-caret { display: none; }
.note-editor .note-toolbar .note-dropdown-menu,
.note-popover .popover-content .note-dropdown-menu { min-width: 225px !important; }
.note-modal-footer { height: 70px !important; }
p { margin-bottom: 0 !important; }

/* Ajax Loading Popup Styles */
.ajax_coverpopup_box {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Page Loading Mask (Initial White Screen Prevention) */
#page_loading_mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--ds-surface);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}
[data-theme="dark"] #page_loading_mask {
    background: var(--ds-surface);
}

/* Navigation Icon Color Override */
.nav-icon-color svg g [fill] {
    fill: currentColor !important;
}

.aside-dark .menu-state-primary .menu-link:not(.active) .menu-icon .svg-icon svg g [fill] {
    fill: currentColor !important;
}

/* Utility Class for Preserving Line Breaks */
.preserve-line-breaks {
    white-space: pre-wrap;
}

/* Comment Styles */
.comment-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}
.comment-card {
    max-width: 80%;
    border-radius: 1.25rem;
    padding: 1rem 1.25rem;
}
.comment-container.comment-mine .comment-card {
    background-color: var(--ds-fill);
    align-self: flex-start;
}
.comment-container.comment-other .comment-card {
    background-color: var(--ds-primary-soft);
    align-self: flex-end;
}
.comment-time {
    font-size: 0.8rem;
    color: var(--ds-text-faint);
    margin-top: 0.25rem;
}
.comment-container.comment-mine .comment-time {
    align-self: flex-start;
    margin-left: 0.5rem;
}
.comment-container.comment-other .comment-time {
    align-self: flex-end;
    margin-right: 0.5rem;
}

/* ===== Layout Compact: Reduce vertical space for 1920x1080 ===== */

/* 1. Hide breadcrumb separator and breadcrumb in header (integrated into title line via CSS) */
#kt_header_nav .page-title > span.h-20px.border-gray-200 {
    display: none;
}
#kt_header_nav .page-title > ul.breadcrumb {
    display: none;
}

/* 2. Header height - use default */

/* 3. Hero card body padding reduction (p-5 -> compact) */
#kt_content .card > .card-body.flex-column.p-5 {
    padding: 0.75rem !important;
}
#kt_content .card > .card-body.flex-column.p-5 > .d-flex.align-items-center.p-3 {
    padding: 0.25rem 0.75rem !important;
}
#kt_content .card > .card-body.flex-column.p-5 > .card-rounded.p-3 {
    padding: 0.5rem 0.75rem !important;
}

/* 4. Content area bottom padding reduction */
#kt_content {
    padding-bottom: 0.5rem !important;
}
#kt_post {
    padding-bottom: 0 !important;
}

/* 5. Footer compact */
#kt_footer {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* 6. Hero card bottom margin reduction */
#kt_content_container > .card.mb-5:first-child {
    margin-bottom: 0.75rem !important;
}

/* 7. Card header height match with title card (py-4 = 1.5rem top/bottom) */
.card .card-header.tpl-card-header {
    min-height: auto !important;
    padding: 1rem 1.25rem !important;
    align-items: center !important;
}

/* -------------------------------------------------------------
   아이콘 색 상속 복구
   Metronic style.bundle.css 에 전역 `i{line-height:1;font-size:1rem;color:#a1a5b7}` 가 있다.
   태그 선택자로 모든 <i> 를 회색으로 칠해서, 부모에 color 를 줘도 아이콘이 상속받지 못한다.
   → 파란 버튼 안의 화살표가 회색으로 남고, 색을 준 쪽은 "왜 안 먹지?" 하게 된다.

   실제 사고(2026-07-15): 진행 상태 스테퍼의 체크가 회색으로 나와
   초록 배경(#50cd89) 위에서 대비 1.35:1 로 사실상 안 보였다.
   .contract-step-icon 에 color:#fff 를 줬는데도 아이콘엔 안 먹었다.

   여기서는 **색만** 상속으로 되돌린다(line-height/font-size 는 Metronic 값 유지).
   `text-primary` 같은 명시 색 클래스는 (0,1,0) 이라 이 규칙(0,0,1)을 이기므로 그대로 동작한다.
   즉 "아이콘 색을 지정하고 싶으면 클래스로" 라는 Metronic 관례는 유지되고,
   "부모 색을 따르게 하고 싶다" 는 기대만 정상화된다.
   ------------------------------------------------------------- */
i {
    color: inherit;
}

/* -------------------------------------------------------------
   숫자 셀이 오른쪽 끝에 딱 붙는 문제 (2026-07-16)

   Metronic 이 `.table td:last-child,.table th:last-child{padding-right:0}` 을 준다
   (`.table.gs-0` 도 동일). 표의 **마지막 열이 금액·수량 같은 우측정렬 숫자**면
   숫자가 카드 테두리에 그대로 달라붙는다 — 지침상 여백이 있어야 한다.
   원본 규칙엔 !important 가 없어서 !important 만 붙이면 이긴다.

   우측정렬 셀에만 건다(`text-end`). 좌측정렬 셀은 원래 붙지 않으므로 건드리지 않는다.
   모바일 카드형(.ds-card-table)은 셀 패딩을 카드가 직접 관리하므로 제외한다
   — 안 빼면 `.ds .ds-card-table tbody td{padding:0!important}`(0,2,2)를
   이 규칙(0,3,1)이 이겨서 카드 안쪽 간격이 틀어진다.
   ------------------------------------------------------------- */
.table:not(.ds-card-table) > * > tr > td.text-end:last-child,
.table:not(.ds-card-table) > * > tr > th.text-end:last-child {
    padding-right: .75rem !important;
}

/* ── 🔎 **모달 안 검색줄 — 좁은 폭에서 「검색 전 전폭 · 검색 후 반반」** (2026-09-01 사용자 지시 · 화면검증 #72)
   🔬 **무엇이 문제였나**(375px, 여행사 분쟁 등록 ▸ 거래 선택 모달): 검색 버튼이 **줄의 오른쪽 절반**만
      쓰고 왼쪽이 비었다. 범인은 「검색 취소」 버튼이다 — **`d-none` 으로 숨어 있을 뿐 DOM 에는 있어서**
      두 칸짜리 격자의 첫 칸을 예약해 버린다.
      🔑 **`d-none` 인 요소는 `offsetParent` 판정에서 빠진다** — 버튼을 셀 때 **숨은 것도 함께 볼 것.**
   ✅ **검색 전**(취소가 `d-none`) → 검색 버튼이 **줄 전체** · **검색 후**(취소가 보임) → **반반**.
   ⚠️ **모달은 `#kt_content.ds` 밖이라 `design-system.css` 의 `.ds .input-group` 격자가 닿지 않는다**
      → 여기서 격자를 **직접** 세운다. 🔥 선택자에 `.ds` 를 붙이지 말 것(조용히 아무 일도 안 한다).
   ⚠️ Bootstrap 의 `.input-group > .form-control{width:1%}` 은 격자에서 그대로 먹는다 → 폭을 되돌린다.
   🔴 **세 앱에 같은 문장으로 들어간다** — 이 앱은 분쟁 등록·상품/템플릿/아이템 선택 모달이 대상이다. */
/* 🕘 2026-09-07: 문턱을 **575.98 → 767.98** 로 합쳤다(사장님 확정 「구간 수를 줄인다」).
   🔑 `design-system.css` 의 `.ds-actions` 문턱과 **같은 값**이어야 한다 — 한쪽만 옮기면 갈린다. */
@media (max-width: 767.98px) {
    .modal .input-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--ds-search-gap);
        align-items: center;
    }
    .modal .input-group > .form-control,
    .modal .input-group > .form-select { width: auto; min-width: 0; }
    .modal .input-group > .input-group-text { display: none; }
    .modal .input-group > input[type="text"] { grid-column: 1 / -1; }
    .modal .input-group > .btn { grid-column: 1 / -1; }
    .modal .input-group:has(> .btn-secondary:not(.d-none)) > .btn { grid-column: auto; }
    .modal .input-group > .form-control,
    .modal .input-group > .btn { border-radius: .425rem !important; }
}
