/* ===== 헤더 스타일 ===== */
/* admin-header 배경색 — 사용자 지정 짙은 네이비 (#0E1E3D)
   전역 가로 정책에 맞춰 1920 캡 + 중앙정렬. 1920 초과 폭에서는 좌우에 body bg-soft 가 노출됨. */
.admin-header {
    height: 50px;
    background-color: #0E1E3D;
    color: white;
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: relative;
    z-index: 1050;
    gap: 12px;
    width: 100%;
    min-width: 1280px;
    max-width: 1920px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ===== 우측 웹메일 / 사용자 정보 / 로그아웃 ===== */
/* 우측 그룹의 시작점(웹메일) 이 우측 끝으로 밀린다 */
.admin-header .webmail-btn {
    margin-left: auto;
}

.admin-header .header-user-info,
.admin-header .header-user-info * {
    color: #ffffff !important;
}

.admin-header .header-user-info {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    flex-shrink: 0;
    max-width: 320px;
}

.admin-header .header-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-header .webmail-btn,
.admin-header .webmail-btn *,
.admin-header .logout-btn,
.admin-header .logout-btn * {
    color: #ffffff !important;
}

.admin-header .webmail-btn,
.admin-header .logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #1A2C52;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #2A3D6A;
    flex-shrink: 0;
    transition: background-color 0.15s ease;
}

