/* th min-width */
#counselorCommission, #closeTable {
    table-layout: auto;
}

/* 내 계약건 조회 */
#contractTable th.no { width: 50px; }
#contractTable th.code { width: 150px; }
#contractTable th.count { width: 80px; }
#contractTable th.amount { width: 150px; }
#contractTable th.prd-name { width: 450px; }
#contractTable th.name { width: 150px; }
#contractTable th.date { width: 100px; }
#contractTable th.percent { width: 100px; }

/* 상담원별 수수료 */
#counselorCommission th.seq { min-width: 50px; }
#counselorCommission th.name { min-width: 100px; }
#counselorCommission th.date { min-width: 130px; }
#counselorCommission th.amount { min-width: 150px; }
#counselorCommission th.memo { min-width: 300px; }

/* 수수료 마감 */
#closeTable th.all-check { min-width: 50px; }
#closeTable th.code { min-width: 100px; }
#closeTable th.count { min-width: 150px; }
#closeTable th.amount { min-width: 130px; }
#closeTable th.memo { min-width: 300px; }

/* 수수료 마감 - 고정 컬럼 (좌우 스크롤 시 고정) */
#closeTable thead tr:first-child th:nth-child(1),
#closeTable tbody td:nth-child(1),
#closeTable thead tr.total-row th:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 10;
}
#closeTable tbody td:nth-child(1) {
    background-color: #fff;
}

#closeTable thead tr:first-child th:nth-child(2),
#closeTable tbody td:nth-child(2) {
    position: sticky;
    left: 50px;
    z-index: 10;
}
#closeTable tbody td:nth-child(2) {
    background-color: #fff;
}
#closeTable thead tr:first-child th:nth-child(3),
#closeTable tbody td:nth-child(3) {
    position: sticky;
    left: 150px;
    z-index: 10;
}
#closeTable tbody td:nth-child(3) {
    background-color: #fff;
}
#closeTable thead tr:first-child th:nth-child(4),
#closeTable tbody td:nth-child(4) {
    position: sticky;
    left: 250px;
    z-index: 10;
}
#closeTable tbody td:nth-child(4) {
    background-color: #fff;
}
#closeTable thead tr:first-child th:nth-child(5),
#closeTable tbody td:nth-child(5) {
    position: sticky;
    left: 350px;
    z-index: 10;
}
#closeTable tbody td:nth-child(5) {
    background-color: #fff;
}
#closeTable thead tr:first-child th:nth-child(6),
#closeTable tbody td:nth-child(6) {
    position: sticky;
    left: 450px;
    z-index: 10;
    /* border-right: 1px solid var(--borderColor); */
}
#closeTable tbody td:nth-child(6) {
    background-color: #fff;
}

#closeTable::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 550px;
    width: 1px;
    height: 100%;
    background: var(--borderColor);
    z-index: 99;
}
/* #closeTable::after {
    content: "";
    display: block;
    position: absolute;
    top: 89px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--borderColor);
    z-index: 99;
} */
.table_scroll.close_page .table_wrap {
    max-height: calc(100dvh - 260px);
    overflow: auto; 
}

.table_scroll.close_page {
    max-height: none;
    overflow: visible;
    position: relative;
}

#closeTable thead th {
    position: sticky;
    top: 0;
    z-index: 11; 
}

#closeTable thead tr:nth-child(2) th {
    top: 43px; 
    z-index: 11;
}
#closeTable thead tr.total-row th {
    top: 109px; 
    z-index: 11;
}

#closeTable thead tr:first-child th:nth-child(1),
#closeTable thead tr:first-child th:nth-child(2),
#closeTable thead tr:first-child th:nth-child(3),
#closeTable thead tr:first-child th:nth-child(4),
#closeTable thead tr:first-child th:nth-child(5),
#closeTable thead tr:first-child th:nth-child(6),
#closeTable thead tr.total-row th:nth-child(1)  {
    z-index: 12; 

}



/* 상담원별 / 관리자별 명세서 */
.table_scroll.counselor_page .table_wrap, .table_scroll.manage_page .table_wrap {
    max-height: calc(100dvh - 260px);
    overflow: auto;
}

.table_scroll.counselor_page, .table_scroll.manage_page {
    --c1: 50px;    /* NO       */
    --c2: 90px;   /* 코드      */
    --c3: 70px;   /* 성명      */
    --c4: 70px;   /* 소속      */
    --c5: 100px;   /* 위촉일    */
    --c6: 100px;   /* 해촉일    */
    --c7: 60px;   /* 위촉차수  */
 
    /* 자동 계산*/
    --l1: 0px;
    --l2: var(--c1);
    --l3: calc(var(--l2) + var(--c2));
    --l4: calc(var(--l3) + var(--c3));
    --l5: calc(var(--l4) + var(--c4));
    --l6: calc(var(--l5) + var(--c5));
    --l7: calc(var(--l6) + var(--c6));
    --lend: calc(var(--l7) + var(--c7));

    max-height: none;
    overflow: visible;
    position: relative;
}


#counselorCommission thead th {
    position: sticky;
    top: 0;
    z-index: 11;

}

#counselorCommission thead tr:nth-child(2) th {
    top: 43px;
    z-index: 11;
}

