@charset "UTF-8";

:root {
    --sb-bg: #07090e;
    --sb-surface: #0e121b;
    --sb-card: rgba(18, 24, 38, 0.7);
    --sb-border: rgba(255, 255, 255, 0.08);
    --sb-primary: #6366f1;
    --sb-primary-glow: rgba(99, 102, 241, 0.25);
    --sb-accent: #38bdf8;
    --sb-emerald: #10b981;
    --sb-text: #f8fafc;
    --sb-muted: #94a3b8;
}

/* ========================================================
   1. 최상위 캔버스 & 전역 레이아웃 (Sticky Footer 보장)
   ======================================================== */
html {
    height: 100%;
}

body {
    width: 100%;
    min-height: 100vh; /* 뷰포트 전체 높이를 확보하여 푸터 붕뜸 방지 */
    background-color: #0f172a !important;
    color: #f8fafc;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    font-family: 'Plus Jakarta Sans', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 본문 동적 래퍼: 남은 높이를 채워 푸터를 항상 바닥으로 밀어냄 */
.main-body-wrapper {
    flex: 1 0 auto;
    width: 100%;
    background-color: #0f172a;
    display: flex;
    flex-direction: column;
}

.sb-workspace-wrapper {
    flex: 1; /* 마이페이지/대시보드 내부 영역도 세로 확장 */
}

/* SweetAlert2 팝업 시 배경 스크롤/푸터 밀림 버그 방어 */
html.swal2-height-auto,
body.swal2-height-auto {
    height: 100% !important;
    min-height: 100vh !important;
}

/* 공통 푸터: 상단 마진을 auto로 주어 데이터가 적어도 최하단 밀착 */
.sb-footer {
    margin-top: auto;
    background-color: #090d16;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 40px 0 30px;
    color: #64748b;
    font-size: 0.875rem;
}
/* ========================================================
   2. 공통 헤더 프레임 (GNB)
   ======================================================== */
.sb-unified-header {
    height: 70px;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    
    /* 딥 다크 반투명 + 백드롭 블러 */
    background: rgba(10, 15, 26, 0.85) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    
    /* 하단 미세 구분선 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.sb-brand-logo-img {
    height: 26px;
    width: auto;
    display: block;
    margin-right: 8px;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

.sb-brand-logo-txt {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.03em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

/* 상단 데스크톱 네비게이션 메뉴 */
.sb-unified-header .top-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sb-unified-header .top-nav li {
    position: relative;
}

.sb-unified-header .top-nav li a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}

.sb-unified-header .top-nav li a:hover,
.sb-unified-header .top-nav li.active > a {
    color: #ffffff;
}

.sb-unified-header .top-nav li a i.bi {
    color: #64748b;
    font-size: 15px;
    transition: color 0.2s ease;
}

.sb-unified-header .top-nav li a:hover i.bi,
.sb-unified-header .top-nav li.active > a i.bi {
    color: #38bdf8;
}

/* 서브 드롭다운 메뉴 */
.sb-unified-header .top-nav .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    padding: 6px 0;
    min-width: 170px;
    z-index: 1050;
}

.sb-unified-header .top-nav li:hover > .dropdown-menu {
    display: block;
}

.sb-unified-header .top-nav .dropdown-item {
    padding: 8px 16px;
    color: #94a3b8;
    font-size: 13px;
    display: block;
    text-decoration: none;
    background: transparent;
    transition: all 0.15s ease;
}

.sb-unified-header .top-nav .dropdown-item:hover,
.sb-unified-header .top-nav .dropdown-item.sub-active {
    background: rgba(255, 255, 255, 0.05);
    color: #38bdf8;
}

/* ========================================================
   3. 우측 사용자 프로필 / 액션 버튼
   ======================================================== */
.sb-user-profile-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    cursor: pointer;
    line-height: 1;
    margin-right: 4px;
}

.sb-user-profile-wrap i {
    font-size: 15px;
    color: #60a5fa;
}

.sb-user-profile-wrap .sb-user-name {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    border-bottom: 1px dashed rgba(248, 250, 252, 0.4);
}

