/* 네브바 통합 스타일 (2단 레이아웃 + Aero Glass) */
.navbar {
    background: rgba(30, 58, 138, 0.85) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 2000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: margin-top 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s;
    transform-origin: top;
}

.navbar.collapsed {
    margin-top: calc(-1 * var(--navbar-height, 180px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.navbar-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between; /* 기존 center에서 space-between으로 변경 */
    align-items: center;
    width: 100%;
}

/* 1행: 메뉴 바 */
.navbar-row.primary {
    height: 55px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar-logo {
    color: white !important;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.navbar-logo i {
    color: #60a5fa;
    font-size: 1.2rem;
}

/* 1행 왼쪽 그룹: 토글 + 로고 + 글로벌 필터 */
.navbar-left-group {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.navbar-global-filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.navbar-global-filter-form .filter-item select {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 15px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
    height: 34px;
}

.navbar-global-filter-form .filter-item select:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(96, 165, 250, 0.5);
}

.navbar-menu {
    display: flex;
    list-style: none;
    list-style-type: none;
    list-style-image: none;
    margin: 0 20px;
    padding: 0;
    padding-inline-start: 0;
    gap: 5px;
    /* flex: 1; 을 필요시 사용하여 중앙으로 밀어낼 수 있음 */
}

/* flex ul의 li에도 마커 제거(일부 브라우저에서 시스템 관리 등 맨끝 항목 왼쪽에 검은 점 노출 방지) */
.navbar-menu > li {
    list-style: none;
    list-style-type: none;
}

.navbar-menu > li::marker {
    content: none;
}

.navbar-menu li a {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
    padding: 8px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.navbar-menu li a:hover, .navbar-menu li.active a {
    background: rgba(255, 255, 255, 0.15);
    color: white !important;
}

/* 2행: 필터 바 */
.navbar-row.secondary {
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
}

/* 데스크탑 기본 노출 */
@media (min-width: 901px) {
    .navbar-row.secondary {
        height: 60px;
        opacity: 1;
    }
}

/* 모바일 필터 토글 */
@media (max-width: 900px) {
    .navbar-row.secondary, .navbar-row.tertiary {
        height: 0;
        opacity: 0;
        visibility: hidden;
    }
    .navbar-row.secondary.active, .navbar-row.tertiary.active {
        height: auto;
        opacity: 1;
        visibility: visible;
        padding: 10px 0;
    }
}

.navbar-filter-form {
    display: flex;
    justify-content: center; /* 필터 중앙 정렬 */
    align-items: center;
    gap: 15px;
    width: 100%;
}

.filter-item select {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 25px;
    border-radius: 8px;
    font-size: 1.05rem;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 180px;
}

.filter-item select:hover {
    background: rgba(255, 255, 255, 0.2);
}

.filter-item select option {
    background: #1e3a8a;
    color: white;
}

/* 3행: 액션 및 검색 바 */
.navbar-row.tertiary {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 50px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

@media (min-width: 901px) {
    .navbar-row.tertiary {
        height: auto;
        padding: 8px 0;
    }
}

.tertiary-container {
    display: flex;
    justify-content: center; /* 액션 바 중앙 정렬 */
    align-items: center;
    width: 100%;
    gap: 30px;
}

/* 액션 버튼 그룹 */
.navbar-actions-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 네브바 전용 버튼 스타일 (텍스트 포함 타원형 스타일) */
.navbar-actions-group .btn {
    padding: 0 16px; /* 좌우 여백 확보 */
    height: 38px;
    border-radius: 20px; /* 타원형(Pill)으로 변경 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    transition: all 0.3s;
    box-shadow: none;
    text-decoration: none !important; /* 밑줄 제거 */
}

.navbar-actions-group .btn i {
    font-size: 1.1rem;
    margin: 0;
}

.navbar-actions-group .btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: #60a5fa !important;
    transform: translateY(-2px);
}

.navbar-actions-group .btn span {
    display: inline !important; /* 텍스트 다시 노출 */
    font-size: 0.8rem;
    margin-left: 6px;
    font-weight: 600;
}

/* 검색 필통(Pill) 스타일 (네브바용) */
.navbar-search-pill {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2px 2px 2px 15px;
    width: 320px;
    transition: all 0.3s;
}

.navbar-search-pill:focus-within {
    background: rgba(255, 255, 255, 0.2);
    border-color: #60a5fa;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

.navbar-search-pill input {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.85rem;
    width: 100%;
    outline: none;
}

/* 본문 타이틀 영역 내 검색창 스타일 (밝은 배경용 - 명확한 테두리 강조) */
.card-container .title .navbar-search-pill {
    background: #fff !important;
    border: 2px solid #3b82f6 !important; /* 더 선명한 파란색 테두리 */
    width: 450px !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1) !important;
}

.card-container .title .navbar-search-pill input {
    color: #1e293b !important;
}

.card-container .title .navbar-search-pill input::placeholder {
    color: #94a3b8 !important;
}

.card-container .title .navbar-search-pill .btn-search,
.card-container .title .navbar-search-pill .btn-camera {
    color: #3b82f6 !important;
}

.card-container .title .navbar-search-pill:focus-within {
    border-color: #2563eb !important;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.2) !important;
}

.navbar-search-pill input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.navbar-search-pill .btn-search, .navbar-search-pill .btn-camera {
    background: transparent;
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.navbar-search-pill .btn-camera {
    color: #10b981;
}

.navbar-search-pill .btn-search:hover, .navbar-search-pill .btn-camera:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* 사용자 정보 및 우측 메뉴 */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.navbar-user-info {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-filter-toggle, .navbar-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #60a5fa !important; /* 아이콘 색상 통일 */
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-user-info i {
    color: #60a5fa;
    font-size: 1.2rem;
}

.logout-link i {
    color: #fca5a5 !important; /* 로그아웃은 유지하되 크기 최적화 */
    font-size: 1.2rem;
}

/* 네브바 가시성 토글 버튼 */
.navbar-visibility-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #60a5fa !important;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 10px;
    font-size: 0.9rem;
}

.navbar-visibility-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #60a5fa;
    transform: translateY(-2px);
}

/* 부유형 보이기 탭 */
.navbar-show-tab {
    position: fixed;
    top: 0;
    right: 50px;
    background: rgba(30, 58, 138, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-top: none;
    border-radius: 0 0 15px 15px;
    padding: 8px 20px;
    color: #60a5fa;
    cursor: pointer;
    z-index: 2001;
    display: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-size: 1.1rem;
}

.navbar-show-tab:hover {
    padding-top: 12px;
    background: #1e40af;
    color: white;
}

/* 접힌 상태에서 탭 표시 */
.navbar.collapsed + .navbar-show-tab {
    display: block;
    animation: slideDownTab 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDownTab {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@media (max-width: 900px) {
    .navbar-show-tab {
        right: 15px;
        padding: 6px 15px;
    }
}

@media (max-width: 900px) {
    .navbar-filter-toggle, .navbar-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .navbar-menu {
        position: absolute;
        top: 55px; /* primary row 높이 */
        left: 0;
        width: 100%;
        background: rgba(30, 58, 138, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        gap: 0;
        margin: 0;
        height: 0;
        opacity: 0;
        visibility: hidden;
        overflow: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    }
    .navbar-menu.active {
        height: auto;
        opacity: 1;
        visibility: visible;
        padding: 10px 0;
    }
    .navbar-menu li {
        width: 100%;
        list-style: none;
        list-style-type: none;
    }

    .navbar-menu li::marker {
        content: none;
    }
    .navbar-menu li a {
        padding: 12px 25px;
        border-radius: 0;
        width: 100%;
        font-size: 1rem;
    }
    .navbar-menu li.has-dropdown .dropdown-menu {
        position: static;
        width: 100%;
        background: rgba(255, 255, 255, 0.05);
        border: none;
        box-shadow: none;
        padding-left: 20px;
    }
    .navbar-menu li.has-dropdown:hover .dropdown-menu {
        display: block;
    }
    .navbar-filter-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .tertiary-container {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 10px;
    }
    .navbar-search-pill {
        width: 100%;
    }
    .navbar-actions-group {
        justify-content: center;
    }
}

.logout-link {
    color: #fca5a5 !important;
    font-size: 1.1rem;
    text-decoration: none;
}

/* 드롭다운 */
.has-dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #1e3a8a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    min-width: 180px;
    margin: 0;
    padding: 8px 0;
    padding-inline-start: 0;
    list-style: none;
    list-style-type: none;
    z-index: 3000;
}

.dropdown-menu > li {
    list-style: none;
    list-style-type: none;
}

.dropdown-menu > li::marker {
    content: none;
}
.has-dropdown:hover .dropdown-menu { display: block; }

/* 정렬 아이콘 시인성 개선 (노란색) */
.device-table th i.fa-sort-up,
.device-table th i.fa-sort-down {
    color: #fcd34d !important;
    opacity: 1 !important;
}

.device-table th i.fa-sort {
    color: rgba(255, 255, 255, 0.4);
}

/* 테이블 모드에서의 필터 바 수동 노출 설정 */
.navbar-row.secondary.table-mode-filter {
    display: none; 
}

@media (min-width: 901px) {
    .navbar-row.secondary.table-mode-filter.show-manual {
        display: flex !important;
        height: 50px !important;
        opacity: 1 !important;
    }
}
.dropdown-menu li.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 5px 0;
}
.dropdown-menu li a { border-radius: 0; font-size: 0.85rem; }