/* --- 기본 설정 --- */
:root {
    --app-bg: #f1f5f9;
    --primary-color: #3b82f6;
    --icon-color: #94a3b8;
    --dark-pill: #1e293b;
    --smooth-easing: cubic-bezier(0.4, 0, 0.2, 1);
    --bounce-easing: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* =========================================
   🌟 ERP 인트라넷 로그인 대문 UI
========================================= */
.auth-container.linear-design {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    z-index: 99999;
    /* 모든 것 위에 덮음 */
}

.linear-wrapper {
    position: relative;
    z-index: 10;
    text-align: center;
    width: 100%;
    max-width: 400px;
    padding: 0 30px;
}

.brand-axis {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

.admin-top-logo {
    height: 40px;
    margin-bottom: 20px;
}

.vertical-line {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, #3b82f6, transparent);
}

.main-title {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 2px;
    margin: 0 0 5px 0;
}

.main-title .thin {
    font-weight: 300;
    color: #94a3b8;
}

.sub-title {
    font-size: 12px;
    color: #64748b;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 50px;
}

.input-stack {
    margin-bottom: 40px;
}

.field-row {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 0;
}

.field-label {
    font-size: 11px;
    font-weight: 800;
    color: #3b82f6;
    width: 40px;
    text-align: left;
    opacity: 0.7;
}

.field-row input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 15px;
    font-size: 16px;
    color: #0f172a;
    letter-spacing: 1px;
}

.field-row input::placeholder {
    color: #cbd5e1;
    font-weight: 400;
}

.field-row input:focus {
    outline: none;
}

.bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: #e2e8f0;
    transition: 0.4s ease;
}

.field-row input:focus~.bottom-bar {
    background: #3b82f6;
    height: 2px;
}

.btn-linear-gate {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    cursor: pointer;
    width: 100%;
    padding: 20px;
    transition: 0.3s;
}

.btn-linear-gate .text {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 3px;
    transition: 0.3s;
}

.arrow-svg {
    width: 20px;
    fill: #3b82f6;
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-linear-gate:hover .arrow-svg {
    transform: translateX(12px);
}

.btn-linear-gate:hover .text {
    color: #3b82f6;
}

.system-meta {
    position: absolute;
    bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 20px;
}

.meta-item {
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 1px;
    font-weight: 600;
}

.meta-divider {
    width: 1px;
    height: 12px;
    background: #e2e8f0;
}

/* 🌟 로그아웃 버튼 스타일 */
.btn-logout {
    margin-top: 10px;
    color: #ef4444;
}

.btn-logout:hover {
    background: #fef2f2;
    color: #ef4444;
}

body {
    background-color: var(--app-bg);
    margin: 0;
    font-family: 'Pretendard', sans-serif;
    overflow: hidden;
}

/* --- [전체 레이아웃] 사이드바와 캔버스를 벽에서 떼어내기 --- */
.cloud-workspace {
    display: flex;
    height: 100vh;
    padding: 20px;
    /* 🌟 핵심: 전체 여백 */
    gap: 20px;
    background-color: var(--app-bg);
    box-sizing: border-box;
}

/* --- [사이드바 아일랜드] --- */
.pill-sidebar {
    width: 84px;
    height: 100%;
    position: relative;
    /* 🌟 작업 화면(open-canvas)보다 무조건 위에 있도록 설정 */
    z-index: 9999;
}

.side-island {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
    /* 🌟 중요: 내부 요소(툴팁)가 밖으로 나갈 수 있게 숨김 처리 해제 */
    overflow: visible;
}

/* 로고 영역 */
.brand-zone-wrapper {
    margin-bottom: 30px;
}

.brand-zone {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s var(--bounce-easing);
}

.brand-zone:hover {
    transform: scale(1.1) rotate(5deg);
}

.brand-logo-img {
    width: 30px;
    height: 30px;
}

/* 네비게이션 메뉴 */
.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}

