/* ================================
   기본 리셋 & 바디 스타일
================================ */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "맑은 고딕", sans-serif;
    background: #f3f4f6;
    color: #111827;
    font-size: 14px;
    line-height: 1.5;
}

/* 중앙 래퍼: body > center > div (기존 구조 활용) */
body > center > div {
    max-width: 1120px;
    margin: 24px auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .12);
    overflow: hidden;
    padding-bottom: 24px;
}

/* 불필요한 스페이서 div 완화 */
div[style*="line-height:1px"][style*="font-size:1px"] {
    height: 12px !important;
    line-height: 12px !important;
    font-size: 0 !important;
}

/* 로고 이미지 반응형 */
img {
    max-width: 100%;
    height: auto;
}

/* 상단 로고 영역 정돈 */
table[cellpadding="0"][cellspacing="0"][border="0"][width="100%"] td[align="center"] a img[src*="logo2.gif"] {
    margin-top: 8px;
}

/* ================================
   상단 로그인 바 (bg.gif 부분)
================================ */
td[height="36"][align="center"][background*="_img/top/bg.gif"] {
    /* 기존 배경 이미지 대신 그라데이션 느낌 */
    background: linear-gradient(90deg, #2563eb, #10b981) !important;
    color: #e5e7eb;
    font-size: 13px;
}

td[height="36"][align="center"][background*="_img/top/bg.gif"] table {
    width: 100% !important;
}

td[height="36"][align="center"][background*="_img/top/bg.gif"] td {
    padding: 0 16px 4px 16px !important;
}

/* 상단 인사말 텍스트 */
td[height="36"][align="center"][background*="_img/top/bg.gif"] font {
    color: #e5e7eb !important;
}

/* 상단 로그아웃 버튼 */
td[height="36"][align="center"][background*="_img/top/bg.gif"] img[src*="logout_button.gif"] {
    margin-left: 8px;
    vertical-align: middle;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.25));
}

/* 상단 구분 라인 색상 정리 */
div[style*="background-color:#7AB0DF"],
div[style*="background-color:#FFFFFF"],
div[style*="background-color:#D9DAD9"] {
    height: 2px !important;
    line-height: 0 !important;
    font-size: 0 !important;
    background-color: #e5e7eb !important;
}

/* ================================
   전체 레이아웃 (좌측 메뉴 / 우측 콘텐츠)
   - width="972" 테이블 기준
================================ */
table[width="972"][cellpadding="0"][cellspacing="0"][background*="_img/bg_all.gif"] {
    width: 100% !important;
    border-collapse: collapse;
}

/* 왼쪽 사이드바 */
table[width="972"] > tbody > tr > td[width="190"] {
    width: 220px !important;
    background: linear-gradient(180deg, #f9fafb, #eff6ff);
    border-right: 1px solid #e5e7eb;
    vertical-align: top;
    padding-top: 8px;
}

/* 오른쪽 메인 콘텐츠 */
table[width="972"] > tbody > tr > td[width="782"] {
    padding: 16px 20px 0 20px;
    vertical-align: top;
}

/* 좌측 상단 타이틀 이미지 주변 여백 */
table[width="190"] td[height="55"][align="center"] {
    padding-top: 8px;
}

/* 좌측 메뉴 이미지 버튼에 살짝 그림자 */
table[width="190"] a.rollover img {
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .08);
}

/* 좌측 고객센터 박스 */
td[width="190"] img[src*="customer_center.gif"] {
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, .12);
}

/* 좌측 하단 텍스트 링크들 */
td[width="190"] .left_m {
    font-size: 13px;
    padding: 4px 12px;
    border-bottom: 1px solid #d1d5db !important;
}

td[width="190"] .left_m a {
    text-decoration: none;
    color: #374151;
}

td[width="190"] .left_m a:hover {
    color: #2563eb;
}

/* ================================
   서브 타이틀 영역
================================ */
div[style*="width:752px;"][style*="clear:both;"] > div[style*='float: left;'] img[src*="data_room.gif"] {
    margin-right: 4px;
}

div[style*="width:752px;"][style*="clear:both;"] {
    width: 100% !important;
}

/* 타이틀 하단 회색 라인 */
div[style*="width:752px; height:1px;"][style*="BACKGROUND: #CCCCCC;"] {
    width: 100% !important;
    background: #e5e7eb !important;
}

/* 안내 문구 */
table[cellpadding="0"][cellspacing="0"][width="752"] td[width="48%"] {
    font-size: 13px;
    color: #4b5563;
}

/* ================================
   자료실 리스트 테이블
   - form name="fboardlist" 아래 첫 번째 752 테이블
================================ */
form[name="fboardlist"] table[width="752"] {
    width: 100% !important;
    border-collapse: collapse;
    margin-top: 6px;
    font-size: 13px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
}

/* 상단 진한 구분선 */
form[name="fboardlist"] table[width="752"] tr:first-child td {
    height: 2px;
    background: #d1d5db;
    padding: 0;
}

