/* 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 모바일 환경 뷰포트 높이 대응 */
:root {
    /* 동적 뷰포트 높이 변수 */
    --vh: 1vh;
    --dynamic-vh: calc(var(--vh, 1vh) * 100);
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
    
    /* 실제 사용 가능한 뷰포트 높이 */
    --available-height: calc(var(--dynamic-vh) - var(--safe-area-inset-top) - var(--safe-area-inset-bottom));
}

/* 페이지 로딩 중 브레드크럼 및 제목 숨김 */
.breadcrumb[style*="visibility: hidden"],
.page-title[style*="visibility: hidden"] {
    opacity: 0;
    visibility: hidden !important;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

/* 페이지 로딩 완료 후 표시 */
.breadcrumb[style*="visibility: visible"],
.page-title[style*="visibility: visible"] {
    opacity: 1;
    visibility: visible !important;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

html {
    max-width: 100vw;
    height: 100%;
}

:root {
    /* 모던한 파란색 계열 색상 팔레트 */
    --primary-color: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-medium: #3b82f6;
    --primary-light: #60a5fa;
    --accent-color: #2563eb;
    --accent-light: #3b82f6;
    --accent-dark: #1d4ed8;
    --secondary-color: #64748b;
    --background-color: #f1f5f9;
    --surface-color: #ffffff;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --success-color: #059669;
    --success-dark: #047857;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: #0ea5e9;
    
    /* 그림자 */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    
    /* 그라디언트 */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-medium) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-light) 100%);
    --gradient-surface: linear-gradient(145deg, var(--surface-color) 0%, var(--gray-50) 100%);
    
    /* 테두리 반지름 */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gradient-surface);
    color: var(--gray-800);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    max-width: 100vw;
    min-height: var(--available-height);
}

/* 앱 컨테이너 */
.app-container {
    min-height: var(--available-height);
    background: var(--background-color);
    max-width: 100vw;
    overflow: visible;
    position: relative;
}

/* 사이드바 */
.sidebar {
    width: 230px;
    background: #ffffff;
    color: var(--gray-800);
    position: fixed;
    height: var(--available-height);
    max-height: var(--available-height);
    left: 0;
    top: 0;
    z-index: 1002;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.08),
        0 10px 20px rgba(0, 0, 0, 0.04),
        inset -1px 0 0 rgba(59, 130, 246, 0.08);
    border-right: 1px solid rgba(59, 130, 246, 0.12);
    padding: 0;
    margin: 0;
    overflow: visible;
    /* 플렉스 레이아웃으로 내부 요소 배치 최적화 */
    display: flex;
    flex-direction: column;
}

/* 페이지 로드 완료 후에만 transition 적용 */
body.loaded .sidebar {
    transition: width 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 초기 상태에서 접힌 사이드바 */
.sidebar-collapsed-initial .sidebar {
    width: 70px;
}

.sidebar-collapsed-initial .main-content {
    margin-left: 70px;
}

.sidebar-collapsed-initial .sidebar-logo span {
    opacity: 0;
    transform: translateX(-15px) scale(0.9);
    pointer-events: none;
    position: absolute;
    width: 0;
    overflow: hidden;
    transition: none;
}

.sidebar-collapsed-initial .nav-link span {
    opacity: 0;
    transform: translateX(-8px);
    pointer-events: none;
    position: absolute;
    white-space: nowrap;
    transition: none;
}

.sidebar-collapsed-initial .submenu-arrow {
    display: none !important;
}

.sidebar-collapsed-initial .submenu {
    display: none;
}

.sidebar-collapsed-initial .nav-link {
    justify-content: center;
    padding: 0.875rem 0.5rem;
}

.sidebar-collapsed-initial .nav-link i {
    margin-right: 0;
    font-size: 1.25rem;
}

.sidebar-collapsed-initial .sidebar-header {
    padding: 0.75rem 0.5rem;
    justify-content: center;
}

.sidebar-collapsed-initial .sidebar-logo .logo-icon {
    width: 2.5rem;
    height: 2.5rem;
}

.sidebar-collapsed-initial .sidebar-toggle-main i {
    transform: rotate(180deg);
}

.sidebar-collapsed-initial .nav-list {
    padding: 0 1rem;
}

.sidebar-collapsed-initial .sidebar-nav {
    scrollbar-width: none; /* Firefox 호환성 */
    -ms-overflow-style: none; /* IE/Edge 호환성 */
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-collapsed-initial .sidebar-nav::-webkit-scrollbar {
    display: none;
    width: 0px;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
}

.sidebar-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 0 0 1.5rem 0;
    box-shadow: 
        0 6px 20px rgba(59, 130, 246, 0.06),
        0 2px 8px rgba(0, 0, 0, 0.03);
    margin-bottom: 0.5rem;
    height: 90px;
    /* 플렉스 레이아웃에서 고정 높이 유지 */
    flex-shrink: 0;
}



.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--gray-800);
    text-decoration: none;
    font-weight: 900;
    font-size: 1.75rem;
    letter-spacing: -0.02em;
    font-family: 'Noto Sans KR', sans-serif;
    height: auto;
    min-height: 2.5rem;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}



