/* ========================================================================
   마신(Masin) 공통 상단 헤더 — app-header.js 디자인을 Blazor용으로 포팅
   ====================================================================== */
.mh-bar {
    background: linear-gradient(135deg, #2d2a26, #4a3f2a);
    border-bottom: 1px solid #d8cdb2;
    position: sticky; top: 0; z-index: 60;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    font-family: 'Pretendard', -apple-system, sans-serif;
}
.mh-bar.admin { background: linear-gradient(135deg, #1e1c19, #3d2118); }
.mh-inner {
    max-width: 1360px; margin: 0 auto;
    padding: 0 32px;
    height: 64px;
    display: flex; align-items: center; gap: 24px;
}
.mh-brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; text-decoration: none; }
.mh-brand .logo {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, #c08a2c, #7a5c1f);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff7e2; font-weight: 900; font-size: 0.88rem;
    letter-spacing: -0.02em;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.mh-brand h1 {
    margin: 0; font-size: 1.1rem; font-weight: 800;
    color: white; letter-spacing: -0.02em;
}
.mh-brand .role-tag {
    font-size: 9.5px; font-weight: 900;
    letter-spacing: 0.14em;
    padding: 3px 8px; border-radius: 5px;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.85);
    margin-left: 4px;
}
.mh-bar.admin .mh-brand .role-tag { background: #b13a2a; color: white; }

/* nav */
.mh-nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.mh-link, .mh-group > button {
    background: transparent; border: none; cursor: pointer;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem; font-weight: 700;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.15s;
    display: inline-flex; align-items: center; gap: 8px;
    white-space: nowrap;
}
.mh-link:hover, .mh-group > button:hover {
    color: white; background: rgba(255,255,255,0.08);
}
.mh-link.active, .mh-group.has-active > button {
    color: white; background: rgba(255,255,255,0.15);
}
.mh-group { position: relative; }
.mh-group > button .caret {
    font-size: 0.65rem; opacity: 0.7;
    transition: transform 0.18s;
}
.mh-group.open > button { color: white; background: rgba(255,255,255,0.15); }
.mh-group.open > button .caret { transform: rotate(180deg); }

/* dropdown panel */
.mh-dropdown {
    position: absolute; top: calc(100% + 8px); left: 0;
    min-width: 220px;
    background: white;
    border: 1px solid #d8cdb2;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(30, 22, 8, 0.18);
    padding: 8px;
    opacity: 0; visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.16s ease;
    z-index: 70;
}
.mh-group.open .mh-dropdown {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.mh-dropdown a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.88rem; font-weight: 700;
    color: #2b261d;
    transition: all 0.12s;
}
.mh-dropdown a:hover { background: #faf6ec; color: #4a3712; }
.mh-dropdown a.active { background: #fff7e2; color: #4a3712; }
.mh-dropdown a i {
    width: 16px;
    color: #c08a2c;
    font-size: 0.85rem;
    flex-shrink: 0;
    text-align: center;
}
.mh-dropdown a.active i { color: #7a5c1f; }

/* right side */
.mh-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* 포인트 잔액 칩 (유저 프로필 왼쪽) */
.mh-points {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(232,200,120,0.14);
    border: 1px solid rgba(232,200,120,0.35);
    color: #f0d99a;
    font-weight: 800; font-size: 0.85rem;
    padding: 7px 13px; border-radius: 8px;
    white-space: nowrap; font-variant-numeric: tabular-nums;
}
.mh-points i { color: #e8c878; font-size: 0.85rem; }
.mh-points small { font-size: 0.74rem; font-weight: 700; opacity: 0.8; margin-left: 1px; }

/* 서비스 데스크 아이콘 + 미확인 배지 */
.mh-sd {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 36px; border-radius: 8px;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
    color: #fff7e2; text-decoration: none; transition: all 0.15s; flex-shrink: 0;
}
.mh-sd:hover { background: rgba(255,255,255,0.18); }
.mh-sd i { font-size: 0.95rem; }
.mh-sd-badge {
    position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 999px; background: #b13a2a; color: #fff;
    font-size: 0.66rem; font-weight: 900; line-height: 17px; text-align: center;
    box-shadow: 0 0 0 2px #1e1c19; font-variant-numeric: tabular-nums;
}

/* 출석 위젯 (포인트 칩 왼쪽) */
.mh-att-wrap { position: relative; }
.mh-att-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
    color: #fff7e2; font-family: inherit; font-weight: 800; font-size: 0.82rem;
    padding: 7px 12px; border-radius: 8px; cursor: pointer; transition: all 0.15s;
    white-space: nowrap; position: relative;
}
.mh-att-btn:hover { background: rgba(255,255,255,0.18); }
.mh-att-btn.done { color: rgba(255,255,255,0.65); }
.mh-att-btn .mh-att-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #e8c878;
    box-shadow: 0 0 0 0 rgba(232,200,120,0.6); animation: mh-att-pulse 1.6s infinite;
}
@keyframes mh-att-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(232,200,120,0.5); } 50% { box-shadow: 0 0 0 5px rgba(232,200,120,0); } }
.mh-att-pop {
    position: absolute; top: calc(100% + 10px); right: 0; min-width: 260px;
    background: white; border: 1px solid #d8cdb2; border-radius: 12px;
    box-shadow: 0 16px 40px rgba(30, 22, 8, 0.22); padding: 14px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: all 0.16s ease; z-index: 80;
}
.mh-att-wrap.open .mh-att-pop { opacity: 1; visibility: visible; transform: translateY(0); }
.mh-att-pop-head { margin-bottom: 10px; }
.mh-att-pop-head .t1 { font-size: 0.96rem; font-weight: 900; color: #2b261d; }
.mh-att-pop-head .t2 { font-size: 0.78rem; font-weight: 600; color: #7a7060; margin-top: 2px; }
.mh-att-pop-head .t2 b { color: #b13a2a; font-weight: 900; }
.mh-att-checkin {
    width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 14px; border: none; border-radius: 10px;
    background: linear-gradient(135deg, #c08a2c, #7a5c1f); color: white;
    font-family: inherit; font-size: 0.9rem; font-weight: 900; cursor: pointer; transition: all 0.15s;
}
.mh-att-checkin:hover:not(:disabled) { filter: brightness(1.06); }
.mh-att-checkin:disabled { background: #ece4cf; color: #7a5c1f; cursor: default; }
.mh-att-msg { margin-top: 8px; font-size: 0.82rem; font-weight: 800; color: #2f7a3d; text-align: center; }
.mh-att-more {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0ebde;
    font-size: 0.8rem; font-weight: 800; color: #7a5c1f; text-decoration: none;
}
.mh-att-more:hover { color: #4a3712; }

/* 관리자 화면 전환 토글 (유저 프로필 오른쪽, 관리자 전용) */
.mh-admin-toggle {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(177,58,42,0.18);
    border: 1px solid rgba(177,58,42,0.45);
    color: #f0b8ae;
    font-family: inherit; font-weight: 800; font-size: 0.82rem;
    padding: 7px 13px; border-radius: 8px;
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.mh-admin-toggle:hover { background: rgba(177,58,42,0.32); color: #fff; }
.mh-admin-toggle.on { background: #b13a2a; color: #fff; border-color: #b13a2a; }
.mh-menu-wrap { position: relative; }
.mh-user-pop {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 240px;
    background: white;
    border: 1px solid #d8cdb2;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(30, 22, 8, 0.22);
    padding: 6px;
    opacity: 0; visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.16s ease;
    z-index: 80;
}
.mh-menu-wrap.open .mh-user-pop {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.mh-pop-head {
    padding: 10px 12px 12px;
    border-bottom: 1px solid #f0ebde;
    margin-bottom: 4px;
    font-size: 0.78rem; font-weight: 800;
    color: #7a7060;
    letter-spacing: 0.08em; text-transform: uppercase;
}
.mh-pop-head-name {
    font-size: 0.96rem; font-weight: 900;
    color: #2b261d;
    letter-spacing: -0.01em;
    text-transform: none;
    margin-bottom: 2px;
}
.mh-pop-head-role {
    font-size: 0.74rem; font-weight: 700;
    color: #c08a2c;
    letter-spacing: 0.08em;
}
.mh-pop-item {
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    padding: 9px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.88rem; font-weight: 700;
    color: #2b261d;
    cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    transition: all 0.12s;
    text-decoration: none;
}
.mh-pop-item:hover { background: #faf6ec; color: #4a3712; }
.mh-pop-item i {
    width: 16px;
    color: #c08a2c;
    font-size: 0.9rem;
    flex-shrink: 0;
    text-align: center;
}
.mh-pop-item.admin i { color: #b13a2a; }
.mh-pop-item.admin:hover { background: #fbeeec; }
.mh-pop-item.danger { color: #b13a2a; }
.mh-pop-item.danger i { color: #b13a2a; }
.mh-pop-item.danger:hover { background: #fbeeec; }
.mh-pop-sep { height: 1px; background: #f0ebde; margin: 6px 4px; }

.mh-login {
    background: #c08a2c; color: #2b1f08;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem; font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex; align-items: center; gap: 6px;
}
.mh-login:hover { background: #e8c878; }

.mh-user-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    padding: 7px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem; font-weight: 700;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: all 0.15s;
}
.mh-user-btn:hover { background: rgba(255,255,255,0.18); }
.mh-user-btn .avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e8c878, #c08a2c);
    display: flex; align-items: center; justify-content: center;
    color: #2b1f08; font-size: 0.7rem; font-weight: 900;
}
.mh-user-btn .caret { font-size: 0.6rem; opacity: 0.7; transition: transform 0.18s; }
.mh-menu-wrap.open .mh-user-btn .caret { transform: rotate(180deg); }

/* 외부 클릭 닫기용 투명 백드롭 */
.mh-backdrop { position: fixed; inset: 0; z-index: 55; background: transparent; }

/* mobile */
.mh-burger {
    display: none;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    width: 36px; height: 36px;
    border-radius: 8px;
    align-items: center; justify-content: center;
    cursor: pointer;
}
@media (max-width: 980px) {
    .mh-inner { gap: 12px; padding: 0 20px; }
    .mh-burger { display: inline-flex; }
    /* 좁은 화면: 포인트 칩의 P 표기와 관리자 토글 텍스트는 숨기고 아이콘 위주로 */
    .mh-admin-toggle span { display: none; }
    .mh-user-btn .mh-user-name { display: none; }
    .mh-att-btn span { display: none; }
    .mh-nav {
        position: absolute; top: 64px; left: 0; right: 0;
        flex-direction: column; align-items: stretch;
        background: #2d2a26;
        padding: 8px;
        border-top: 1px solid rgba(255,255,255,0.08);
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        transform: translateY(-8px);
        opacity: 0; visibility: hidden;
        transition: all 0.18s;
    }
    .mh-bar.menu-open .mh-nav {
        transform: translateY(0); opacity: 1; visibility: visible;
    }
    .mh-bar.admin .mh-nav { background: #1e1c19; }
    .mh-dropdown {
        position: static;
        box-shadow: none;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.08);
        margin-top: 4px;
        opacity: 0; visibility: hidden;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        transform: none;
        transition: max-height 0.2s, opacity 0.15s, padding 0.15s;
    }
    .mh-group.open .mh-dropdown {
        max-height: 600px; padding: 6px; opacity: 1; visibility: visible;
    }
    .mh-dropdown a { color: rgba(255,255,255,0.85); }
    .mh-dropdown a:hover { background: rgba(255,255,255,0.08); color: white; }
    .mh-dropdown a.active { background: rgba(192,138,44,0.25); color: white; }
}