/* 헤더 행 (번호, 등록년월, 설문지 제목...) */
form[name="fboardlist"] table[width="752"] tr[height="26"] {
    background: #f9fafb;
    color: #111827;
    font-weight: 600;
}

form[name="fboardlist"] table[width="752"] tr[height="26"] td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
}

/* 헤더/데이터 컬럼 정렬 */
form[name="fboardlist"] table[width="752"] colgroup col[width="60"],
form[name="fboardlist"] table[width="752"] colgroup col[width="70"],
form[name="fboardlist"] table[width="752"] colgroup col[width="100"],
form[name="fboardlist"] table[width="752"] colgroup col[width="80"] {
    text-align: center;
}

/* 데이터 행 라인 */
form[name="fboardlist"] table[width="752"] tr[height="32"] td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
}

/* 지그재그 배경 */
form[name="fboardlist"] table[width="752"] tr[height="32"]:nth-child(2n+1) td {
    background: #ffffff;
}
form[name="fboardlist"] table[width="752"] tr[height="32"]:nth-child(2n) td {
    background: #f9fafb;
}

/* 행 hover */
form[name="fboardlist"] table[width="752"] tr[height="32"]:hover td {
    background: #eff6ff;
}

/* 설문지 제목 div */
form[name="fboardlist"] table[width="752"] td > div[style*="margin:6px 0 4px 0;"] {
    margin: 4px 0 !important;
    font-size: 13px;
    color: #111827;
}

/* 미리보기/복사 아이콘 영역 정렬 */
form[name="fboardlist"] table[width="752"] td[align="center"] img[src*="list_dataroom_view.gif"],
form[name="fboardlist"] table[width="752"] td[align="center"] img[src*="list_copy_on.gif"],
form[name="fboardlist"] table[width="752"] td[align="center"] img[src*="leaf.gif"] {
    vertical-align: middle;
}

/* leaf 아이콘 박스 (초록 테두리) 조금 다듬기 */
form[name="fboardlist"] table[width="752"] td[align="center"] div[style*="border:solid 1px limegreen"] {
    border-color: #22c55e !important;
    background: #ecfdf3;
}

/* ================================
   페이징 영역 (#paging_new6)
================================ */
#paging_new6 {
    margin-top: 12px;
    text-align: center;
    font-size: 13px;
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

#paging_new6 span,
#paging_new6 a {
    display: inline-flex;
    min-width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid transparent;
    text-decoration: none;
    margin: 0 2px;
}

/* 현재 페이지 */
#paging_new6 span.sel {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* 일반 페이지 번호 */
#paging_new6 a.numBox span {
    color: #374151;
}

/* 일반 페이지 버튼 스타일 */
#paging_new6 a.numBox {
    border-color: #d1d5db;
    background: #ffffff;
}

#paging_new6 a.numBox:hover {
    border-color: #2563eb;
}

/* 다음 버튼 */
#paging_new6 a.numNext a.numPrev {
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
}

#paging_new6 a.numNext:hover {
    border-color: #2563eb;
}

/* ================================
   검색 영역 (설문지제목 입력 부분)
================================ */
table[width="100%"][cellpadding="0"][cellspacing="0"] tr[height="32"][align="center"][valign="bottom"] td {
    padding-top: 4px;
    padding-bottom: 4px;
}

/* 검색 인풋 */
input[name="stx"].ed {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 13px;
    min-width: 180px;
    background-color: #ffffff;
    background-image: none !important;
}

input[name="stx"].ed:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, .3);
}

/* 검색 버튼 이미지 대신 버튼처럼 보이게 */
input[type="image"][src*="btn_search.gif"] {
    margin-left: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #2563eb;
    background: #2563eb;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.35);
}

/* ================================
   하단 푸터 영역
================================ */
table[cellpadding="0"][cellspacing="1"][width="970"][bgcolor="#DBDBDB"] {
    width: 100% !important;
    margin-top: 16px;
    border-radius: 12px;
    overflow: hidden;
}

table[cellpadding="0"][cellspacing="1"][width="970"][bgcolor="#DBDBDB"] td[bgcolor="#FFFFFF"] {
    background: #f9fafb !important;
}

/* ================================
   반응형 대응 (모바일)
================================ */
@media (max-width: 768px) {
    body > center > div {
        margin: 8px;
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
    }

    /* 좌측 메뉴를 위로 보내는 효과는 HTML 변경 없이는 힘들고,
       대신 폭을 줄여서 부담 줄이기 */
    table[width="972"] > tbody > tr > td[width="190"] {
        width: 180px !important;
        font-size: 12px;
    }

    table[width="972"] > tbody > tr > td[width="782"] {
        padding: 12px;
    }

    form[name="fboardlist"] table[width="752"] {
        font-size: 12px;
    }

    input[name="stx"].ed {
        min-width: 140px;
    }
}