/* --- [입체적이고 쫀득한 사이드바 메뉴] --- */
.nav-menu li {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 18px;
    background: transparent;
    /* 🌟 탄성 효과를 위한 베지어 곡선 */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-menu li a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    color: var(--icon-color);
    font-size: 20px;
    text-decoration: none;
    border-radius: 18px;
    transition: inherit;
    /* 부모의 transition 상속 */
    cursor: pointer;
    z-index: 2;
}

/* 1. 마우스 올렸을 때 (살짝 떠오름) */
.nav-menu li:hover {
    transform: translateY(-4px);
    /* 위로 살짝 뜸 */
    background: #ffffff;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
    /* 그림자로 띄우기 */
}

.nav-menu li:hover a {
    color: var(--primary-color);
}

/* 2. 활성화 상태 (깊이감 있게 고정) */
.nav-menu li.active {
    background: var(--dark-pill);
    transform: translateY(0) scale(0.95);
    /* 눌린 느낌을 주기 위해 살짝 축소 */
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.3);
    /* 안쪽 그림자로 쑥 들어간 효과 */
}

.nav-menu li.active a {
    color: #ffffff;
}

/* 3. 클릭하는 순간 (쫀득하게 눌림) */
.nav-menu li:active {
    transform: scale(0.85);
    /* 확 눌리는 느낌 */
    transition: all 0.1s ease;
    /* 눌릴 때는 아주 빠르게 */
}

/* 툴팁 레이어 고정 (이전 수정사항 포함) */
.pill-sidebar {
    z-index: 9999 !important;
}

.side-island {
    overflow: visible !important;
}

.nav-menu li:not(.active):hover a {
    color: var(--dark-pill);
}

/* 구분선 */
.divider {
    width: 20px;
    height: 2px;
    background: rgba(0, 0, 0, 0.05);
    margin: 10px 0 22px 0;
    border-radius: 2px;
}

/* --- [프리미엄 글래스 툴팁] --- */
.nav-menu li::before {
    content: attr(data-tooltip);
    position: absolute;
    /* 🌟 사이드바 바디를 완전히 벗어나도록 위치 조정 */
    left: 65px;
    top: 50%;
    transform: translateY(-50%) translateX(-10px);

    background: #1e293b;
    color: white;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;

    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* 🌟 툴팁이 그 어떤 카드나 버튼보다 위에 오도록 */
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.nav-menu li:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.nav-menu li.active::before {
    display: none;
}

/* 활성 탭 툴팁 숨김 */

/* 하단 푸터 */
.side-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.bottom-action-btn {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    border: none;
    background: white;
    color: var(--icon-color);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.bottom-action-btn:hover {
    background: var(--dark-pill);
    color: white;
    transform: rotate(45deg);
}

/* --- [메인 캔버스 조화] --- */
.open-canvas {
    flex: 1;
    background: #ffffff;
    border-radius: 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    /* 자식 요소들의 기준점 */
}



.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 애니메이션 클래스 */
.slide-out {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(10px);
    transition: all 0.3s var(--smooth-easing);
}

/* =========================================================
   [PREMIUM TOP NAV BAR] - 글래스모피즘 & 레이아웃 최적화
   ========================================================= */

.top-nav-bar {
    width: 100%;
    height: 90px;
    min-height: 90px;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    /* 🌟 확실한 흰색 배경으로 뒤를 가림 */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    /* sticky 대신 relative 사용 */
    z-index: 100;
    /* 콘텐츠보다 무조건 위 */
    box-sizing: border-box;
}

/* 1. 현재 섹션 제목 영역 */
.header-title-zone {
    flex-shrink: 0;
    position: relative;
    z-index: 101;
}

.header-title-zone h2 {
    font-size: 26px;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
    /* 텍스트가 묻히지 않도록 강제 노출 */
    display: block;
}

/* --- [콘텐츠 스테이지 영역] --- */
.content-stage {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    /* 🌟 상단 바는 두고 여기서만 스크롤 발생 */
    padding: 40px;
    /* 🌟 이제 90px를 띄울 필요 없이 순수 패딩만 */
    box-sizing: border-box;
    background-color: #fcfcfc;
    /* 바와 미세하게 색상 차이를 둠 */
    position: relative;
    z-index: 1;
}

/* 2. 우측 액션 버튼 그룹 (떠 있는 유리 캡슐 효과) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.5);
    /* 반투명 화이트 */
    backdrop-filter: blur(12px);
    /* 배경 블러 효과 */
    -webkit-backdrop-filter: blur(12px);
    padding: 8px 8px 8px 24px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

/* 알림/메일 원형 버튼 */
.icon-circle-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: white;
    color: #64748b;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.icon-circle-btn:hover {
    background: #1e293b;
    color: white;
    transform: translateY(-2px);
}

/* 3. 사용자 프로필 구역 */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 16px 4px 6px;
    background: white;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
}

