:root {
  /* ── app shell (흰색 + 남색 살짝) ── */
  --new-bg-app:  #f0f2f6;
  --new-bg-main: #f0f2f6;

  /* ── sidebar (연한 남색빛 — 검정 글씨 가능) ── */
  --new-bg-sidebar:        #e0e4ed;
  --new-bg-sidebar-hover:  rgba(0, 0, 0, 0.06);
  --new-bg-sidebar-active: rgba(0, 0, 0, 0.10);
  --new-sidebar-text:        #2a3444;
  --new-sidebar-text-active: #111820;
  --new-sidebar-icon:        #4a5a6e;
  --new-sidebar-icon-active: #1a2433;
  --new-sidebar-accent: #1a2433;

  /* ── panel / content (거의 흰색 + 남색 한끗) ── */
  --new-bg-panel:      #ffffff;
  --new-bg-panel-head: #f4f5f9;

  /* ── borders ── */
  --new-border-soft:   rgba(0, 0, 0, 0.07);
  --new-border-strong: rgba(0, 0, 0, 0.13);

  /* ── text (검정 가독성 확보) ── */
  --new-text-main: #1a1a1a;
  --new-text-sub:  #5c6b7f;

  /* ── misc (블루그레이) ── */
  --new-line-view: #cdd5e0;
  --new-hover:    rgba(43, 58, 82, 0.04);
  --new-selected: rgba(43, 58, 82, 0.08);

  /* ── base token overrides ── */
  --text-main:    #1f1f1f;
  --text-subtle:  #5f6368;
  --text-muted:   #80868b;
  --surface-base:   #ffffff;
  --surface-subtle: #f8f9fa;
  --surface-muted:  #f1f3f4;
  --border-main:   #dadce0;
  --border-soft:   var(--new-border-soft);
  --border-strong: var(--new-border-strong);
  --interactive-hover-bg:      #f1f3f4;
  --interactive-hover-border:  #dadce0;
  --interactive-active-bg:     #e8eaed;
  --interactive-active-border: #c4c7cc;
  --interactive-selected-bg:   rgba(43, 58, 82, 0.07);
  --interactive-shadow-focus:  0 0 0 2px rgba(43, 58, 82, 0.15);
  --radius-ui: 4px;
  --list-badge-radius: 3px;
  --font-size-main: 12px;
  --font-size-sub: 11px;
  --font-size-title: 12px;
  --letter-spacing-base: -0.03em;
  --panel-head-height: 40px;
  --panel-gap: 8px;
  --panel-body-pad: 16px;
  --list-row-min-h: 40px;

  /* form */
  --form-focus-border: #2b3a52;
  --form-focus-shadow: 0 0 0 2px rgba(43, 58, 82, 0.18);
  --form-view-bg:     #f8f9fa;
  --form-view-border: transparent;
}

body[data-page] { background: var(--new-bg-app); overflow-x: hidden; }

/* ── 커스텀 체크박스 (전역) ── */
input[type="checkbox"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  outline: none !important;
  box-shadow: none !important;
  width: 14px !important;
  height: 14px !important;
  min-width: 14px;
  min-height: 14px;
  max-width: 14px;
  max-height: 14px;
  padding: 0 !important;
  margin: 0;
  border: 1.5px solid #9ca3af;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  vertical-align: middle;
}
input[type="checkbox"]:checked {
  background: #2b3a52;
  border-color: #2b3a52;
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0.5px;
  width: 5px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
input[type="checkbox"]:focus-visible {
  box-shadow: 0 0 0 2px rgba(27, 42, 74, 0.15) !important;
}

/* ── 이미지 드래그 방지 ── */
body[data-page] img {
  -webkit-user-drag: none;
}

.dashboard-shell--new {
  --sidebar-width: 200px;
  background: var(--new-bg-app);
  --panel-border: var(--new-border-soft);
  grid-template-columns: auto minmax(0, 1fr);
}

/* ═══════════════════════════════
   SIDEBAR (Gemini-Light)
═══════════════════════════════ */

.dashboard-shell--new .sidebar {
  background: var(--new-bg-sidebar);
  border-right: none;
  color: var(--new-sidebar-text);
  width: var(--sidebar-width);
  overflow: hidden;
  transition: width 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 6px rgba(43, 58, 82, 0.15);
  z-index: 10;
}

/* ── 헤드 (상단 토글) ── */

.dashboard-shell--new .sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 4px 6px 4px 12px;
  flex: 0 0 auto;
  border-bottom: none;
}
.dashboard-shell--new .sidebar.sidebar-collapsed .sidebar-head {
  padding: 4px 0;
  justify-content: center;
}
.dashboard-shell--new .sidebar.sidebar-collapsed .sidebar-toggle-btn {
  margin: 0 auto;
}

.sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: var(--height-md);
  height: var(--height-md);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--new-sidebar-icon);
  cursor: pointer;
  padding: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--new-sidebar-text-active);
}

.sidebar-toggle-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle-label {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-strong);
  color: var(--new-sidebar-text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  opacity: 1;
  transition: opacity var(--transition-normal), width var(--transition-normal);
  overflow: hidden;
}

/* ── 메뉴 ── */

.dashboard-shell--new .sidebar-menu {
  padding: var(--space-1) var(--space-2) var(--space-4);
  gap: 0;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ── 그룹 ── */

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: 0 var(--space-1);
}

.sidebar-group + .sidebar-group {
  margin-top: var(--space-8);
}

.sidebar-bottom {
  flex: 0 0 auto;
  padding: var(--space-2) var(--space-3) var(--space-4);
}

/* ── 링크 ── */

.dashboard-shell--new .sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--height-md);
  padding: 0 var(--space-3) 0 var(--space-3);
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--new-sidebar-text);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-strong);
  letter-spacing: -0.03em;
  transition: background-color var(--transition-fast), color var(--transition-fast);
  gap: var(--space-3);
}

.dashboard-shell--new .sidebar-link-label {
  flex: 1 1 auto;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 1;
  transition: opacity var(--transition-normal);
}

.dashboard-shell--new .sidebar-link-icon {
  color: var(--new-sidebar-icon);
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  transition: color var(--transition-fast);
}

.dashboard-shell--new .sidebar-link-svg {
  width: 20px;
  height: 20px;
}

.dashboard-shell--new .sidebar-link:hover {
  background: var(--new-bg-sidebar-hover);
  color: var(--new-sidebar-text-active);
}

.dashboard-shell--new .sidebar-link:hover .sidebar-link-icon {
  color: var(--new-sidebar-icon-active);
}

/* ── Active ── */

.dashboard-shell--new .sidebar-link.active {
  background: var(--new-bg-sidebar-active);
  color: var(--new-sidebar-text-active);
  font-weight: 500;
}

.dashboard-shell--new .sidebar-link.active .sidebar-link-icon {
  color: var(--new-sidebar-text-active);
}

/* ── 채팅 배지 ── */

.sidebar-nav-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: #dc2626;
  color: #fff;
  font-size: var(--font-size-xs);
  font-weight: 600;
  flex: 0 0 auto;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.3);
  font-variant-numeric: tabular-nums;
  transition: transform var(--transition-fast);
}
.sidebar-nav-badge[hidden] { display: none !important; }
.sidebar-nav-badge:hover { transform: scale(1.08); }

/* ───── MAIN CONTENT ───── */

.dashboard-shell--new .main-shell {
  background: var(--new-bg-main);
  padding: var(--space-1) var(--space-3) var(--space-3);
  gap: var(--space-2);
  min-width: 0;
}

.page-tab {
  display: contents;
}

.page-tab[style*="display: none"] {
  display: none !important;
}

.dashboard-shell--new .page-header {
  min-height: var(--height-md);
}

.dashboard-shell--new .page-title {
  font-size: var(--font-size-main);
  font-weight: var(--font-weight-strong);
  letter-spacing: -0.02em;
  color: var(--new-text-main);
}

/* ───── TYPOGRAPHY ───── */

.dashboard-shell--new .page-title,
.dashboard-shell--new .panel-head-title,
.dashboard-shell--new .section-title,
.dashboard-shell--new .setting-row strong,
.dashboard-shell--new .home-summary-card__value,
.dashboard-shell--new .home-progress-row__title,
.dashboard-shell--new .home-notice-title { color: var(--new-text-main); }

.dashboard-shell--new .panel-head-subtitle,
.dashboard-shell--new .message,
.dashboard-shell--new .empty-block,
.dashboard-shell--new .setting-row span,
.dashboard-shell--new .home-heading-subtitle,
.dashboard-shell--new .home-inline-meta,
.dashboard-shell--new .home-notice-date,
.dashboard-shell--new .home-notice-writer,
.dashboard-shell--new .home-summary-card__label,
.dashboard-shell--new .home-summary-card__note,
.dashboard-shell--new .home-progress-row__count,
.dashboard-shell--new .home-progress-row__date { color: var(--new-text-sub); }

/* ═══════════════════════════════
   PANEL
═══════════════════════════════ */

.dashboard-shell--new .panel {
  border: none;
  border-radius: var(--radius-ui);
  background: var(--new-bg-panel);
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.12), 0 4px 8px 3px rgba(60, 64, 67, 0.08);
}

