/* 16단계(2026-09-30): 상단 카테고리 메뉴 + 좌측 즐겨찾기 + 카테고리 페이지 + 대시보드 개편 + 블로그 운영 */

/* ---- 틀: 위(상단 메뉴) / 아래(즐겨찾기 | 본문) ---- */
.app-shell.gnb-layout { flex-direction: column; min-height: 100vh; }
.app-body { flex: 1; display: flex; min-height: 0; }

/* ---- 상단 메뉴 ---- */
.gnb { position: sticky; top: 0; z-index: 50; background: var(--bg-raised); border-bottom: 1px solid var(--line); }
.gnb-bar { height: 64px; display: flex; align-items: center; gap: 20px; padding: 0 24px; }
.gnb-logo { flex: none; display: flex; align-items: center; width: 132px; }
.gnb-logo .brand-logo { width: 132px; height: auto; padding: 4px 6px; border-radius: 4px; background: #fff; }
.gnb-nav { flex: 1; display: flex; justify-content: center; gap: 4px; min-width: 0; }
.gnb-cat { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 64px; padding: 0 18px; font-size: 1rem; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
.gnb-cat:hover, .gnb-cat.active { color: var(--accent-ink); box-shadow: inset 0 -3px 0 var(--accent); }
.gnb-new { width: 6px; height: 6px; border-radius: 50%; background: #d4572a; }
.gnb-right { flex: none; display: flex; align-items: center; gap: 10px; }
.gnb-right .theme-toggle { margin: 0; padding: 2px; width: auto; }
.gnb-right .theme-toggle-btn { padding: 4px 6px; font-size: .75rem; }
.gnb-right .user-badge { display: flex; flex-direction: column; align-items: flex-end; text-decoration: none; color: var(--ink); line-height: 1.25; padding: 2px 4px; border-radius: 6px; }
.gnb-right .user-badge:hover { background: var(--bg-sunken); }
.gnb-right .user-name { font-weight: 600; font-size: .875rem; }
.gnb-right .user-dept { font-size: .72rem; color: var(--muted); }

/* 마우스를 올리면 펼쳐지는 하위 페이지 패널 */
.gnb-mega { position: absolute; left: 0; right: 0; top: 64px; padding: 10px 24px 0; }
.gnb-mega[hidden] { display: none; }
.mega-inner { display: flex; gap: 28px; padding: 22px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-overlay); max-width: 1320px; margin: 0 auto; }
.mega-hero { flex: none; width: 260px; min-height: 200px; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; padding: 26px 24px; border-radius: 18px 56px 18px 18px; background: var(--accent); color: var(--accent-on); }
.mega-hero-title { font-size: 1.75rem; font-weight: 700; letter-spacing: -.03em; }
.mega-hero-desc { font-size: .85rem; opacity: .9; line-height: 1.55; }
.mega-hero-link { margin-top: auto; align-self: flex-start; padding: 6px 14px; border: 1px solid currentColor; border-radius: 999px; color: inherit; text-decoration: none; font-size: .8rem; }
.mega-groups { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-content: start; }
.mega-group-title { padding: 11px 16px; border-radius: 10px; background: var(--bg-sunken); font-weight: 600; font-size: .9rem; }
.mega-list { list-style: none; margin: 6px 0 0; padding: 0 4px; }
.mega-item { display: flex; align-items: center; gap: 2px; }
.mega-item::before { content: ''; flex: none; width: 4px; height: 4px; border-radius: 50%; background: var(--muted); margin: 0 8px 0 6px; }
.mega-link { flex: 1; display: flex; align-items: center; gap: 6px; padding: 7px 0; color: var(--ink); text-decoration: none; font-size: .9rem; }
.mega-link:hover { color: var(--accent-ink); text-decoration: underline; }
.new-tag { font-size: .65rem; font-weight: 600; color: #a3401c; background: #fbe7de; border-radius: 999px; padding: 1px 7px; }

/* ---- 즐겨찾기(좌측) ---- */
.fav-rail { flex: none; width: 196px; box-sizing: border-box; padding: 18px 10px; border-right: 1px solid var(--line); background: var(--bg); position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.fav-head { display: flex; justify-content: space-between; padding: 0 10px 8px; font-size: .75rem; font-weight: 600; color: var(--muted); }
.fav-list { display: flex; flex-direction: column; gap: 2px; }
.fav-link { gap: 8px; }
.fav-empty { margin: 0; padding: 6px 10px; font-size: .78rem; line-height: 1.6; color: var(--muted); }
.main-content { position: relative; }
.notif-panel { top: 8px; }

/* ---- 별(즐겨찾기) ---- */
.star-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; vertical-align: middle; }
.star-btn:hover { background: var(--bg-sunken); }
.star-svg path { fill: none; stroke: var(--muted); }
.star-svg.on path { fill: #d69e2e; stroke: #b7791f; }
.fav-link .star-svg path { fill: #d69e2e; stroke: #b7791f; }
.page-header h2.has-star { display: inline-flex; align-items: center; gap: 6px; }
.title-star { width: 36px; height: 36px; }

/* ---- 카테고리 페이지 ---- */
.cat-page { display: flex; gap: 32px; align-items: flex-start; }
.cat-hero { flex: none; width: 320px; min-height: 380px; box-sizing: border-box; padding: 40px 32px; border-radius: 26px 90px 26px 26px; background: var(--accent); color: var(--accent-on); display: flex; flex-direction: column; gap: 10px; }
.cat-hero h2 { margin: 0; font-size: 2.4rem; font-weight: 700; }
.cat-hero p { margin: 0; opacity: .9; line-height: 1.6; }
.cat-hero-count { margin-top: auto; font-size: .82rem; opacity: .85; }
.cat-groups { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 26px; }
.cat-group h3 { margin: 0 0 12px; font-size: 1.05rem; }
.cat-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cat-card { display: flex; flex-direction: column; gap: 8px; min-height: 130px; padding: 18px 16px 16px 20px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 16px; }
.cat-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.cat-card-head { display: flex; align-items: center; gap: 6px; }
.cat-card-title { flex: 1; display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 1rem; color: var(--ink); text-decoration: none; }
.cat-card-desc { margin: 0; font-size: .85rem; color: var(--ink-soft); line-height: 1.55; }
.cat-card-go { margin-top: auto; font-size: .85rem; font-weight: 600; color: var(--accent-ink); text-decoration: none; }
.planned-box { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; max-width: 720px; }
.planned-box p { margin: 0; }

/* ---- 일정 ON/OFF 스위치 ---- */
.sched-toggle { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .875rem; font-weight: 550; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 44px; height: 24px; border-radius: 999px; background: var(--line-strong); transition: background-color .15s; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.switch input:disabled + .switch-track { opacity: .5; }
.sched-toggle-info { font-size: .8rem; color: var(--muted); }
.sched-toggle-info a { color: var(--accent-ink); }

/* ---- 날짜 변경 이력 ---- */
.date-log { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.date-log summary { cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--muted); }
.date-log ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.date-log li { font-size: .82rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 6px; }
.date-log .dl-change { font-weight: 600; color: var(--ink); }
.date-log .dl-meta { color: var(--muted); }

/* ---- 대시보드 ---- */
.dash16-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.dash16-head .dash16-date { font-size: .85rem; color: var(--muted); }
.dash16-head h2 { margin: 2px 0 0; font-size: 1.75rem; }
.dash16-actions { display: flex; gap: 8px; }
.dash16-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.dash16-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.dash16-tile:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.dash16-tile-label { font-size: .8rem; color: var(--ink-soft); }
.dash16-tile-num { font-size: 1.9rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.dash16-tile-num.warn { color: #c0431f; }
.dash16-row { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.dash16-card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; min-width: 0; }
.dash16-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.dash16-card-head h3 { margin: 0; font-size: 1.05rem; }
.dash16-card-head a { font-size: .8rem; color: var(--accent-ink); text-decoration: none; }
.dash16-list { list-style: none; margin: 0; padding: 0; }
.dash16-li { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 6px; }
.dash16-li:first-child { border-top: 0; }
.dash16-li:hover { background: var(--bg-sunken); }
.dash16-li-main { flex: 1; min-width: 0; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash16-li-sub { flex: none; font-size: .78rem; color: var(--muted); }
.dash16-li-when { flex: none; width: 74px; font-size: .8rem; font-weight: 600; color: var(--accent-ink); }
.dash16-li-late { color: #c0431f; font-weight: 600; }
.dash16-empty { padding: 18px 4px; font-size: .85rem; color: var(--muted); }
.dash16-more { margin-top: 8px; }

/* ---- 관리자: 메뉴·알림 설정 ---- */
.adm-menu-cat { margin-bottom: 18px; }
.adm-menu-cat h3 { margin: 0 0 8px; font-size: 1rem; }
.adm-menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.adm-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-raised); }
.adm-menu-item.is-off { opacity: .65; }
.ns-section { margin-bottom: 26px; }
.ns-section h3 { margin: 0 0 6px; font-size: 1.05rem; }
.ns-table td, .ns-table th { vertical-align: top; }
.ns-days { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.ns-days label, .ns-to label { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; white-space: nowrap; cursor: pointer; }
.ns-to { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ns-group-title { font-size: .78rem; font-weight: 600; color: var(--muted); padding-top: 12px; }
.ns-preview li { font-size: .85rem; }

/* ---- 블로그 운영 ---- */
.blog-status { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--bg-sunken); color: var(--ink-soft); white-space: nowrap; }
.blog-status.s-작성중 { background: #e9eef5; color: #2f4a6b; }
.blog-status.s-발행대기 { background: #fdf0d5; color: #7a4b00; }
.blog-status.s-발행완료 { background: #dff3e6; color: #1d5b33; }
.blog-status.s-성과입력완료 { background: #e8e2f6; color: #4b3587; }
:root[data-theme="dark"] .blog-status { filter: brightness(.9); }
.blog-flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 14px; font-size: .8rem; color: var(--muted); }
.blog-flow .on { color: var(--ink); font-weight: 600; }
.blog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.topic-cat { margin-bottom: 18px; }
.topic-cat > summary { cursor: pointer; font-weight: 600; font-size: 1rem; padding: 10px 4px; }
.topic-used td { color: var(--muted); }
.topic-used td:first-child::after { content: ' ✅'; }
.topic-hl { outline: 2px solid var(--accent); outline-offset: -2px; }
.visit-table input { width: 90px; text-align: right; }
.visit-table input.memo { width: 180px; text-align: left; }
.visit-total { font-weight: 600; }
.chart-card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 18px; }
.chart-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg text { fill: var(--muted); font-size: 11px; font-family: var(--font-ui); }
.chart-svg .grid { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis { stroke: var(--line-strong); }
.chart-svg .val { fill: var(--ink-soft); font-size: 10px; }
.chart-svg .goal-label { font-size: 11px; font-weight: 600; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--ink-soft); margin: 6px 0 2px; }
.chart-legend i { display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.blog-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.blog-cal-h { background: var(--bg-sunken); padding: 6px; font-size: .75rem; font-weight: 600; text-align: center; }
.blog-cal-d { background: var(--bg-raised); min-height: 96px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.blog-cal-d.out { opacity: .45; }
.blog-cal-n { font-size: .75rem; color: var(--muted); }
.blog-cal-item { font-size: .75rem; padding: 3px 6px; border-radius: 6px; background: var(--bg-sunken); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; text-align: left; color: var(--ink); }
.blog-cal-item:hover { background: var(--accent-soft); }

@media (max-width: 1180px) {
  .gnb-cat { padding: 0 11px; font-size: .92rem; }
  .gnb-right .theme-toggle, .gnb-right .user-dept { display: none; }
  .dash16-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .gnb-bar { height: auto; flex-wrap: wrap; padding: 8px 16px; gap: 8px; }
  .gnb-logo, .gnb-logo .brand-logo { width: 110px; }
  .gnb-right { margin-left: auto; }
  .gnb-nav { order: 3; flex-basis: 100%; justify-content: flex-start; overflow-x: auto; }
  .gnb-cat { height: 44px; padding: 0 12px; }
  .gnb-mega { display: none !important; }
  .app-body { flex-direction: column; }
  .fav-rail { position: static; width: 100%; height: auto; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .fav-list { flex-direction: row; overflow-x: auto; }
  .fav-link { flex: none; }
  .fav-head { display: none; }
  .cat-page { flex-direction: column; }
  .cat-hero { width: 100%; min-height: 0; border-radius: 22px 60px 22px 22px; padding: 28px 24px; }
  .cat-cards { grid-template-columns: 1fr; }
  .dash16-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash16-row { grid-template-columns: 1fr; }
  .mega-groups { grid-template-columns: 1fr; }
}

/* ---- 17단계: 자료 아카이브 · AI 지침·문서 자료함 ---- */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.lib-card { display: flex; flex-direction: column; gap: 8px; min-height: 170px; padding: 16px 18px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.lib-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.lib-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lib-card.is-archived { opacity: .6; }
.lib-card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lib-card-icon { font-size: 1.35rem; line-height: 1; margin-right: 2px; }
.lib-pin { margin-left: auto; }
.lib-card-title { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.4; }
.lib-card-title small { font-size: .75rem; color: var(--muted); font-weight: 500; }
.lib-card-sum { margin: 0; font-size: .84rem; color: var(--ink-soft); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lib-tags { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: .78rem; color: var(--accent-ink); }
.lib-card-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .76rem; color: var(--muted); padding-top: 8px; border-top: 1px solid var(--line); }
.lib-card-meta { margin-left: auto; }
.lib-tools { color: var(--ink-soft); }
.lib-status { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--bg-sunken); color: var(--ink-soft); white-space: nowrap; }
.lib-status.s-사용중 { background: #dff3e6; color: #1d5b33; }
.lib-status.s-초안 { background: #fdf0d5; color: #7a4b00; }
.lib-status.s-보관 { background: var(--bg-sunken); color: var(--muted); }
.lib-sec-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.lib-sec-head h3 { margin: 0; font-size: 1.05rem; }
.lib-sec-head .btn { margin-left: auto; }
.lib-drop { margin-bottom: 20px; transition: background-color .15s, border-color .15s; }
.lib-drop.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.lib-file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lib-file-list li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.lib-file-list li:first-child { border-top: 0; }
.lib-file-icon { font-size: 1.1rem; }
.lib-file-name { flex: 1 1 220px; min-width: 0; font-weight: 550; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-file-meta { font-size: .78rem; color: var(--muted); }
.lib-body { margin-bottom: 20px; }
.lib-body h3 { margin: 0 0 8px; font-size: 1.05rem; }
.lib-preview-img { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto; }
.lib-preview-pdf { width: 100%; height: 75vh; border: 0; }
.lib-comments { grid-template-columns: 1fr; }
:root[data-theme="dark"] .lib-status { filter: brightness(.9); }

/* 18단계: 포스팅 관리 표(노션 열 순서) - 가로로 넘치면 표만 스크롤 */
.table-scroll { overflow-x: auto; }
.blog-post-table { min-width: 1500px; }
/* 포스팅 관리 표: 모든 칸 같은 글꼴·한 줄, 길면 … 로 줄이고 마우스를 올리면 전체 (2026-10-02) */
.blog-post-table th, .blog-post-table td { white-space: nowrap; font-size: .84rem; font-weight: 400; line-height: 1.4; padding-top: 9px; padding-bottom: 9px; vertical-align: middle; }
.blog-post-table th { font-weight: 550; }
.blog-post-table td { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.blog-post-table td.bp-wide { max-width: 280px; }
.blog-post-table td > * { vertical-align: middle; }
.blog-flags { display: flex; flex-direction: row; gap: 18px; flex-wrap: wrap; }