.user-profile:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.profile-img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-text {
    display: flex;
    flex-direction: column;
}

.profile-text strong {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.profile-text span {
    font-size: 11px;
    font-weight: 600;
    color: #10b981;
    /* 온라인 상태 초록색 */
}

/* =========================================
   🌟 플로팅 라벨 애니메이션 (Floating Label)
========================================= */

/* 혹시라도 하드코딩된 placeholder가 남아있을 경우를 대비해 투명 처리 */
.field-row input::placeholder {
    color: transparent;
}

/* 1. 기본 상태: 입력창 중앙에 회색으로 희미하게 배치 */
.floating-label {
    position: absolute;
    /* 왼쪽 'ID' 텍스트 영역(40px) + 인풋 여백(15px)을 계산한 위치 */
    left: 55px;
    top: 50%;
    transform: translateY(-50%);
    color: #cbd5e1;
    font-size: 16px;
    font-weight: 400;
    pointer-events: none;
    /* 마우스 클릭을 가로채지 않도록 무시 */
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    /* 스르륵 쫀득한 애니메이션 */
}

/* 2. 활성 상태: 입력창 클릭(focus) 또는 값이 입력되어 있을 때(valid) */
.field-row input:focus~.floating-label,
.field-row input:valid~.floating-label {
    top: -5px;
    /* 위로 쏙 올라감 */
    font-size: 11px;
    /* 글씨가 작아짐 */
    color: #3b82f6;
    /* ERP 메인 컬러(블루)로 강조 */
    font-weight: 700;
    letter-spacing: 1px;
}

/* ==========================================
   시스템 에러 알림창 (Toast Notification)
   ========================================== */
.system-alert {
    position: fixed !important;
    /* 강제 고정 */
    bottom: 40px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(15, 15, 15, 0.85) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 77, 77, 0.3) !important;
    border-left: 4px solid #ff4d4d !important;
    padding: 14px 24px !important;
    /* display: flex; /* 자바스크립트에서 제어하므로 여기선 제외 */
    align-items: center !important;
    gap: 12px !important;
    z-index: 999999 !important;
    /* 무조건 최상단 */
    box-shadow: 0 8px 32px rgba(255, 77, 77, 0.15) !important;
    pointer-events: none !important;
    opacity: 0;
    /* 초기 상태는 투명 */
}

.system-alert .alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.system-alert .alert-icon svg {
    width: 18px;
    height: 18px;
    stroke: #ff4d4d;
}