.sidebar-logo .logo-icon {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    object-fit: contain;
    opacity: 1;
    background: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}



.sidebar-logo span {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-medium) 50%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(30, 64, 175, 0.1);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05));
    display: inline-block;
    vertical-align: middle;
    line-height: 1.3;
    font-weight: 900;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    text-align: center;
    white-space: nowrap;
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* 페이지 로드 완료 후에만 transition 적용 */
body.loaded .sidebar-logo span {
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}





/* 메인 사이드바 토글 버튼 (중앙 오른쪽) */
.sidebar-toggle-main {
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 60px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(248, 250, 252, 0.9) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 0 15px 15px 0;
    color: var(--primary-color);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    box-shadow: 
        2px 0 20px rgba(59, 130, 246, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.05);
    z-index: 1003;
}

.sidebar-toggle-main:hover {
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.08) 0%, 
        rgba(59, 130, 246, 0.05) 100%);
    color: var(--primary-color);
    transform: translateY(-50%);
    box-shadow: 
        2px 0 16px rgba(59, 130, 246, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.05);
}

.sidebar-toggle-main i {
    transition: transform 0.3s ease;
}

/* 사이드바가 닫혔을 때 */
.sidebar.collapsed {
    width: 70px;
    overflow: visible;
}

.sidebar.collapsed .sidebar-header {
    padding: 0.75rem 0.5rem;
    justify-content: center;
    height: 86.778px;
}

