/* ====== 공통 헤더 ====== */
.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1e293b;
    padding: 5px 20px;
    color: #e5e7eb;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000; /* 헤더가 항상 위에 표시되도록 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    height: 50px; /* 헤더 높이 추가 */
}
/* 드롭다운 화살표를 우측 끝으로 정렬 */
.dropdown-arrow {
    margin-left: auto;
    display: inline-block; /* 필요한 경우 inline-block 추가 */
}

.toggle-sidebar {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ====== 사이드바 스타일 ====== */
.sidebar {
    position: fixed;
    top: 50px; /* 헤더 높이만큼 아래로 이동 */
    left: 0;
    width: 200px;
    height: calc(100% - 50px); /* 헤더 높이를 제외한 나머지 화면 */
    background: #1e293b;
    color: #e5e7eb;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.4);
    padding: 20px;
    z-index: 999; /* 헤더보다 낮게 설정 */
    transition: transform 0.3s ease, margin-left 0.3s ease;
}

/* PC에서 사이드바 숨김 상태 */
.sidebar-hidden .sidebar {
    transform: translateX(-240px); /* 사이드바를 화면 밖으로 숨김 */
}

/* ====== 메인 콘텐츠 ====== */
.main-content {
    margin-left: 200px;
    margin-top: 50px; /* 헤더 높이와 일치 */
    padding: 40px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* 사이드바 숨김 상태에서 메인 콘텐츠 확장 */
.sidebar-hidden .main-content {
    margin-left: 0;
}

/* ===== 대메뉴 스타일 ====== */
.sidebar .nav-link {
    display: flex;
    align-items: center;
    color: #ffffff;
    transition: color 0.3s ease, background 0.3s ease;
    font-size: 1rem;
    font-weight: bold;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: linear-gradient(145deg, #1c2736, #212f40);
    box-shadow: 5px 5px 10px #1a202c, -5px -5px 10px #263042;
}

    /* 호버 상태 */
    .sidebar .nav-link:hover {
        background: #2563eb;
        color: #ffffff;
        box-shadow: 0 0 10px rgba(37, 99, 235, 0.6);
    }

    /* 활성화 상태 */
    .sidebar .nav-link.active {
        color: #ffffff;
        background: linear-gradient(145deg, #2563eb, #1e90ff);
        box-shadow: 0 0 15px rgba(30, 144, 255, 0.8);
    }

    /* 비활성화 상태 */
    .sidebar .nav-link.inactive {
        color: #9ca3af;
        background: #1e293b;
        box-shadow: none;
    }

/* ===== 드롭다운 스타일 ====== */
.sidebar .collapse {
    background: #1e293b;
    padding-left: 15px;
    border-left: 2px solid #374151;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    overflow: hidden;
}

.collapse.show {
    max-height: 500px;
    opacity: 1;
}

.collapse:not(.show) {
    max-height: 0;
    opacity: 0;
}

/* ===== 드롭다운 내부 항목 ===== */
.sidebar .collapse .nav-link {
    font-size: 0.9rem;
    color: bisque; /* 기본 텍스트 색상 */
    margin-bottom: 5px;
    border-radius: 4px; /* 서브메뉴 항목 모서리 둥글게 */
    padding: 8px 12px; /* 서브메뉴 간격 */
    transition: background 0.3s ease, color 0.3s ease; /* 호버 효과 부드럽게 */
}

    /* ===== 서브메뉴 호버 상태 ===== */
    .sidebar .collapse .nav-link:hover {
        background: #aed2f6a6; /* 호버 시 배경색 */
        color: #ffffff; /* 호버 시 텍스트 색상 */
        box-shadow: 0 0 5px rgba(37, 99, 235, 0.5); /* 부드러운 그림자 */
    }

/* ===== 반응형 ===== */
@media (max-width: 768px) {
    .sidebar {
        top: 50px; /* 헤더 아래로 이동 */
        height: calc(100% - 50px); /* 헤더 높이 제외 */
        transform: translateX(-240px); /* 숨김 상태 */
    }

    .sidebar-open .sidebar {
        transform: translateX(0); /* 열림 상태 */
    }

    .main-content {
        margin-left: 0;
        margin-top: 50px; /* 헤더 높이 */
    }
}

/* ===== 자동 다크 모드 ===== */
@media (prefers-color-scheme: dark) {
    body {
        background: #0f172a;
        color: #e5e7eb;
    }

    .mobile-header {
        background: #0e1c2b;
        color: #e5e7eb;
        border-bottom: 1px solid #2b3646;
    }

    .sidebar {
        background: #0e1c2b;
        color: #9ca3af;
    }

        .sidebar .nav-link {
            background: linear-gradient(145deg, #0d1a28, #192a3b);
            color: #9ca3af;
        }

            .sidebar .nav-link:hover {
                background: #2563eb;
                color: #ffffff;
                box-shadow: 0 0 8px rgba(37, 99, 235, 0.6);
            }

            .sidebar .nav-link.active {
                background: linear-gradient(145deg, #2563eb, #1e90ff);
                box-shadow: 0 0 15px rgba(30, 144, 255, 0.8);
                color: #ffffff;
            }

    .main-content {
        background: #162132;
        color: #d1d5db;
    }
}
.sidebar-header {
    text-align: center; /* 텍스트를 가운데 정렬 */
    font-weight: bold; /* 굵은 글씨 */
    color: #ffffff; /* 텍스트 색상 */
    margin-bottom: 15px; /* 아래 여백 추가 */
}
.brand-title {
    text-align: center; /* 텍스트를 가운데 정렬 */
    font-weight: bold; /* 굵은 글씨 */
    color: #ffffff; /* 텍스트 색상 */
    font-size: 21px;
    margin: 0; /* 불필요한 여백 제거 */
    height: 100%; /* 부모 요소의 높이 채우기 */
    display: flex; /* Flexbox 활성화 */
    align-items: center; /* 수직 가운데 정렬 */
    justify-content: center; /* 수평 가운데 정렬 */
}
/* Layout.css 맨 아래 추가 */
.mobile-header .user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    font-size: 0.95em;
}

.mobile-header .logout-btn {
    color: #fff;
    background: #ff4d4f;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85em;
    transition: 0.2s;
}

    .mobile-header .logout-btn:hover {
        background: #e60000;
    }


    /*경로 -> ->*/
.breadcrumb {
    margin-bottom: 0.5rem;
}

    .breadcrumb a {
        color: #6c757d;
        text-decoration: none !important; /* 🔥 밑줄 제거 확정 */
    }

        .breadcrumb a:hover {
            color: #343a40;
            text-decoration: underline;
        }

    .breadcrumb .active {
        color: #212529;
        font-weight: 600;
    }

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
}