.system-alert .alert-text {
    color: #e0e0e0;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* 🌟 입력칸 우측 플로팅 아이디 저장 체크박스 */
.inline-save {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    /* 정확히 수직 중앙 정렬 */
    margin: 0;
    z-index: 10;
    background: transparent;
}

/* 텍스트를 작고 세련되게 (시스템 폰트 느낌) */
.inline-save .save-text {
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 1px;
    transition: 0.2s;
}

.inline-save:hover .save-text {
    color: #3b82f6;
}

/* 체크박스 크기를 인풋창 밸런스에 맞게 축소 */
.inline-save .checkmark {
    width: 14px;
    height: 14px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    margin-right: 6px;
}

/* 체크 V 마크 미세 조정 */
.inline-save .checkmark:after {
    width: 3px;
    height: 7px;
    border-width: 0 2px 2px 0;
    margin-bottom: 2px;
}

/* =========================================
   📱 모바일 반응형 CSS (Mobile Responsive) - 아이콘 찌그러짐 최종 해결판
========================================= */
@media screen and (max-width: 768px) {

    /* 1. 모바일 뷰포트 높이 고정 (주소창 버그 방지) */
    body,
    html {
        height: 100dvh !important;
        overflow: hidden !important;
    }

    /* 2. 레이아웃 역순 (사이드바를 하단으로) */
    .cloud-workspace {
        height: 100dvh !important;
        padding: 12px !important;
        gap: 12px !important;
        flex-direction: column-reverse !important;
        padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
        box-sizing: border-box !important;
    }

    /* 3. 메인 작업 캔버스 (유연한 내부 스크롤) */
    .open-canvas {
        border-radius: 20px !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: 100% !important;
        margin: 0 !important;
    }

    /* 4. 하단 네비게이션 컨테이너 고정 */
    .pill-sidebar {
        width: 100% !important;
        height: 64px !important;
        /* 하단 바 높이 고정 */
        min-height: 64px !important;
        flex: 0 0 64px !important;
        /* 절대 찌그러지지 않음 */
        z-index: 9999 !important;
        position: relative !important;
    }

    .side-island {
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 12px !important;
        border-radius: 20px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        box-sizing: border-box !important;
    }

    /* 불필요 요소 제거 */
    .brand-zone-wrapper,
    .divider {
        display: none !important;
    }

    /* 🚨 5. 탭 메뉴 (찌그러짐 방지 핵심 영역) */
    .nav-menu {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-start !important;

        /* 전체 100% 폭에서 우측 버튼 영역(115px)을 제외한 나머지 공간만 사용하도록 강제 */
        width: calc(100% - 115px) !important;
        max-width: calc(100% - 115px) !important;

        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: auto !important;
        /* 넘치면 무조건 가로 스크롤 */
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        /* 부드러운 스와이프 */
        gap: 10px !important;
    }

    .nav-menu::-webkit-scrollbar {
        display: none !important;
    }

    /* 개별 메뉴 탭 (절대 제 크기 유지) */
    .nav-menu li {
        display: flex !important;
        width: 44px !important;
        min-width: 44px !important;
        /* 최소 너비 방어선 */
        height: 44px !important;
        flex: 0 0 44px !important;
        /* 축소/확대 금지 */
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 14px !important;
        transform: none !important;
        /* 데스크탑 호버 애니메이션 버그 제거 */
    }

    .nav-menu li a {
        font-size: 18px !important;
        width: 100% !important;
        height: 100% !important;
    }

    .nav-menu li::before {
        display: none !important;
    }

    /* 🚨 6. 우측 하단 버튼 영역 (공간 고정) */
    .side-footer {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end !important;

        /* 수학적으로 고정된 너비 할당 */
        width: 105px !important;
        min-width: 105px !important;
        flex: 0 0 105px !important;

        margin: 0 !important;
        padding: 0 0 0 10px !important;
        border-left: 1px solid #e2e8f0 !important;
        /* 구분선 */
        gap: 8px !important;
    }

    .bottom-action-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        flex: 0 0 44px !important;
        margin: 0 !important;
    }

    /* 7. 상단 바 및 캔버스 패딩 조율 */
    .top-nav-bar {
        height: 60px !important;
        min-height: 60px !important;
        padding: 0 16px !important;
    }

    .header-title-zone h2 {
        font-size: 18px !important;
    }

    .icon-circle-btn {
        width: 34px !important;
        height: 34px !important;
        font-size: 15px !important;
    }

    .profile-text {
        display: none !important;
    }

    .content-stage {
        padding: 16px !important;
    }

    /* 로그인 화면 */
    .main-title {
        font-size: 24px;
    }

    .sub-title {
        font-size: 10px;
        margin-bottom: 30px;
    }

    .linear-wrapper {
        padding: 0 20px;
    }
}