* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: sans-serif;
    display: flex;
    height: 100vh;
    background-color: #f4f4f4;
}

/* --- 사이드바 --- */
.sidebar {
    width: 250px;
    background-color: #fff;
    border-right: 1px solid #ddd;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
    position: absolute; /* ★ 버튼 위치의 기준점 */
    height: 100%;
}

/* 접혔을 때 스타일 */
.sidebar.collapsed {
    width: 80px;
}

.profile {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    height: 60px; /* 높이 고정 (레이아웃 깨짐 방지) */
}

.profile-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background-color: #ccc;
    border-radius: 50%;
    margin-right: 10px;
    transition: margin 0.3s;
}

.nickname {
    font-weight: bold;
    opacity: 1;
    transition: opacity 0.2s;
}

/* --- ★ 버튼 스타일 수정 (가장 중요) ★ --- */
.collapse-btn {
    position: absolute; /* 공중에 띄움 */
    top: 28px;          /* 위에서 28px 위치 */
    right: 20px;        /* 오른쪽에서 20px 위치 */
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #fff; /* 배경색 추가 (선명하게 보이게) */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;       /* ★ 다른 요소보다 무조건 위에 있게 설정 */
    transition: all 0.3s ease;
}

.collapse-btn:hover {
    background-color: #f0f0f0;
}

/* --- 접혔을 때 변화 --- */

/* 1. 닉네임 숨김 */
.sidebar.collapsed .nickname {
    opacity: 0;
    pointer-events: none; /* 클릭 방지 */
    display: none;
}

/* 2. 프로필 아이콘 중앙 정렬 */
.sidebar.collapsed .profile-icon {
    margin-right: 0;
    transform: translateX(0); /* 위치 보정 */
}

/* 3. 프로필 영역 자체를 중앙 정렬 */
.sidebar.collapsed .profile {
    justify-content: center;
}

/* 4. ★ 버튼 위치 이동 및 회전 */
.sidebar.collapsed .collapse-btn {
    top: 75px;        /* 프로필 사진 밑으로 이동 */
    right: 50%;       /* 오른쪽 기준 해제하고 중앙으로 */
    transform: translateX(50%) rotate(180deg); /* 중앙 정렬 + 회전 */
    background-color: #eee; /* 잘 보이게 색 변경 */
}

/* --- 메뉴 스타일 --- */
.menu { list-style: none; margin-top: 10px; padding: 0;} /* 버튼과 겹치지 않게 마진 추가 */

.menu-item { margin-bottom: 15px; }

.menu-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.2s;
    height: 44px;
    overflow: hidden;
}
.menu-link:hover, .menu-link.active { background-color: #e0e0e0; }

.menu-icon {
    min-width: 24px;
    font-size: 1.2rem;
    text-align: center;
    margin-right: 15px;
    transition: margin 0.3s;
}

/* 접혔을 때 메뉴 글자 숨김 */
.sidebar.collapsed .menu-link span {
    opacity: 0;
    display: none;
}

/* 접혔을 때 아이콘 중앙 정렬 */
.sidebar.collapsed .menu-link { justify-content: center; }
.sidebar.collapsed .menu-icon { margin-right: 0; }

main {
    margin-left: 250px;
    justify-content: center;
    display: flex;
    width: 100%;
}

@media (max-width: 768px) {

    .sidebar {
        display: none;
    }

    main {
        margin-left: 0;
        padding-top: 50px; /* 고정된 모바일 헤더 높이만큼 메인 콘텐츠를 아래로 밀어냄 (필수) */
    }

    .mobile-header-content {
        position: fixed; top: 0; left: 0; width: 100%; height: 50px; z-index: 1030;
    }
    .header {
        position: fixed;
        width: 100%;
    }
    #mobileToggleBtn {
        background-color: #495057;
        border-color: #495057;
        color: #ffffff !important;
    }
    .offcanvas-body .nav-link {
        font-size: 18px;
    }
}







.page-title { font-size: 1.5rem; margin-bottom: 20px; color: #555; }
.welcome-section { display: flex; align-items: center; margin-bottom: 40px; }
.welcome-icon { width: 60px; height: 60px; background-color: #ddd; border-radius: 10px; margin-right: 20px; display: flex; justify-content: center; align-items: center; font-weight: bold; color: #777; }
.welcome-message { font-size: 1.2rem; }
.section-title { font-size: 1.2rem; margin-bottom: 15px; }
.card-list { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 10px; }
.card-list::-webkit-scrollbar { height: 6px; }
.card-list::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 3px; }
.card { background-color: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 15px; min-width: 120px; text-align: center; }
.recent-card { height: 80px; display: flex; justify-content: center; align-items: center; }
.scenario-card { min-width: 200px; height: 120px; background-color: #eee; }
.more-btn { display: flex; justify-content: center; align-items: center; min-width: 40px; height: 80px; background-color: #f0f0f0; border-radius: 8px; cursor: pointer; }