.btn-sb-admin {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-right: 6px;
}

.btn-sb-admin:hover {
    background: rgba(245, 158, 11, 0.25);
    color: #ffffff;
    border-color: #f59e0b;
}

.btn-sb-logout {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    text-decoration: none;
}

.btn-sb-logout i {
    color: #f87171;
    font-size: 13px;
}

.btn-sb-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ffffff;
    border-color: rgba(239, 68, 68, 0.5);
}

/* ========================================================
   4. 반응형 모바일 햄버거 & 드로어 (Drawer)
   ======================================================== */
.sb-mobile-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 20px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.sb-mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #38bdf8;
}

.sb-mobile-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sb-mobile-backdrop.show {
    display: block;
    opacity: 1;
}

.sb-mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 290px;
    max-width: 85vw;
    height: 100vh;
    background: #0f172a;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.sb-mobile-drawer.show {
    transform: translateX(0);
}

.sb-mobile-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 20px;
}

.sb-mobile-drawer-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 22px;
    cursor: pointer;
}

.sb-mobile-drawer-close:hover {
    color: #ffffff;
}

.sb-mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sb-mobile-nav-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
}

.sb-mobile-nav-list li a:hover,
.sb-mobile-nav-list li.active > a {
    background: rgba(255, 255, 255, 0.05);
    color: #38bdf8;
}

.sb-mobile-sub-menu {
    list-style: none;
    margin: 4px 0 8px 18px;
    padding: 0 0 0 10px;
    border-left: 2px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sb-mobile-sub-menu a {
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    padding: 6px 10px;
}

/* ========================================================
   5. 모바일 브레이크포인트 (991px 이하 반응형 분기)
   ======================================================== */
@media (max-width: 991px) {
    .sb-unified-header .top-nav {
        display: none !important;
    }
    .sb-unified-header .btn-sb-admin,
    .sb-unified-header .sb-user-profile-wrap,
    .sb-unified-header .btn-sb-logout {
        display: none !important;
    }
    .sb-mobile-toggle {
        display: inline-flex !important;
    }
    .sb-brand-logo-img {
        height: 22px;
    }
    .sb-brand-logo-txt {
        font-size: 16px;
    }
}

/* ========================================================
   6. 전역 모달 (로그인 모달)
   ======================================================== */
#loginModal:not(.show) {
    display: none !important;
}

#loginModal .modal-content {
    background: #0f1523;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

#loginModal .form-control-dark {
    background: #182032 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    padding: 12px 16px;
    border-radius: 12px;
}

#loginModal .form-control-dark:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
}

#loginModal input[type="password"]::-ms-reveal,
#loginModal input[type="password"]::-ms-clear {
    display: none !important;
}

/* ==========================================================================
   헤더 GNB 중앙 네비게이션 & 드롭다운 스타일
   ========================================================================== */
.sb-unified-header {
    height: 70px;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-nav {
    display: flex;
    align-items: center;
}

.top-nav-list {
    display: flex;
    list-style: none;
    gap: 16px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.top-nav-list li {
    position: relative;
}

.top-nav-list li a {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.top-nav-list li a:hover,
.top-nav-list li.active > a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.top-nav-list li.active > a {
    color: #a5b4fc;
}

/* 드롭다운 서브메뉴 */
.top-nav-list li.has-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 190px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6);
    padding: 8px;
    margin-top: 4px;
    z-index: 1050;
}

.top-nav-list li.has-dropdown:hover .dropdown-menu {
    display: block;
}

.top-nav-list .dropdown-item {
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 9px 14px;
    border-radius: 8px;
    text-decoration: none;
    display: block;
    transition: all 0.15s ease;
}

.top-nav-list .dropdown-item:hover,
.top-nav-list .dropdown-item.sub-active {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.18);
}

/* 우측 프로필 및 버튼 */
.sb-user-profile-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    color: #f8fafc;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.sb-user-profile-wrap:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.btn-sb-logout {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-sb-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.btn-sb-admin {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}