.admin-header .webmail-btn:hover {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.admin-header .logout-btn:hover {
    background-color: #dc3545;
    border-color: #dc3545;
}

.admin-header .webmail-btn i,
.admin-header .logout-btn i {
    font-size: 14px;
}

.admin-title {
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    color: white;
}

.header-select {
    /* 헤더 서비스 선택 박스 — 흰 배경 + 검은 글씨, current-page-wrap 과 폰트/높이 일치.
       네이티브 select 가 아니라 마우스 오버로 펼치는 커스텀 드롭다운. */
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #ced4da;
    padding: 0 10px;
    border-radius: 4px;
    font-size: 12px;
    min-width: 110px;
    height: 28px;
    box-sizing: border-box;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.header-select-current {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-select-caret {
    font-size: 10px;
    color: #495057;
    flex-shrink: 0;
}

/* 마우스 오버(또는 키보드 포커스) 시 서비스 목록 펼침 — 벗어나면 자동 닫힘 (순수 CSS) */
.header-select-list {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 100%;
    margin-top: 2px;
    background-color: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    overflow: hidden;
    z-index: 1051;
}

.header-select:hover .header-select-list,
.header-select:focus-within .header-select-list {
    display: block;
}

.header-select-option {
    display: block;
    width: 100%;
    text-align: left;
    background-color: #ffffff;
    color: #000000;
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
}

.header-select-option:hover {
    background-color: #e9ecef;
}

.header-select-option.active {
    background-color: #343a40;
    color: #ffffff;
}

.header-select:focus {
    outline: none;
    border-color: #adb5bd;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

/* ===== 현재 페이지 표시 (햄버거 + 페이지명) ===== */
/* 흰 박스 + 검정 글씨 (이미지 시안 일치) — header-select 와 동일한 높이(28px) */
.current-page-wrap {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    padding: 0 10px;
    border-radius: 4px;
    gap: 8px;
    cursor: pointer;
    min-width: 0;
    flex: 1;
    max-width: 360px;
    border: 1px solid #ced4da;
    height: 28px;
    box-sizing: border-box;
}

.hamburger-btn {
    background: none;
    border: none;
    color: #495057;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    line-height: 1;
}

.hamburger-btn i {
    color: #495057;
}

.current-page {
    background-color: transparent;
    border: none;
    color: #000000;
    /* header-select 와 동일 폰트 사이즈로 통일 (admin-service 베이스라인 12px) */
    font-size: 12px;
    min-width: 0;
    width: 100%;
    pointer-events: none;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.current-page:focus {
    outline: none;
}

/* ===== 드롭다운 메뉴 ===== */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    z-index: 1049;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
}

.dropdown-menu.show {
    max-height: 80vh;
    overflow-y: auto;
}

.dropdown-content {
    padding: 16px;
}

/* ===== 메뉴 그리드 (데스크톱) — 서비스별로 1벌씩 렌더되며 active 인 것만 표시 ===== */
.menu-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    max-width: 1920px;
    width: 100%;
    margin: 0 auto;
}

.menu-grid.active {
    display: grid;
}

.menu-column {
    min-width: 0;
    border-right: none;
    padding-right: 0;
}

.column-title {
    margin: 0 0 8px 0;
    color: #343a40;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 0;
    border-bottom: 2px solid #20c997;
    text-align: center;
    white-space: nowrap;
}

.submenu-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.submenu-item {
    color: #000000;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 3px;
    transition: background-color 0.2s, color 0.2s;
    font-size: 12px;
    text-align: center;
    border: 1px solid transparent;
    white-space: nowrap;
    display: block;
}

.submenu-item:hover {
    background-color: #e9ecef;
    color: #343a40;
    border-color: #20c997;
}

.submenu-item.active,
.submenu-item.active span {
    background-color: #343a40;
    color: #ffffff;
    border-color: #20c997;
    font-weight: 500;
}

.submenu-item.active span {
    background-color: transparent;
}

/* 오픈 준비중 메뉴 — 클릭 시 alert 만 뜨고 이동 차단 */
.submenu-item.coming-soon {
    color: #adb5bd;
    cursor: not-allowed;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.submenu-item.coming-soon:hover {
    background-color: #f8f9fa;
    color: #6c757d;
    border-color: #ced4da;
}

.coming-soon-badge {
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 8px;
    background-color: #ffc107;
    color: #212529;
    font-weight: 500;
}

.submenu-disabled {
    color: #999;
    font-style: italic;
    padding: 5px 8px;
    font-size: 12px;
    text-align: center;
    border: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 3px;
}

/* ===== 태블릿 (768px ~ 1024px) ===== */
@media screen and (max-width: 1024px) {
    .admin-header {
        gap: 8px;
        padding: 0 12px;
    }

    .admin-title {
        font-size: 16px;
    }

    .header-select {
        min-width: 70px;
        font-size: 13px;
        padding: 4px 8px;
    }

    .current-page-wrap {
        max-width: 280px;
    }

    .menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 12px;
    }

    .dropdown-content {
        padding: 12px;
    }
}

/* ===== 모바일 (~ 768px) ===== */
@media screen and (max-width: 768px) {
    .admin-header {
        height: 46px;
        padding: 0 10px;
        gap: 6px;
    }

    .admin-title {
        font-size: 14px;
    }

    .header-select {
        min-width: 60px;
        font-size: 12px;
        padding: 3px 6px;
    }

    .current-page-wrap {
        max-width: none;
        flex: 1;
        padding: 4px 8px;
    }

    .current-page {
        font-size: 12px;
    }

    .dropdown-menu.show {
        max-height: 85vh;
    }

    .dropdown-content {
        padding: 10px;
    }

    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .column-title {
        font-size: 12px;
        padding: 4px 0;
        margin-bottom: 6px;
    }

    .submenu-item {
        font-size: 12px;
        padding: 4px 4px;
    }

    .submenu-disabled {
        font-size: 12px;
        padding: 4px 4px;
    }
}

/* ===== 소형 모바일 (~ 480px) ===== */
@media screen and (max-width: 480px) {
    .admin-header {
        height: 44px;
        padding: 0 8px;
        gap: 4px;
    }

    .admin-title {
        font-size: 13px;
    }

    .header-select {
        min-width: 55px;
        font-size: 12px;
        padding: 3px 4px;
    }

    .current-page-wrap {
        padding: 3px 6px;
        gap: 4px;
    }

    .hamburger-btn {
        font-size: 16px;
    }

    .current-page {
        font-size: 12px;
    }

    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .column-title {
        font-size: 12px;
    }

    .submenu-item {
        font-size: 12px;
        padding: 4px 2px;
    }

    .submenu-disabled {
        font-size: 12px;
        padding: 4px 2px;
    }
}
