/*
 * DataTables 1.10.18 Bootstrap 4 스타일(css/lib/datatables.css = dataTables.bootstrap4.css) 위에 얹는 앱 수정분.
 * 원본 파일을 직접 고쳐 쓰던 것을 그대로 옮겼다. css/lib/datatables.css 바로 다음에 로드한다.
 * 원본 규칙보다 뒤에 오므로, 원본에서 같은 명시도로 뒤에 있던 선언은 여기서 다시 적어 순서를 지킨다(주석 "순서 유지").
 */

/* 표 테두리: separate → collapse, 바깥 선 (웹 표 공통 디자인 — TBM 목록 기준. 나머지는 common.css 「표」 절) */
table.dataTable {
    border-collapse: collapse !important;
    border-bottom: 1px solid var(--color-border-default) !important;
    border-top: 1px solid var(--color-border-default) !important;
}

/* 칸은 왼쪽 선이 없고(아래 border-left-width: 0) 원본이 마지막 칸의 오른쪽 선도 지우므로(:last-child border-right-width: 0)
   표 왼쪽·오른쪽 선을 따로 긋는다.
   theme.css 의 .table.dataTable.no-footer { border: none } 보다 명시도가 낮아 !important 를 쓴다(위아래 선과 같다) */
table.table-bordered.dataTable {
    border-left: 1px solid var(--color-border-default) !important;
    border-right: 1px solid var(--color-border-default) !important;
}

/* 스크롤 표(scrollY·scrollX)는 머리와 몸이 다른 표로 나뉜다. 머리 표의 아래 선과 겹쳐 2px 가 되지 않게 몸 표의 위 선을 지운다.
   원본 div.dataTables_scrollBody table { border-top: none } 이 위 table.dataTable 의 !important 에 져서 다시 적는다 */
div.dataTables_scrollBody > table.dataTable {
    border-top: 0 !important;
}

/* 검색창(searching: true): common.css .form-control 높이(38px)를 낮추고 표와 띄운다.
   라벨 글자("검색:" — js/lib/datatable/datatables.js 기본 문구)는 font-size: 0 으로 숨기고 입력칸 안에 돋보기 아이콘을 둔다.
   모바일도 같은 datatable.js 를 쓰므로 문구는 JS 가 아니라 웹에서만 싣는 이 파일에서 바꾼다 */
div.dataTables_wrapper div.dataTables_filter label {
    position: relative;
    margin-bottom: 12px;
    font-size: 0;
}

div.dataTables_wrapper div.dataTables_filter label::before {
    content: "\f002"; /* fa-search */
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 12px;
    color: var(--color-text-muted);
    pointer-events: none;
}

div.dataTables_wrapper div.dataTables_filter input {
    height: 30px;
    min-height: 0;
    margin-left: 0;
    padding: 4px 8px 4px 28px;
    font-size: 12px;
}

/* 자동 생성 row · col 여백: 원본은 .table-responsive 안에서만 지운다. 그 밖에서는 row(-15px)·col(15px) 여백과 theme 의 row width: 100% 가 겹쳐
   표가 왼쪽으로 15px 당겨지고 오른쪽이 30px 비었다(카드 안 표 좌우 여백이 삐뚤어짐). TBM 목록 계열과 같게 지운다 */
div.dataTables_wrapper > div.row {
    margin-left: 0;
    margin-right: 0;
}
div.dataTables_wrapper > div.row > div[class^="col-"]:first-child {
    padding-left: 0;
}
div.dataTables_wrapper > div.row > div[class^="col-"]:last-child {
    padding-right: 0;
}
/* 표 위아래 바깥 여백(원본 6px) — 카드 안 여백·검색창 간격이 따로 있다(TBM 목록 계열은 이미 0) */
table.dataTable {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination {
    margin: 20px 0;
}

/* 정렬 화살표 위치 */
table.dataTable thead .sorting:before,
table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_desc:before,
table.dataTable thead .sorting_asc_disabled:before,
table.dataTable thead .sorting_desc_disabled:before {
    top: 6px;
}

table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after,
table.dataTable thead .sorting_asc_disabled:after,
table.dataTable thead .sorting_desc_disabled:after {
    right: 0.1em;
    top: 6px;
}

/* table-bordered: 칸 테두리, 자간. 머리 배경은 흰색(투명)이다 */
table.table-bordered.dataTable th,
table.table-bordered.dataTable td {
    border: 1px solid var(--color-border-default);
    border-left-width: 0; /* 순서 유지 — 원본 같은 규칙의 선언. 위 border 단축 속성에 덮이지 않게 다시 적는다 */
    letter-spacing: 0;
}

/* stat/mainManageMonitor.jsp */
table.table-bordered.dataTable.table_whitespace th {
    white-space: normal !important;
}

/* 원본은 행의 마지막 칸 오른쪽 선을 지운다(border-right-width: 0). 머리에 rowspan 이 있으면 마지막 칸이 표 가운데에 와서
   (adminboard-lite 3행 머리 등) 그 칸 오른쪽 선이 빠진다. 표 오른쪽 끝 선은 위 표 테두리와 겹쳐 한 줄로 그려지므로 되살린다 */
table.table-bordered.dataTable th:last-child,
table.table-bordered.dataTable td:last-child {
    border-right-width: 1px;
    letter-spacing: 0;
}

table.table-bordered.dataTable tbody th,
table.table-bordered.dataTable tbody td {
    letter-spacing: 0;
}
