/* ==========================================
   1. 전역 설정 및 초기화
   ========================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f9;
    color: #333;
    overflow: hidden; /* 브라우저 자체 스크롤 방지 */
}

/* ==========================================
   2. 메인 구조 (base.html 관련)
   ========================================== */

/* [NEW] 최상단 탭 + 로그인 버튼 통합 컨테이너 */
.top-nav-container {
    height: 42px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

/* 최상단 시트 선택 탭 */
.nav-tabs {
    border-bottom: none; /* 하단 라인 중복 제거 */
    height: 100%;
    display: flex;
    align-items: flex-end;
}

.nav-tabs .nav-link {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    color: #666;
}

.nav-tabs .nav-link.active {
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
    font-weight: bold;
    color: #333;
}

/* [NEW] 로그인/로그아웃 섹션 (작고 깔끔하게) */
.user-auth-section {
    display: flex;
    align-items: center;
}

.user-auth-section .btn {
    transition: all 0.2s ease;
    border-radius: 4px;
}

.user-auth-section .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 메인 레이아웃 높이 계산 */
.wrapper {
    display: flex;
    height: calc(100vh - 42px); 
    width: 100%;
}

/* 사이드바 */
#sidebar {
    width: 350px;
    min-width: 350px;
    background: #2c3e50;
    overflow-y: auto;
    color: #ecf0f1;
}

.parent-menu {
    padding: 10px 15px; /* 높이 약간 축소 */
    background: #34495e;
    border-bottom: 1px solid #2c3e50;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    list-style: none;
}

.parent-menu:hover {
    background: #3d566e;
}

.child-menu {
    padding: 8px 15px 8px 30px; /* 높이 약간 축소 */
    background: #1a252f;
    color: #bdc3c7;
    font-size: 0.8rem;
    border-bottom: 1px solid #2c3e50;
    display: block;
    text-decoration: none;
    transition: background 0.2s;
}

.child-menu:hover {
    background: #2980b9;
    color: white;
}

/* 메인 콘텐츠 영역 */
.main-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}

#contentFrame {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================
   3. 상세 페이지 스타일 (detail.html 관련)
   ========================================== */
.item-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 35px;
    border: none;
    overflow: hidden;
}

.item-card-header {
    background-color: #2c3e50;
    color: #ffffff;
    padding: 15px 25px; /* 헤더 여백 조정 */
    font-size: 1rem;
    font-weight: 700;
}

/* SaaS 배지 스타일 */
.badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
}

/* 점검 취지 섹션 */
.inspection-purpose-section {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-top: 5px solid #3498db;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.purpose-title {
    font-size: 1rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #f1f3f5;
    padding-bottom: 8px;
}

.purpose-content {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #444;
    white-space: pre-wrap;
    word-break: keep-all;
}

/* 입력 섹션 (관리자 전용) */
.input-section {
    border-top: 1px solid #eee;
    padding-top: 25px;
}

/* 눈에 띄지 않는 미니멀 로그인 버튼 */
.btn-login-minimal, .btn-logout-minimal {
    transition: color 0.2s ease;
    cursor: pointer;
    background: none;
    border: none;
}

.btn-login-minimal:hover {
    color: #6c757d !important; /* 호버 시에만 약간 더 진해짐 */
    text-decoration: underline !important;
}

.btn-logout-minimal:hover {
    color: #dc3545 !important; /* 로그아웃은 호버 시 살짝 붉게 */
}

/* 상단 바 높이 정렬 보정 */
.top-nav-container {
    background-color: #f8f9fa; /* 배경색을 아주 연한 회색으로 */
    border-bottom: 1px solid #e9ecef;
}

/* ==========================================
   4. 푸터 스타일 (공통)
   ========================================== */
.site-footer {
    padding: 20px 0;
    margin-top: 50px;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    color: #6c757d;
}

.footer-link {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.8rem;
    margin-right: 15px;
}

.footer-link:hover {
    color: #333;
    text-decoration: underline;
}

.copyright {
    font-size: 0.75rem;
    margin-top: 10px;
}

/* 사이드바 하단 고정 정보 */
.sidebar-footer {
    padding: 15px;
    border-top: 1px solid #3d566e;
    font-size: 0.7rem;
    color: #85929e;
}

.reply-section {
    border-left: 3px solid #dee2e6;
    padding-left: 15px;
}

.reply-item {
    border: 1px solid #e9ecef;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.accordion-button:not(.collapsed) {
    background-color: #f8f9fa;
    color: #3498db;
}