/* 2026-12 개편 1단계: 상단 탭 → 왼쪽 메뉴(PC) / 아래 탭(휴대폰). 시안 D01·M01·M02. */
#app-screen { padding: 0; max-width: none; margin: 0; }

#side {
  position: fixed; left: 0; top: 0; bottom: 0; width: 232px; z-index: 8;
  display: flex; flex-direction: column; background: #1b1e26; color: #c9ccd4;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; font-size: 14px; font-weight: 700; color: #fff; }
.side-brand img { width: 30px; height: 30px; border-radius: 7px; display: block; }

#side .tabs {
  flex: 1; min-height: 0; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 2px;
  margin: 0; padding: 0 12px 12px; border: 0; overflow-y: auto; scrollbar-width: thin;
}
.nav-group { padding: 12px 12px 4px; font-size: 11px; font-weight: 700; color: #8b909c; }
#side .tab-btn {
  display: flex; align-items: center; justify-content: space-between; width: 100%; flex-shrink: 0;
  text-align: left; background: transparent; border: 0; border-radius: 8px; margin: 0;
  padding: 8px 12px; font-size: 13.5px; font-weight: 500; color: #c9ccd4; cursor: pointer;
}
#side .tab-btn:hover { background: rgba(255,255,255,0.07); color: #fff; }
#side .tab-btn.active { background: var(--accent); color: #fff; font-weight: 700; }

.side-foot { padding: 12px 24px 16px; font-size: 12px; line-height: 1.9; color: #9aa0ac; }
.side-foot #who-label { display: block; font-size: 13px; font-weight: 700; color: #fff; }
.side-foot button { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; }
.side-foot button:hover { color: #fff; text-decoration: underline; }

#main { margin-left: 232px; padding: 22px 28px 40px; max-width: 1500px; }
#page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
#page-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
#page-head.hidden { display: none; }

#bottom-nav { display: none; }
#side-close { display: none; }

@media (max-width: 899px) {
  #main { margin-left: 0; padding: 0 12px 88px; }
  #page-head {
    position: sticky; top: 0; z-index: 5; margin: 0 -12px 12px; padding: 14px 16px;
    background: var(--panel); border-bottom: 1px solid var(--border);
  }
  #page-head h2 { font-size: 17px; }
  #page-head.hidden { display: none; }
  #main:has(#page-head.hidden) { padding-top: 12px; }

  /* 메뉴 화면(아래 탭의 "메뉴"·"관리"): 왼쪽 메뉴를 전체 화면 목록으로 보여준다 */
  #side { display: none; }
  #side.open { display: block; right: 0; bottom: 64px; width: auto; overflow-y: auto; background: var(--bg); color: var(--text); }
  #side.open .side-brand { background: var(--panel); border-bottom: 1px solid var(--border); color: var(--text); padding: 12px 16px; }
  #side.open .tabs { display: flex; overflow: visible; padding: 0 14px 12px; gap: 0; }
  #side.open .nav-group { padding: 14px 2px 6px; color: var(--text-dim); }
  #side.open .tab-btn {
    min-height: 44px; background: var(--panel); color: var(--text); border-radius: 0;
    border: 1px solid var(--border); border-top-width: 0; font-size: 14px;
  }
  /* app.js 가 보이는 항목에 style="display:inline-block" 을 직접 넣으므로, 그 경우에도 목록 줄(화살표 오른쪽 끝) 모양을 유지한다 */
  #side.open .tab-btn[style*="inline-block"] { display: flex !important; }
  #side.open .tab-btn::after { content: '›'; color: var(--text-faint); font-size: 18px; }
  #side.open .nav-group + .tab-btn, #side.open .tab-btn.first { border-top-width: 1px; border-radius: 12px 12px 0 0; }
  #side.open .tab-btn.last { border-radius: 0 0 12px 12px; }
  #side.open .tab-btn.first.last { border-radius: 12px; }
  #side.open .tab-btn.active { background: var(--accent-dim); color: var(--accent); }
  #side.open[data-filter="admin"] [data-group="content"] { display: none !important; }
  #side.open .side-foot {
    margin: 4px 14px 20px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--border);
    border-radius: 12px; color: var(--text-dim); font-size: 13px; line-height: 2.6;
  }
  #side.open .side-foot #who-label { color: var(--text); font-size: 15px; }
  #side.open .side-foot button:hover { color: var(--accent); }
  #side.open[data-filter="admin"] .side-foot { display: none; }

  #bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 64px; z-index: 9;
    background: var(--panel); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
  }
  #bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
    background: none; border: 0; padding: 0; font-size: 12px; font-weight: 700; color: var(--text-dim); cursor: pointer;
  }
  #bottom-nav button::before { content: ''; width: 20px; height: 4px; border-radius: 4px; background: var(--border); }
  #bottom-nav button.on { color: var(--accent); }
  #bottom-nav button.on::before { background: var(--accent); }
}