.dashboard-shell--new .panel-head {
  background: var(--new-bg-panel-head);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-ui) var(--radius-ui) 0 0;
  padding: 0 var(--panel-head-px);
  min-height: var(--panel-head-height);
}

/* 패널헤드 텍스트: base.css --panel-head-font 참조 */
.dashboard-shell--new .panel-head-title {
  font-size: var(--panel-head-font);
  font-weight: var(--font-weight-strong);
  color: var(--new-text-main);
  letter-spacing: -0.03em;
}

.dashboard-shell--new .panel-head-subtitle {
  font-size: var(--panel-head-font);
  color: var(--new-text-sub);
}

.dashboard-shell--new .panel-body {
  background: #ffffff;
  border-radius: 0 0 var(--radius-ui) var(--radius-ui);
}

/* filter-overlay는 패널 안에 겹치므로 그림자 없앰 */
.dashboard-shell--new .filter-overlay.panel {
  box-shadow: none;
  border-radius: var(--radius-ui);
  border: none;
  background: #ffffff;
}

/* ═══════════════════════════════
   SIDEBAR COLLAPSE
═══════════════════════════════ */

/* toggle-btn은 위 SIDEBAR 섹션에서 정의됨 */

/* 접힌 상태 — 아이콘 고정, 텍스트만 접힘 */

.dashboard-shell--new .sidebar.sidebar-collapsed {
  width: 68px;
}

/* 접힘 시 아이콘 x좌표 고정 — padding 유지, 텍스트만 사라짐 */

.dashboard-shell--new .sidebar.sidebar-collapsed .sidebar-toggle-label {
  display: none;
}

.dashboard-shell--new .sidebar.sidebar-collapsed .sidebar-toggle-icon {
  transform: rotate(180deg);
}

.dashboard-shell--new .sidebar.sidebar-collapsed .sidebar-link-label {
  opacity: 0;
  width: 0;
  flex: 0 0 0;
  overflow: hidden;
}

.dashboard-shell--new .sidebar.sidebar-collapsed .sidebar-nav-badge {
  opacity: 0;
  width: 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

/* 축소 모드: 알림이 있으면 아이콘 우측 상단에 빨간 점 */
.dashboard-shell--new .sidebar.sidebar-collapsed .sidebar-link.has-new-event .sidebar-link-icon::after {
  content: '';
  position: absolute;
  top: -1px;
  right: -3px;
  width: 8px;
  height: 8px;
  background: #dc2626;
  border-radius: var(--radius-circle);
  border: 1.5px solid var(--new-bg-sidebar, #fff);
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.3);
}

.dashboard-shell--new .sidebar-link-icon {
  position: relative;
}

/* ── icon-only panel buttons ── */
.btn-icon-only {
  min-width: var(--btn-height);
  width: var(--btn-height);
  padding: 0;
}

.panel-head-badges {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}
.panel-head-badges:empty { display: none; }

.panel-head-actions .inline-button.btn-icon-only {
  background: transparent;
  border-color: transparent;
  color: #2a2f38;
  border-radius: 6px;
}

.panel-head-actions .inline-button.btn-icon-only:hover {
  background: var(--interactive-hover-bg, #f1f3f4);
  border-color: transparent;
  color: #111419;
}

.panel-head-actions .inline-button.btn-icon-only.btn-danger {
  color: #2a2f38;
}

.panel-head-actions .inline-button.btn-icon-only.btn-danger:hover {
  background: #fce8e6;
  color: #d93025;
}

/* ═══════════════════════════════
   FACETED FILTER BAR (공통)
═══════════════════════════════ */

.facet-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px 0;
  padding: 6px var(--space-3);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(0, 0, 0, 0.015);
}
.facet-filter-bar[hidden] { display: none; }

.facet-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  padding: 2px 10px 2px 0;
}

.facet-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  padding-right: 2px;
}

.facet-chips {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.facet-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 20px;
  padding: 0 7px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-pill);
  background: transparent;
  font-size: var(--font-size-sm);
  color: var(--text-subtle, #5f6368);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.08s, border-color 0.08s;
}
.facet-chip:hover {
  background: var(--interactive-hover-bg, #f1f3f4);
  border-color: rgba(0, 0, 0, 0.18);
}
.facet-chip.is-active {
  background: rgba(27, 42, 74, 0.1);
  border-color: rgba(27, 42, 74, 0.25);
  color: #333;
  font-weight: 600;
}

.facet-count {
  font-size: var(--font-size-xs);
  color: inherit;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}
.facet-chip.is-active .facet-count { opacity: 0.75; }

.facet-reset {
  height: 20px;
  padding: 0 var(--space-2);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: var(--font-size-xs);
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  margin-left: auto;
  align-self: flex-start;
  margin-top: 2px;
}
.facet-reset:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}
