/* 전체 레이아웃 */
html {
    overflow-x: hidden;
    width: 100%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Malgun Gothic', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f4f6f9;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* 사이드바 */
.sidebar {
    width: 250px;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.sidebar-nav {
    flex: 1;
}

.sidebar-footer {
    margin-top: auto;
}

.sidebar.collapsed {
    margin-left: -250px;
}

.sidebar-header {
    height: 60px;
    display: flex;
    align-items: center;
}

.sidebar-nav .nav-link {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-left: 3px solid #fff;
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
}

/* 메인 콘텐츠 */
.main-content {
    flex: 1;
    margin-left: 250px;
    transition: all 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.content-wrapper {
    flex: 1;
}

/* 네비게이션 */
.navbar {
    height: 60px;
}

/* 카드 */
.card {
    border: none;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.card-header {
    border-bottom: 1px solid #eee;
    padding: 15px 20px;
}

/* 테이블 */
.table th {
    font-weight: 600;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

/* 테이블 반응형 */
@media (max-width: 768px) {
    .card {
        margin-left: 0;
        margin-right: 0;
    }

    .card > .card-body {
        padding: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .table-responsive,
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .table {
        font-size: 0.8rem;
        margin-bottom: 0;
        min-width: 500px;
        width: max-content;
    }

    .table th, .table td {
        padding: 0.4rem;
        white-space: nowrap;
    }

    .btn-sm {
        padding: 2px 5px;
        font-size: 0.7rem;
    }
}

/* 버튼 */
.btn {
    border-radius: 5px;
}

.btn-sm {
    padding: 4px 8px;
}

/* 로그인 페이지 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.login-box .form-control {
    height: 50px;
    border-radius: 5px;
}

.login-box .btn-primary {
    height: 50px;
    font-size: 16px;
}

/* 사이드바 오버레이 (모바일용) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* 반응형 */
@media (max-width: 768px) {
    .wrapper {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .sidebar {
        margin-left: -250px;
    }

    .sidebar.show {
        margin-left: 0;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100vw;
        min-width: 0;
        overflow-x: hidden;
    }

    .content-wrapper {
        width: 100%;
        max-width: 100%;
        padding: 1rem !important;
        overflow-x: hidden;
    }

    .navbar .d-flex.align-items-center > span {
        display: none;
    }

    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* 유틸리티 */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
