/* =====================================================================
   조효식 허브 PRO · 공통 스타일 (common.css)
   - 모든 페이지가 함께 쓰는 화면 조각의 모양을 한곳에서 관리합니다.
   - 페이지마다 다른 부분은 각 페이지의 <style>에서 덮어씁니다.
     (common.css를 먼저 불러오고, 페이지 <style>을 뒤에 두면 페이지 쪽이 이깁니다)
   - 순서: 1 색 · 2 상단바 · 3 홈으로 버튼 · 4 창(모달) · 5 프로필 그림·펼침 메뉴 · 6 알림(토스트)
   ===================================================================== */

/* ─────────────────────────────────────────
   1. 색 (칠판 테마)
   ───────────────────────────────────────── */
:root {
    --board: #123D30;        /* 칠판 */
    --board-light: #1B5442;  /* 칠판 밝은 부분 */
    --chalk: #EAF1EC;        /* 분필 */
    --chalk-dim: #A9C2B6;    /* 흐린 분필 */
    --marker: #F4C430;       /* 출석부 노랑 */
    --ink: #17231D;          /* 본문 글자 */
    --paper: #F2F5F3;        /* 바탕 */
    --line: #D5DFD9;         /* 테두리 */
    --muted: #5B6B63;        /* 흐린 글자 */
    --wood: #8A5A36;         /* 분필 받침대 */
    --chalk-font: 'Nanum Pen Script', 'Pretendard', cursive;
}

/* ─────────────────────────────────────────
   2. 상단바 (HUB.renderHeader가 그림)
      <header class="top hub-top wrap-1500"> 처럼
      wrap-숫자 = 화면이 그보다 좁으면 메뉴바가 아래 줄로 내려감
   ───────────────────────────────────────── */