.sidebar.collapsed .sidebar-logo span {
    opacity: 0;
    transform: translateX(-15px) scale(0.9);
    transition: none;
    pointer-events: none;
    position: absolute;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-logo .logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .nav-link span {
    opacity: 0;
    transform: translateX(-8px);
    transition: none;
    pointer-events: none;
    position: absolute;
    white-space: nowrap;
}

.sidebar.collapsed .submenu-arrow {
    display: none !important;
}

.sidebar.collapsed .submenu {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.875rem 0.5rem;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
    font-size: 1.25rem;
}

/* 접힌 상태에서 효과 제거 */
.sidebar.collapsed .nav-link::before {
    display: none;
}

.sidebar.collapsed .nav-link:hover::before {
    display: none;
}

.sidebar.collapsed .nav-link.active::before {
    display: none;
}

/* sidebar-nav는 유지하되 스크롤바만 숨김 */
.sidebar.collapsed .sidebar-nav::-webkit-scrollbar {
    display: none;
    width: 0px;
}

.sidebar.collapsed .sidebar-nav {
    scrollbar-width: none; /* Firefox 호환성 */
    -ms-overflow-style: none; /* IE/Edge 호환성 */
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.collapsed .sidebar-toggle-main:hover {
    transform: translateY(-50%);
}



.sidebar.collapsed .sidebar-toggle-main {
    right: -15px;
}

.sidebar.collapsed .sidebar-toggle-main i {
    transform: rotate(180deg);
}

.sidebar.collapsed .nav-list {
    padding: 0 1rem;
}

/* 메인 컨텐츠 조정 */
.main-content.expanded {
    margin-left: 70px;
}

/* 사이드바 네비게이션 */
.sidebar-nav {
    padding: 0.5rem 0 1.25rem;
    height: calc(var(--available-height) - 100px);
    max-height: calc(var(--available-height) - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 1;
    /* 모바일에서 스크롤 영역 보장 */
    min-height: 0;
    flex-shrink: 1;
}

.nav-list {
    list-style: none;
    padding: 0 1rem;
}

.nav-item {
    margin-bottom: 0.375rem;
}

.nav-divider {
    height: 1px;
    background: rgba(59, 130, 246, 0.2);
    margin: 0.75rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.125rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: var(--radius-lg);
    font-weight: 500;
    backdrop-filter: none;
    border: 1px solid transparent;
    margin: 0.25rem 0;
    background: transparent;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-color);
    border-radius: 0 2px 2px 0;
    transition: height 0.25s ease;
}

.nav-link:hover {
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.06) 0%, 
        rgba(59, 130, 246, 0.04) 100%);
    color: var(--primary-color);
    box-shadow: 
        0 3px 12px rgba(59, 130, 246, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.04);
    border-color: rgba(59, 130, 246, 0.12);
}

.nav-link:hover::before {
    height: 20px;
}

.nav-link.active {
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.1) 0%, 
        rgba(59, 130, 246, 0.06) 100%);
    color: var(--primary-color);
    box-shadow: 
        0 4px 16px rgba(59, 130, 246, 0.12),
        0 2px 6px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    font-weight: 600;
}

.nav-link.active::before {
    height: 24px;
    background: var(--primary-color);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.nav-link i {
    width: 1.5rem;
    text-align: center;
    font-size: 1.25rem;
    filter: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    color: var(--gray-600);
}

.nav-link:hover i {
    transform: scale(1);
    filter: none;
    opacity: 1;
    color: var(--primary-color);
}

.nav-link.active i {
    transform: scale(1);
    filter: none;
    opacity: 1;
    color: var(--primary-color);
}

.nav-link span {
    font-weight: 500;
    letter-spacing: -0.01em;
    opacity: 1;
    transform: translateX(0);
    white-space: nowrap;
}

/* 페이지 로드 완료 후에만 transition 적용 */
body.loaded .nav-link span {
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1) 0.08s,
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) 0.08s;
}

/* 서브메뉴 */
.has-submenu .submenu-arrow {
    margin-left: auto;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    opacity: 0.6;
    transform: scale(1);
    color: var(--gray-400);
}

.has-submenu.open .submenu-arrow {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--primary-color);
}

.has-submenu .nav-link:hover .submenu-arrow {
    color: var(--primary-color);
    opacity: 1;
}

.submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.03) 0%, 
        rgba(59, 130, 246, 0.015) 100%);
    margin: 0;
    border-radius: var(--radius-lg);
    backdrop-filter: none;
    border: none;
    opacity: 0;
}

.has-submenu.open .submenu {
    max-height: 500px;
    padding: 0.625rem 0;
    margin: 0.375rem 0;
    border: 1px solid rgba(59, 130, 246, 0.08);
    opacity: 1;
}

.submenu-link {
    display: block;
    padding: 0.625rem 0.5rem 0.625rem 3rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.825rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    margin: 0.125rem 0.5rem;
    position: relative;
    border: 1px solid transparent;
    background: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.submenu-link:hover {
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.05) 0%, 
        rgba(59, 130, 246, 0.03) 100%);
    color: var(--primary-color);
    box-shadow: 
        0 1px 4px rgba(59, 130, 246, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.04);
    border-color: rgba(59, 130, 246, 0.1);
}

