* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;

    --text-primary: #1a1a1a;
    --text-secondary: #4a5568;
    --text-tertiary: #718096;
    --text-muted: #a0aec0;

    --border-color: #e2e8f0;
    --border-hover: #cbd5e0;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 8px 0 rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 8px 16px 0 rgba(0, 0, 0, 0.12);

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-full: 9999px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-secondary);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-color);
}

button {
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

input,
textarea,
select {
    font-family: inherit;
    transition: all 0.2s ease;
    font-size: 14px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
}

/* 공통 헤더 스타일 */
.main-container {
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    /* Enable Sticky Footer */
}

main {
    flex: 1;
    /* Push footer to bottom */
    width: 100%;
    /* Ensure full width */
}

.main-header {
    background: var(--bg-primary);
    padding: 12px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.menu-toggle:hover {
    background: var(--bg-tertiary);
}

.main-header .logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.3px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-header .logo i {
    font-size: 20px;
}

.main-header .logo span {
    display: inline-block;
}

/* PC 버전 사이드바 관련 스타일 */
@media (min-width: 1200px) {
    .main-container {
        margin-left: 60px;
        transition: margin-left 0.3s ease;
    }

    body:not(.sidebar-closed) .main-container {
        margin-left: 280px;
    }

    body.sidebar-closed .main-container {
        margin-left: 60px;
    }

    .menu-toggle {
        display: none;
    }

    body.sidebar-closed .menu-toggle {
        display: none;
    }

    /* 헤더 사용자 정보 영역 */
    .main-header {
        justify-content: space-between;
    }

    .header-user-info {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .header-nav-link {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        border-radius: var(--radius-md);
        color: var(--text-secondary);
        font-size: 14px;
        font-weight: 500;
        text-decoration: none;
        transition: all 0.2s ease;
        cursor: pointer;
    }

    .header-nav-link:hover {
        background: var(--bg-secondary);
        color: var(--primary-color);
    }

    .header-nav-link i {
        font-size: 16px;
    }

    .header-user-name {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 14px;
        border-radius: var(--radius-md);
        color: var(--text-primary);
        font-size: 14px;
        font-weight: 600;
        background: var(--bg-secondary);
    }

    .header-user-name i {
        font-size: 16px;
        color: var(--primary-color);
    }

    .header-logout-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        background: var(--bg-primary);
        color: var(--text-secondary);
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .header-logout-btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--primary-color);
        color: var(--primary-color);
    }

    .header-logout-btn i {
        font-size: 16px;
    }
}

/* 모바일에서 헤더 사용자 정보 숨기기 */
@media (max-width: 1199px) {
    .header-user-info {
        display: none !important;
    }
}