/* 상단 컨트롤 영역 */
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.search-box {
    display: flex;
    gap: 8px;
}

.search-box select, .search-box input {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
}

.btn-search {
    padding: 10px 20px;
    background: #333;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-write {
    padding: 10px 25px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}
    
.grid-container {
    width: 100%;
    margin-top: 20px;
}

/* 그리드 디자인 */
.custom-grid {
    width: 100%;
    border-collapse: collapse;
    border-top: 2px solid #333;
}

.custom-grid th {
    background: var(--bg-light);
    padding: 15px;
    font-size: 0.95rem;
    color: #555;
    border-bottom: 1px solid var(--border-color);
}

.custom-grid td {
    padding: 18px 15px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    color: #444;
    font-size: 0.95rem;
    cursor: pointer;
}

.custom-grid td.title {
    text-align: left;
    cursor: pointer;
    font-weight: 500;
}

.custom-grid tr:hover {
    background-color: #fcfcfc;
}


.custom-grid tr.top-list {
    background-color: #f2f2f2;
}


.custom-grid tr.top-list:hover {
    background-color: #e9e9e9;
}

.custom-grid tr.top-list .title {
    font-weight: 700;
}

.no-data {
	text-align: center;
}








/*
모바일 화면
*/
@media (max-width: 768px) {
    /* 1. 상단 헤더 레이아웃 최적화 */
    .board-header {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 20px;
    }
    
    /* 검색 영역: Select + Input + SearchBtn */
    .search-box {
        display: flex;
        flex-wrap: wrap; /* 필요시 줄바꿈 허용 */
        gap: 5px;
        width: 100%;
    }
    
    /* Select 박스 UI 개선 */
    .search-box select {
        flex: 0 0 85px; /* 너비 고정 */
        padding: 8px 25px 8px 10px;
        font-size: 0.85rem;
        border: 1px solid #ddd;
        border-radius: 6px;
        background: #f9f9f9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C2.185 5.355 2.401 5 2.737 5h9.526c.336 0 .552.355.286.658L7.753 11.14a.65.65 0 0 1-1.006 0z'/%3E%3C/svg%3E") no-repeat right 8px center;
        appearance: none; /* 기본 화살표 숨김 */
        cursor: pointer;
    }
    
    .search-box input {
        flex: 1; /* 남은 공간 모두 차지 */
        min-width: 0;
        padding: 8px 12px;
        font-size: 0.85rem;
        border: 1px solid #ddd;
        border-radius: 6px;
    }
    
    /* 검색 버튼: input 바로 오른쪽 */
    .btn-search {
        flex: 0 0 auto;
        width: auto;
        padding: 8px 15px;
        font-size: 0.85rem;
        margin: 0;
    }

    /* 글쓰기 버튼: input 아래쪽 배치 */
    .board-header > button[onclick*="create"], 
    .btn-write {
        width: 100%; /* 가로 꽉 차게 */
        padding: 10px;
        font-size: 0.9rem;
        font-weight: 600;
        margin-top: 5px; /* 검색바와 약간의 간격 */
        background-color: #007bff;
        color: #fff;
        border-radius: 6px;
        border: none;
    }

    /* 2. 리스트 디자인 (X축 스크롤 방지 및 날짜 우측 하단) */
    .custom-grid thead { display: none; }
    .custom-grid, .custom-grid tbody, .custom-grid tr, .custom-grid td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .custom-grid tr {
        position: relative;
        padding: 15px 10px 35px 10px; /* 날짜가 들어갈 하단 여백 */
        border-bottom: 1px solid #eee;
    }

    /* 번호+제목+작성자 한 줄 흐름 */
    .custom-grid td:first-child,
    .custom-grid td.title,
    .custom-grid td:not(.title):not(:first-child):not(:last-child) {
        display: inline;
        width: auto;
        border: none;
        padding: 0;
        font-size: 0.9rem;
    }

    .custom-grid td:first-child { color: #007bff; font-weight: bold; margin-right: 5px; }
    .custom-grid td.title { color: #333; font-weight: 500; margin-right: 5px; }
    .custom-grid td:not(.title):not(:first-child):not(:last-child) { color: #999; font-size: 0.8rem; }
    .custom-grid td:not(.title):not(:first-child):not(:last-child)::before { content: " · "; }

    /* 일시: 우측 하단 고정 */
    .custom-grid td:last-child {
        position: absolute;
        right: 15px;
        bottom: 12px;
        width: auto;
        padding: 0;
        border: none;
        font-size: 0.75rem;
        color: #bbb;
    }
}