.submenu-link::before {
    content: '';
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--gray-500);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.submenu-link:hover::before {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1);
    box-shadow: 0 0 4px rgba(59, 130, 246, 0.2);
}

.submenu-link.active {
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.08) 0%, 
        rgba(59, 130, 246, 0.05) 100%);
    color: var(--primary-color);
    box-shadow: 
        0 2px 8px rgba(59, 130, 246, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.06);
    border-color: rgba(59, 130, 246, 0.12);
    font-weight: 600;
}

.submenu-link.active::before {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.3);
}

/* 메인 컨텐츠 */
.main-content {
    margin-left: 230px;
    display: flex;
    flex-direction: column;
    background: var(--background-color);
    min-height: var(--available-height);
}

/* 페이지 로드 완료 후에만 transition 적용 */
body.loaded .main-content {
    transition: margin-left 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 헤더 */
.header {
    background: rgba(255, 255, 255, 1);
    padding: 0.75rem 2rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1200;
    backdrop-filter: blur(40px) saturate(180%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 60px;
}

.header.scrolled {
    background: rgba(255, 255, 255, 1);
    backdrop-filter: blur(50px) saturate(200%);
    border-bottom-color: rgba(59, 130, 246, 0.2);
}



.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.header-left .page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, 
        var(--primary-color) 0%, 
        var(--primary-medium) 40%, 
        var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(30, 64, 175, 0.1);
    transition: all 0.3s ease;
    position: relative;
}



.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-500);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.breadcrumb-separator {
    color: var(--gray-400);
    font-size: 0.75rem;
}

.header-right {
    display: flex;
    align-items: center;
    position: relative;
}

/* 사용자 메뉴 */
.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
    color: var(--gray-700);
    font-weight: 600;
    position: relative;
}



.user-btn:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary-color);
}



.user-btn:active {
    transform: translateY(0);
}

.user-btn .fa-chevron-down {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    color: var(--gray-500);
}

.user-menu.open .user-btn .fa-chevron-down {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.user-btn:hover .fa-chevron-down {
    color: var(--primary-color);
}

.user-avatar {
    width: 1.75rem;
    height: 1.75rem;
    background: linear-gradient(135deg, 
        var(--accent-color) 0%, 
        var(--accent-light) 50%, 
        var(--primary-medium) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 0.875rem;
}



.user-name {
    font-weight: 600;
    letter-spacing: -0.01em;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 8px 10px -6px rgba(0, 0, 0, 0.1),
        -5px 0 15px -5px rgba(0, 0, 0, 0.12),
        5px 0 15px -5px rgba(0, 0, 0, 0.05);
    width: 270px;
    min-width: 240px;
    max-width: 90vw;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    padding: 12px;
}

.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 유저 프로필 정보 섹션 */
.user-profile-section {
    padding: 12px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.12);
    background: #ffffff;
    position: relative;
    overflow: hidden;
}



.user-profile-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-profile-avatar {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, 
        var(--primary-color) 0%, 
        var(--primary-medium) 50%,
        var(--accent-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.125rem;
    flex-shrink: 0;
}



.user-profile-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-profile-name-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.125rem;
    flex-wrap: wrap;
}

.user-profile-name {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.plan-badge {
    background: linear-gradient(135deg, 
        var(--primary-color) 0%, 
        var(--primary-medium) 100%);
    color: var(--white);
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-xl);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}



.user-profile-remaining {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--gray-600);
    font-size: 0.6875rem;
    font-weight: 500;
    margin-top: 0.0625rem;
}



.user-profile-remaining i {
    color: var(--primary-color);
    font-size: 0.75rem;
    filter: drop-shadow(0 1px 2px rgba(30, 64, 175, 0.2));
}

.user-profile-remaining strong {
    color: var(--primary-color);
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(30, 64, 175, 0.1);
}