header.hub-top { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 20px; padding: 10px 40px; min-height: 66px; }
.nav-wrap { flex: 1; display: flex; justify-content: center; min-width: 0; }
.nav-pill { display: flex; align-items: center; gap: 4px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 999px; padding: 5px; }
.nav-item { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid transparent; color: #475569; font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background .2s, color .2s; }
.nav-item svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-item:hover { background: #fff; color: #1e293b; }
.nav-item.active { background: #fff; color: var(--board-light); font-weight: 700; border-color: #cbd5e1; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* 하위 메뉴가 있는 메뉴 (예: 인사ㆍ복무) — 오른쪽에 아래 방향 삼각형(▼), 펼치면 위 방향(▲)
   펼쳐지는 메뉴판(.hub-dd)의 모양은 common.js가 함께 넣어 줌 */
.nav-group { background: none; font-family: inherit; cursor: pointer; }
.nav-group .nav-caret { display: inline-block; width: 0; height: 0; margin: 0 1px 0 8px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 7px solid currentColor; font-size: 0; vertical-align: middle; transition: transform .2s; }
.nav-group[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }

/* 상단바 왼쪽 '홈으로' (apps·mypage 모양) */
.home-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 999px; background: var(--board-light); color: #fff; font-weight: 800; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background .2s; }
.home-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.home-btn:hover { background: var(--board); }

/* 화면이 좁을 때: 메뉴바를 아래 줄로 (페이지마다 기준 폭이 다름) */
@media (max-width: 1500px) {
    header.hub-top.wrap-1500 { flex-wrap: wrap; }
    header.hub-top.wrap-1500 .nav-wrap { order: 3; flex-basis: 100%; }
    header.hub-top.wrap-1500 .hub-right { margin-left: auto; }
}
@media (max-width: 1300px) {
    header.hub-top.wrap-1300 { flex-wrap: wrap; }
    header.hub-top.wrap-1300 .nav-wrap { order: 3; flex-basis: 100%; }
    header.hub-top.wrap-1300 .hub-right { margin-left: auto; }
}
@media (max-width: 1140px) {
    header.hub-top.wrap-1140 { flex-wrap: wrap; }
    header.hub-top.wrap-1140 .nav-wrap { order: 3; flex-basis: 100%; }
    header.hub-top.wrap-1140 .hub-right { margin-left: auto; }
}
@media (max-width: 860px) {
    header.hub-top { padding: 10px 16px; }
    header.hub-top .nav-pill { flex-wrap: wrap; justify-content: center; border-radius: 18px; }
}

/* ─────────────────────────────────────────
   3. 홈으로 버튼 (labor·budget·Per_diem·mulpum·geunmu·facility 모양)
      HUB.mountHomeButton()이 그림
   ───────────────────────────────────────── */
#hubHomeBtn{display:inline-flex !important;align-items:center;gap:7px;padding:9px 16px;border-radius:999px;background:#1B5442 !important;color:#fff !important;font-family:'Pretendard',-apple-system,'Malgun Gothic',sans-serif;font-weight:800;font-size:14px;line-height:1.2;text-decoration:none !important;white-space:nowrap;border:1.5px solid rgba(255,255,255,.25);flex-shrink:0;transition:background .2s;cursor:pointer}
#hubHomeBtn svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;display:block}
#hubHomeBtn:hover{background:#123D30 !important}
#hubHomeBtn:focus-visible{outline:3px solid #F4C430;outline-offset:2px}
.hub-home-wrap{display:flex;align-items:center;gap:16px;min-width:0}

/* ─────────────────────────────────────────
   4. 창(모달): 로그인·회원관리·수정 창 등
   ───────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(14,50,39,.55); z-index: 1000; justify-content: center; align-items: center; backdrop-filter: blur(4px); }
.modal-content { background: #fff; padding: 28px; border-radius: 14px; width: 340px; box-shadow: 0 24px 48px rgba(0,0,0,.25); border-top: 6px solid var(--board-light); }
.modal-content h3 { margin: 0 0 18px; font-size: 21px; color: var(--ink); text-align: center; }
.modal-content input { width: 100%; padding: 12px; margin-bottom: 10px; border: 1.5px solid var(--line); border-radius: 8px; font-family: 'Pretendard', sans-serif; }
.modal-content input:focus { border-color: var(--board-light); outline: none; }
.auth-toggle { text-align: center; font-size: 13px; margin-top: 14px; }
.auth-toggle a { color: var(--board-light); text-decoration: none; font-weight: 700; cursor: pointer; }
.auth-toggle a:hover { text-decoration: underline; }

/* ─────────────────────────────────────────
   5. 프로필 그림 · 닉네임 펼침 메뉴
   ───────────────────────────────────────── */
.av { display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; color: #fff; font-weight: 800; flex-shrink: 0; background: var(--board-light); line-height: 1; }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.sm { width: 30px; height: 30px; font-size: 16px; }
.av.md { width: 72px; height: 72px; font-size: 36px; }
.av.lg { width: 116px; height: 116px; font-size: 58px; box-shadow: 0 0 0 5px #fff, 0 0 0 6px var(--line); }
.um-wrap { position: relative; }
.um-btn { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px 4px 4px; font-family: inherit; font-size: 14px; font-weight: 800; color: var(--ink); cursor: pointer; }
.um-btn:hover { border-color: var(--board-light); }
.um-btn .caret { font-size: 11px; color: #5B6B63; }
.um-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 36px rgba(0,0,0,.14); padding: 6px; z-index: 300; }
.um-menu[hidden] { display: none; }
.um-menu a, .um-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: none; background: none; border-radius: 8px; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; cursor: pointer; text-align: left; }
.um-menu a:hover, .um-menu button:hover { background: var(--paper); }
.um-menu .here { background: #E3EEE8; color: var(--board-light); }
.um-sec { font-size: 11.5px; font-weight: 800; color: #5B6B63; padding: 8px 12px 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.um-menu .logout { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; color: #64748b; }

/* ─────────────────────────────────────────
   6. 알림(토스트): HUB.toast('메시지')
   ───────────────────────────────────────── */
.hub-toast{position:fixed;left:50%;bottom:30px;transform:translateX(-50%);background:#1f2937;color:#fff;padding:12px 20px;
    border-radius:10px;font-size:13.5px;z-index:60;box-shadow:0 8px 24px rgba(0,0,0,.25);display:none;max-width:90vw}
.hub-toast.show{display:block}