#counselorCommission thead tr:nth-child(3) th {
    top: 86.5px;
    z-index: 11;
}

#counselorCommission thead tr:nth-child(4) th {
    top: 130px;
    z-index: 11;
}

#counselorCommission thead tr:nth-child(5) th {
    top: 175px;
    z-index: 11;
}

#counselorCommission thead tr:first-child th:nth-child(1),
#counselorCommission thead tr:first-child th:nth-child(2),
#counselorCommission thead tr:first-child th:nth-child(3),
#counselorCommission thead tr:first-child th:nth-child(4),
#counselorCommission thead tr:first-child th:nth-child(5),
#counselorCommission thead tr:first-child th:nth-child(6),
#counselorCommission thead tr:first-child th:nth-child(7) {
    z-index: 12;
    top: 0;
    position: sticky;
}

#counselorCommission thead tr:first-child th:nth-child(1),
#counselorCommission tbody td:nth-child(1):not([colspan]) {
    position: sticky; left: var(--l1);
    width: var(--c1); min-width: var(--c1);
}

#counselorCommission tbody td:nth-child(1), #counselorCommission tbody td:nth-child(2), #counselorCommission tbody td:nth-child(3), #counselorCommission tbody td:nth-child(4), #counselorCommission tbody td:nth-child(5), #counselorCommission tbody td:nth-child(6), #counselorCommission tbody td:nth-child(7)  {
    background-color: #fff;
}

#counselorCommission thead tr:first-child th:nth-child(2),
#counselorCommission tbody td:nth-child(2) {
    position: sticky; left: var(--l2);
    width: var(--c2); min-width: var(--c2);
}

#counselorCommission thead tr:first-child th:nth-child(3),
#counselorCommission tbody td:nth-child(3) {
    position: sticky; left: var(--l3);
    width: var(--c3); min-width: var(--c3);
}

#counselorCommission thead tr:first-child th:nth-child(4),
#counselorCommission tbody td:nth-child(4) {
    position: sticky; left: var(--l4);
    width: var(--c4); min-width: var(--c4);
}

#counselorCommission thead tr:first-child th:nth-child(5),
#counselorCommission tbody td:nth-child(5) {
    position: sticky; left: var(--l5);
    width: var(--c5); min-width: var(--c5);
}

#counselorCommission thead tr:first-child th:nth-child(6),
#counselorCommission tbody td:nth-child(6) {
    position: sticky; left: var(--l6);
    width: var(--c6); min-width: var(--c6);
}


#counselorCommission thead tr:first-child th:nth-child(7),
#counselorCommission tbody td:nth-child(7) {
    position: sticky; left: var(--l7);
    width: var(--c7); min-width: var(--c7);
}

#counselorCommission::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: var(--lend);
    width: 1px;
    height: 100%;
    background: var(--borderColor);
    z-index: 99;
}
/* #counselorCommission::after {
    content: "";
    display: block;
    position: absolute;
    top: 218.5px;
    left: 0px;
    width: 100%;
    height: 1px;
    background: var(--borderColor);
    z-index: 99;
} */

.table_scroll {
    max-height: calc(100% - 260px);
}
.table_scroll { position: relative; } 

/* 스크롤 이미지 */
.close_page .scroll_left, .close_page .scroll_right { 
    display: block; position: absolute; top: 2px; height: 40px; z-index: 50; cursor: pointer; } 
.close_page .scroll_left { left: 555px; } 
.close_page .scroll_right { right: 5px; } 
.close_page .scroll_left img, .close_page .scroll_right img { height: 100%; } 

.counselor_page .scroll_left, .counselor_page .scroll_right { 
    display: block; position: absolute; top: 2px; height: 40px; z-index: 50; cursor: pointer; } 
.counselor_page .scroll_left { left: calc(var(--lend) + 5px); } 
.counselor_page .scroll_right { right: 5px; } 
.counselor_page .scroll_left img, .counselor_page .scroll_right img { height: 100%; } 

.manage_page .scroll_left, .manage_page .scroll_right { 
    display: block; position: absolute; top: 2px; height: 40px; z-index: 50; cursor: pointer; } 
.manage_page .scroll_left {  left: calc(var(--lend, 710px) + 5px); } 
.manage_page .scroll_right { right: 5px; } 
.manage_page .scroll_left img, .manage_page .scroll_right img { height: 100%; } 

.my_contract_page .scroll_left, .my_contract_page .scroll_right { 
    display: block; position: absolute; top: 2px; height: 40px; z-index: 50; cursor: pointer; } 
.my_contract_page .scroll_left { left: 5px; } 
.my_contract_page .scroll_right { right: 5px; } 
.my_contract_page .scroll_left img, .my_contract_page .scroll_right img { height: 100%; }

.my_contract_page .scroll_left, .my_contract_page .scroll_right { 
    display: block; position: absolute; top: 2px; height: 40px; z-index: 10; cursor: pointer; } 
.my_contract_page .scroll_left { left: 5px; } 
.my_contract_page .scroll_right { right: 5px; } 
.my_contract_page .scroll_left img, .my_contract_page .scroll_right img { height: 100%; }