/* API 사용량 섹션 */
.api-usage-section {
    padding: 12px;
    border: 1px solid rgba(59, 130, 246, 0.12);
    border-radius: var(--radius-md);
    background: rgba(59, 130, 246, 0.03);
    position: relative;
    margin-top: 12px;
}



.api-usage-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1rem;
    color: var(--gray-800);
    font-weight: 700;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
}

.api-usage-header i {
    color: var(--primary-color);
    font-size: 1rem;
    padding: 0.375rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.15);
}





.usage-count {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    font-weight: 700;
    flex-shrink: 0;
    justify-content: flex-start;
    min-width: fit-content;
    margin-bottom: 0.75rem;
}

.usage-current {
    color: var(--primary-color);
    font-size: 1.125rem;
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(30, 64, 175, 0.1);
    background: linear-gradient(135deg, 
        var(--primary-color) 0%, 
        var(--primary-medium) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.usage-separator {
    color: var(--gray-400);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0.125rem;
}

.usage-total {
    color: var(--gray-600);
    font-size: 1rem;
    font-weight: 700;
}

.usage-progress {
    margin-bottom: 1rem;
    position: relative;
}

.usage-progress-bar {
    width: 100%;
    height: 8px;
    background: linear-gradient(135deg, 
        var(--gray-200) 0%, 
        var(--gray-300) 100%);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.usage-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, 
        var(--primary-color) 0%, 
        var(--primary-medium) 50%,
        var(--accent-color) 100%);
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 
        0 2px 4px rgba(30, 64, 175, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}







/* 드롭다운 메뉴 섹션 */
.dropdown-menu-section {
    padding: 12px 0 0 0;
    background: #ffffff;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.25rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 0.875rem;
    position: relative;
    border-radius: var(--radius-md);
    letter-spacing: -0.01em;
}



.dropdown-item:hover {
    background: rgba(59, 130, 246, 0.06);
    color: var(--primary-color);
}



.dropdown-item i {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-500);
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.dropdown-item:hover i {
    color: var(--primary-color);
}

.logout-item {
    color: var(--danger-color);
}



.logout-item:hover {
    background: rgba(220, 38, 38, 0.06);
    color: var(--danger-color);
}

.logout-item i {
    color: var(--danger-color);
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-item:hover i {
    color: var(--danger-color);
}

.dropdown-divider {
    height: 1px;
    background: rgba(59, 130, 246, 0.12);
    margin: 12px 0;
}

/* 페이지 컨텐츠 */
.page-content {
    flex: 1;
    padding: 1.25rem;
    background: var(--background-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 푸터 */
.footer {
    background: #ffffff;
    border-top: 1px solid rgba(59, 130, 246, 0.12);
    padding: 1.5rem 2rem 1rem;
    margin-top: auto;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    text-align: center;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.footer-link {
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.footer-link:hover {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
}

.footer-separator {
    color: var(--gray-400);
    font-size: 0.875rem;
    margin: 0 0.25rem;
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    color: var(--gray-600);
    font-size: 0.8125rem;
    line-height: 1.4;
}

.footer-company,
.footer-details,
.footer-address,
.footer-copyright {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    justify-content: center;
}

.footer-copyright {
    color: var(--gray-500);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.content-wrapper {
    width: 100%;
    margin: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .header {
        z-index: 999;
    }
    
    .sidebar {
        transform: translateX(-100%);
        will-change: transform;
        -webkit-transform: translateX(-100%);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        /* 모바일에서 추가 안전 장치 */
        height: var(--available-height);
        max-height: var(--available-height);
    }
    
    /* 페이지 로드 완료 후에만 transition 적용 (모바일) */
    body.loaded .sidebar {
        transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .sidebar.open {
        transform: translateX(0);
        -webkit-transform: translateX(0);
    }
    
    /* 모바일 사이드바 배경 오버레이 */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.75);
        z-index: 1001;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    visibility 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    .sidebar.collapsed {
        width: 70px;
        transform: translateX(0);
        height: var(--available-height);
        max-height: var(--available-height);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle-main {
        display: none;
    }

    .header {
        padding: 0.625rem 1.25rem;
        min-height: 55px;
    }
    
    .header-left .page-title {
        font-size: 1.5rem;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
    }

    .page-content {
        padding: 1rem;
    }

    /* 푸터 태블릿 스타일 - 데스크톱과 동일한 줄 설정 유지 */
    .footer {
        padding: 1.25rem 1.5rem 0.875rem;
    }

    .footer-links {
        gap: 0.375rem;
    }

    .footer-link {
        font-size: 0.8125rem;
        padding: 0.1875rem 0.375rem;
    }

    .footer-separator {
        font-size: 0.8125rem;
        margin: 0 0.1875rem;
    }

    .footer-info {
        font-size: 0.75rem;
        gap: 0.3125rem;
    }

    .footer-company,
    .footer-details,
    .footer-address {
        gap: 0.375rem;
    }

    .footer-copyright {
        font-size: 0.6875rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
    }
    
    .header {
        padding: 0.5rem 1rem;
        min-height: 50px;
    }
    
    .header-left .page-title {
        font-size: 1.375rem;
    }
    
    .breadcrumb {
        font-size: 0.75rem;
        gap: 0.375rem;
    }
    
    .user-name {
        display: none;
    }
    
    .user-btn {
        padding: 0.5rem 0.625rem;
        gap: 0.375rem;
        font-size: 0.875rem;
        height: 44px;
    }
    
    .user-btn .fa-chevron-down {
        font-size: 0.75rem;
    }
    
    .user-avatar {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.75rem;
    }

    /* 모바일에서 드롭다운 크기 조정 */
    .user-dropdown {
        width: 250px;
        min-width: 220px;
        max-width: 90vw;
        padding: 8px;
    }
    
    .user-profile-section {
        padding: 8px;
    }
    
    .user-profile-info {
        gap: 0.625rem;
    }
    
    .user-profile-details {
        gap: 0.1875rem;
    }
    
    .user-profile-avatar {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.9375rem;
    }
    
    .user-profile-name-row {
        gap: 0.3125rem;
        margin-bottom: 0.09375rem;
    }
    
    .user-profile-name {
        font-size: 1.0625rem;
    }
    
    .plan-badge {
        font-size: 0.5625rem;
        padding: 0.1875rem 0.5rem;
    }
    
    .user-profile-remaining {
        font-size: 0.6875rem;
        margin-top: 0.0625rem;
    }
    
    .api-usage-section {
        padding: 12px;
        margin-top: 8px;
    }
    
    .usage-current {
        font-size: 1rem;
    }
    
    .usage-separator {
        font-size: 0.875rem;
    }
    
    .usage-total {
        font-size: 0.875rem;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 0.8125rem;
        gap: 0.75rem;
    }
    
    .dropdown-item i {
        width: 1.375rem;
        height: 1.375rem;
        font-size: 0.8125rem;
    }
    
    .user-profile-remaining i {
        font-size: 0.6875rem;
    }
    
    .user-profile-remaining strong {
        font-weight: 700;
    }
    
    .api-usage-header {
        font-size: 0.875rem;
        margin-bottom: 0.875rem;
        gap: 0.5rem;
    }
    
    .api-usage-header i {
        font-size: 0.875rem;
        padding: 0.3125rem;
    }
    
    .usage-count {
        margin-bottom: 0.625rem;
        gap: 0.1875rem;
    }
    
    .usage-progress {
        margin-bottom: 0.875rem;
    }
    
    .usage-progress-bar {
        height: 6px;
    }
    
    .dropdown-menu-section {
        padding: 8px 0 0 0;
    }
    
    .dropdown-divider {
        margin: 8px 0;
    }

    .sidebar-header {
        padding: 0.75rem 1rem;
        justify-content: center;
        height: 86.778px;
    }

    .page-content {
        padding: 0.75rem;
    }

    /* 푸터 모바일 스타일 - 데스크톱과 동일한 줄 설정 유지 */
    .footer {
        padding: 1rem 1rem 0.75rem;
    }

    .footer-link {
        font-size: 0.75rem;
        padding: 0.1875rem 0.375rem;
    }

    .footer-separator {
        font-size: 0.75rem;
        margin: 0 0.125rem;
    }

    .footer-info {
        font-size: 0.6875rem;
        gap: 0.25rem;
    }

    .footer-company,
    .footer-details,
    .footer-address {
        gap: 0.25rem;
    }

    .footer-copyright {
        font-size: 0.625rem;
        margin-top: 0.375rem;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 0.5rem;
    }

    /* 푸터 소형 모바일 스타일 - 데스크톱과 동일한 줄 설정 유지 */
    .footer {
        padding: 0.875rem 0.75rem 0.625rem;
    }

    .footer-content {
        gap: 0.625rem;
    }

    .footer-link {
        font-size: 0.6875rem;
        padding: 0.125rem 0.25rem;
    }

    .footer-separator {
        font-size: 0.6875rem;
        margin: 0 0.0625rem;
    }

    .footer-info {
        font-size: 0.625rem;
        gap: 0.1875rem;
    }

    .footer-company,
    .footer-details,
    .footer-address {
        gap: 0.1875rem;
    }

    .footer-copyright {
        font-size: 0.5625rem;
        margin-top: 0.3125rem;
    }
}

/* 스크롤바 스타일링 - 호버 시에만 표시 */
.sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s ease;
}

.sidebar-nav:hover {
    scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
    margin: 0.5rem 0;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.sidebar-nav:hover::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.3) 0%, rgba(59, 130, 246, 0.2) 100%);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.5) 0%, rgba(59, 130, 246, 0.3) 100%) !important;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.2);
}

/* 로딩 오버레이 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
}

.loading-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.loading-logo-icon {
    width: 4rem;
    height: 4rem;
    filter: drop-shadow(0 4px 8px rgba(30, 64, 175, 0.1));
}

.loading-brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-medium) 50%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(30, 64, 175, 0.1);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.05));
    letter-spacing: -0.025em;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner i {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-medium) 50%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: spin 1s linear infinite;
    filter: drop-shadow(0 2px 4px rgba(30, 64, 175, 0.1));
}

.loading-tips {
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 400px;
    width: 100%;
}

.loading-tip {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    line-height: 1.5;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0;
}

.loading-tip.tip-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* 애니메이션 클래스 */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* 추가 유틸리티 클래스 */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* 모바일용 사이드바 토글 버튼 (좌측 하단) */
.mobile-sidebar-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(248, 250, 252, 0.9) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    color: var(--primary-color);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 999;
    box-shadow: 
        0 8px 25px rgba(59, 130, 246, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
}

.mobile-sidebar-toggle:hover {
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.08) 0%, 
        rgba(59, 130, 246, 0.05) 100%);
    color: var(--primary-color);
    transform: scale(1);
    box-shadow: 
        0 8px 20px rgba(59, 130, 246, 0.12),
        0 4px 10px rgba(0, 0, 0, 0.06);
}

.mobile-sidebar-toggle:active {
    transform: scale(0.95);
}

/* 사이드바가 열려있을 때 모바일 토글 버튼 숨기기 */
.sidebar.open ~ .main-content .mobile-sidebar-toggle {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

/* 모바일에서만 표시 */
@media (max-width: 1024px) {
    .mobile-sidebar-toggle {
        display: flex;
    }
}

/* 로딩 UI 모바일 최적화 */
@media (max-width: 768px) {
    .loading-content {
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .loading-logo-icon {
        width: 3rem;
        height: 3rem;
    }
    
    .loading-brand-name {
        font-size: 1.25rem;
    }
    
    .loading-spinner i {
        font-size: 2.5rem;
    }
    
    .loading-tips {
        max-width: 320px;
    }
    
    .loading-tip {
        font-size: 0.8125rem;
        line-height: 1.4;
    }
} 