/* ==========================================================================
 * 앱 메뉴 — 하이웍스식
 *
 * 상단바에 앱(전자결재 · 일정 · 물품관리 …)이 서고, 사이드바에는 고른 앱의 메뉴만 나온다.
 * 앱 줄은 남는 폭을 모두 쓰고, 넘치는 앱은 mediflow.js 가 '더보기' 안으로 옮긴다.
 * 좁은 화면(992px 미만)에서는 앱 줄을 감추고 ▦ 전체 앱 격자로만 이동한다.
 * ========================================================================== */
.app-nav {
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    min-width: 0;
    height: var(--theme-topbar-height);
    margin: 0 0.75rem;
    gap: 0.125rem;
}
.app-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0 0.875rem;
    border: 0;
    border-bottom: 3px solid transparent;
    border-top: 3px solid transparent;
    background: none;
    color: var(--theme-body-color);
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.12s ease, border-color 0.12s ease;
}
.app-nav-link:hover,
.app-nav-link:focus-visible {
    color: var(--brand-emph);
}
/* 고른 앱 — 상단바 바닥의 파란 줄. 로고(.logo-topbar.is-active)도 같은 모양이다. */
.app-nav-link.active {
    color: var(--brand-emph);
    font-weight: 700;
    border-bottom-color: var(--hospital-blue);
}
.app-nav-more {
    display: flex;
}
.app-nav-more .dropdown-item.active {
    background: var(--theme-primary-bg-subtle);
    color: var(--brand-emph);
    font-weight: 600;
}
@media (max-width: 991.98px) {
    .app-nav {
        display: none;
    }
}

/* ▦ 전체 앱 격자 */
.app-grid-menu {
    width: 22rem;
    max-height: calc(100vh - var(--theme-topbar-height) - 1rem);
    overflow-y: auto;
    padding: 0.75rem;
}
.app-grid-group {
    padding: 0.25rem 0.25rem 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--theme-secondary-color);
}
.app-grid {
    display: grid;
    /* 한 줄 3칸 — 4칸이면 타일이 좁아 모서리의 준비중 꼬리표가 아이콘을 덮는다 */
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}
.app-grid-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.625rem 0.25rem;
    border-radius: 0.5rem;
    color: var(--theme-body-color);
    font-size: 0.8125rem;
    text-align: center;
    text-decoration: none;
}
.app-grid-item svg {
    width: 1.375rem;
    height: 1.375rem;
    color: var(--brand-emph);
}
.app-grid-item:hover,
.app-grid-item.active {
    background: var(--theme-primary-bg-subtle);
    color: var(--theme-body-color);
}
.app-grid-item.is-pending {
    cursor: default;
}
/* 흐리게 하는 것은 아이콘과 이름만 — 준비중 꼬리표는 또렷해야 읽힌다 */
.app-grid-item.is-pending > :not(.app-grid-soon) {
    opacity: 0.45;
}
.app-grid-item.is-pending:hover {
    background: none;
}
/*
 * 준비중 표시는 모서리 꼬리표로 둔다. 타일 안에 한 줄로 넣으면 그 타일만 높아져,
 * 같은 줄의 쓸 수 있는 타일 아래가 비어 보였다. 모든 타일이 아이콘 + 이름 두 줄로 같다.
 */
.app-grid-soon {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    padding: 0 0.3rem;
    border-radius: 4px;
    background: var(--sf-raised);
    color: var(--theme-secondary-color);
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1.5;
}
.app-grid-badge {
    position: absolute;
    top: 0.25rem;
    right: 0.5rem;
}

/* 사이드바 머리 — 지금 앱의 이름과 대표 동작 */
.sidenav-app {
    padding: 0.75rem 1rem 0.5rem;
}
.sidenav-app-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--theme-sidenav-item-hover-color);
    font-size: 1.0625rem;
    font-weight: 700;
}
.sidenav-app-title svg {
    width: 1.25rem;
    height: 1.25rem;
}
.sidenav-app-action {
    display: flex;
    align-items: center;
    justify-content: center;
}
html[data-sidenav-size="condensed"] .sidenav-app {
    display: none;
}

