/* ===================================
   레이아웃 - 스타일시트
   =================================== */

/* ===================================
   1. 리셋 및 기본 스타일
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", "Malgun Gothic", "맑은 고딕", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ===================================
   2. 헤더 스타일
   =================================== */
.dx-header {
    background: #fff;
    border-bottom: 1px solid #ddd;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.dx-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 400;
    color: #333;
}

.dx-logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #ff6b35 0%, #f72b1c 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.dx-header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.dx-search-box {
    position: relative;
}

.dx-search-input {
    width: 300px;
    height: 34px;
    padding: 0 35px 0 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    transition: all 0.2s;
}

    .dx-search-input:focus {
        border-color: #ff6b35;
        box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
    }

.dx-search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.dx-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

    .dx-user-info:hover {
        background: #f0f0f0;
    }

.dx-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ff6b35;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.dx-main-content {
    flex: 1;
    transition: margin-left 0.3s;
}

/* 모바일 토글 버튼 */
.dx-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    margin-right: 12px;
}

@media (max-width: 768px) {
    .dx-menu-toggle {
        display: block;
    }

    .dx-search-input {
        width: 150px;
    }
}

/* 알림 아이콘 */
.dx-notification {
    position: relative;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dx-notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ff6b35;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}


/* ===================================
   3. 사이드바 스타일
   =================================== */
.dx-sidebar {
    position: fixed;
    left: 0;
    top: 56px;
    width: 240px;
    height: calc(100vh - 56px);
    background: #2b2b2b;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.3s ease, transform 0.3s ease;
    z-index: 999;
}

    .dx-sidebar.collapsed {
        width: 60px;
    }

/* 사이드바 토글 버튼 */
.dx-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #3c3c3c;
    background: #2b2b2b;
    position: sticky;
    top: 0;
    z-index: 10;
}

.dx-nav-toggle-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 18px;
}

.dx-sidebar.collapsed .dx-nav-toggle {
    padding: 12px 18px;
    justify-content: center;
}

/* 네비게이션 그룹 */
.dx-nav-group {
    padding: 12px 0;
    border-bottom: 1px solid #3c3c3c;
}

    .dx-nav-group:last-child {
        border-bottom: none;
    }

.dx-nav-header {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    overflow: hidden;
    transition: all 0.3s;
}

.dx-sidebar.collapsed .dx-nav-header {
    padding: 8px 0;
    text-align: center;
    font-size: 9px;
}

/* 네비게이션 아이템 */
.dx-nav-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: #ccc;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    position: relative;
    white-space: nowrap;
}

.dx-sidebar.collapsed .dx-nav-item {
    padding: 10px 0;
    justify-content: center;
}

    .dx-nav-item:hover {
        background: #3c3c3c;
        color: #fff;
    }

    .dx-nav-item.active {
        background: #ff6b35;
        color: #fff;
    }

        .dx-nav-item.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background: #fff;
        }

/* 네비게이션 아이콘 */
.dx-nav-icon {
    width: 20px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.dx-sidebar.collapsed .dx-nav-icon {
    margin-right: 0;
    font-size: 18px;
}

.dx-nav-toggle-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s;
}

.dx-sidebar.collapsed .dx-nav-toggle-title {
    display: none;
}

/* 네비게이션 배지 */
.dx-nav-badge {
    margin-left: auto;
    background: #ff6b35;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.dx-sidebar.collapsed .dx-nav-badge {
    position: absolute;
    top: 5px;
    right: 10px;
    padding: 1px 4px;
    font-size: 9px;
    min-width: 14px;
}

.dx-nav-item.active .dx-nav-badge {
    background: rgba(255,255,255,0.2);
}

/* 네비게이션 텍스트 */
.dx-nav-text {
    flex: 1;
    opacity: 1;
    transition: opacity 0.3s;
}

.dx-sidebar.collapsed .dx-nav-text {
    display: none;
}

.dx-nav-expand {
    margin-left: auto;
    transition: transform 0.2s;
    font-size: 12px;
}

.dx-sidebar.collapsed .dx-nav-expand {
    display: none;
}

    .dx-nav-expand.expanded {
        transform: rotate(90deg);
    }

.dx-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #1f1f1f;
}

    .dx-submenu.active {
        max-height: 300px;
    }

.dx-submenu-item {
    padding: 8px 20px 8px 52px;
    color: #999;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    font-size: 13px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

    .dx-submenu-item:hover {
        color: #fff;
        background: #2b2b2b;
    }

    .dx-submenu-item.active {
        color: #ff6b35;
        background: rgba(255, 107, 53, 0.1);
    }

/* NavLink를 위한 button 스타일 */
button.dx-nav-item {
    font-family: inherit;
}

/* 사이드바가 접혔을 때 메인 콘텐츠 조정 */
.dx-sidebar ~ .dx-main-content {
    margin-left: 240px;
}

.dx-sidebar.collapsed ~ .dx-main-content {
    margin-left: 60px;
}

/* ===================================
4. 도큐먼트 스타일
=================================== */
.dx-toolbar {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}.dx-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 13px;
}

.dx-breadcrumb-item {
    color: #ff6b35;
    text-decoration: none;
}

.dx-breadcrumb-separator {
    color: #999;
}

/* 반응형 - 태블릿 */
@media (max-width: 1024px) {
    .dx-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dx-search-input {
        width: 200px;
    }
}

/* 반응형 - 모바일 */
@media (max-width: 768px) {
    .dx-menu-toggle {
        display: block;
    }

    .dx-sidebar {
        transform: translateX(0px);
        width: 240px !important;
    }

        .dx-sidebar.mobile-active {
            transform: translateX(0);
            box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        }

        .dx-sidebar.collapsed {
            width: 60px !important;
        }

        .dx-sidebar.active {
            /*transform: translateX(0);*/
            box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        }

        .dx-sidebar ~ .dx-main-content {
            margin-left: 0;
        }

    .dx-nav-toggle {
        display: none;
    }

    .dx-main {
        margin-left: 0 !important;
    }

    .dx-header-right {
        gap: 10px;
    }

    .dx-search-box {
        display: none;
    }

    .dx-user-info span {
        display: none;
    }

    .dx-stats-grid {
        grid-template-columns: 1fr;
    }

    .dx-content {
        padding: 15px;
    }

    .dx-table {
        font-size: 12px;
    }

        .dx-table th,
        .dx-table td {
            padding: 8px;
        }
}

/* 반응형 - 소형 모바일 */
@media (max-width: 480px) {
    .dx-logo span {
        display: none;
    }

    .dx-card {
        padding: 15px;
    }

    .dx-stat-card {
        padding: 15px;
    }

    .dx-stat-value {
        font-size: 20px;
    }
}