/*
  좌측 사이드바 + 앱 셸 (ChatGPT/Cursor 스타일 파일 접근)
  - .app-sidebar: 좌측 고정 칼럼(--sidebar-w)
  - .app-main: 사이드바 폭만큼 우측으로 밀린 메인 영역
*/

.app-shell {
  min-height: 100vh;
}

/* ===== 사이드바 ===== */
.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background-color: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 60;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--foreground);
}

.sidebar-brand:hover {
  text-decoration: none;
}

.sidebar-new-form {
  display: contents;
}

button.sidebar-new {
  background: none;
  cursor: pointer;
}

.sidebar-new {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--foreground);
  border: 2px solid #000;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  white-space: nowrap;
}

.sidebar-new:hover {
  text-decoration: none;
  background-color: var(--background);
}

/* ===== 보드 목록 ===== */
.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-cell {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 8px;
}

.sidebar-cell:hover {
  background-color: var(--background);
}

.sidebar-cell.active {
  background-color: #ececef;
}

.sidebar-cell-link {
  flex: 1;
  min-width: 0;
  padding: 0.5rem;
  font-size: 0.875rem;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-cell-link:hover {
  text-decoration: none;
}

.sidebar-cell.active .sidebar-cell-link {
  font-weight: 600;
}

/* 셀 메뉴 (native details) */
.sidebar-cell-menu {
  position: relative;
}

.sidebar-cell-more {
  list-style: none;
  cursor: pointer;
  padding: 0 0.5rem;
  color: var(--muted);
  opacity: 0;
  font-size: 1rem;
  line-height: 1;
  user-select: none;
}

.sidebar-cell-more::-webkit-details-marker {
  display: none;
}

.sidebar-cell:hover .sidebar-cell-more,
.sidebar-cell-menu[open] .sidebar-cell-more {
  opacity: 1;
}

.sidebar-menu-pop {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 120px;
  background-color: #fff;
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-menu-pop form {
  margin: 0;
}

.sidebar-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.5rem;
  font-size: 0.8125rem;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: var(--foreground);
  cursor: pointer;
  font-family: inherit;
}

.sidebar-menu-item:hover {
  background-color: var(--background);
  text-decoration: none;
}

.sidebar-menu-item.danger {
  color: var(--danger);
}

.sidebar-empty {
  color: var(--muted);
  font-size: 0.8125rem;
  padding: 0.75rem;
}

/* ===== 푸터 ===== */
.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-user {
  font-size: 0.75rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-foot-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-settings-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.sidebar-settings-btn:hover {
  color: var(--foreground);
  background-color: var(--background);
  text-decoration: none;
}

/* ===== 메인 영역 ===== */
.app-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

.app-main-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.empty-state {
  text-align: center;
  color: var(--muted);
}

.empty-state h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

.empty-state p {
  margin: 0 0 1.25rem;
}
