/* ============================================================
   admin.css — 관리자 전역 변수 + 레이아웃 + 컴포넌트 + 서브 페이지
   (style.css + main.css + sub.css 통합)
   규칙: 선언은 반드시 한 항목당 한 줄. 인라인 style="" 절대 금지.
   ============================================================ */

/* ── CSS 변수 ─────────────────────────────────────────────── */
:root {
  --bg:             #ffffff;
  --panel:          #f5f6f8;
  --surface:        #ffffff;
  --surface-2:      #fafbfc;
  --border:         #ececef;
  --border-strong:  #e2e3e7;
  --ink:            #111114;
  --ink-2:          #2a2a2f;
  --muted:          #6b7280;
  --muted-2:        #9aa0a6;
  --grid:           #f1f2f4;
  --chart-bar-1:    #111114;
  --chart-bar-2:    #dadce0;
  --accent:         #111114;
  --accent-soft:    #f1f2f4;
  --success:        #15803d;
  --success-soft:   #e8f6ee;
  --warn:           #4b5159;
  --warn-soft:      #eef0f3;
  --danger:         #dc2626;
  --danger-soft:    #fdecec;
  --violet:         #2a2a2f;
  --violet-soft:    #eef0f3;
  --teal:           #4b5159;
  --teal-soft:      #eef0f3;
  --sidebar-w:      248px;
  --header-h:       66px;
  --panel-radius:   20px;
  --radius:         12px;
  --radius-sm:      8px;
  --shadow-sm:      0 1px 2px rgba(17,17,20,.04);
  --shadow-md:      0 4px 16px rgba(17,17,20,.06);
  --font:           "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --hero-bg:           #f5f6f8;
  --hero-overlay:      linear-gradient(180deg, rgba(245,246,248,.72), rgba(245,246,248,.84));
  --hero-photo:        url('/assets/images/login-hero.png');
  --hero-photo-filter: saturate(0.55) brightness(1.08) contrast(0.95);
  --accent-ink:        #ffffff;
  --field-bg:          var(--surface);
  --field-bd:          var(--border-strong);
  --field-bd-hover:    #cdd1d6;
}

/* ── 다크 테마 ────────────────────────────────────────────── */
html[data-theme="dark"] {
  --bg:             #0e0f12;
  --panel:          #16181c;
  --surface:        #1b1d22;
  --surface-2:      #20232a;
  --border:         #2a2d34;
  --border-strong:  #353841;
  --ink:            #f3f4f6;
  --ink-2:          #e5e7eb;
  --muted:          #9aa1ad;
  --muted-2:        #6b7280;
  --grid:           #24272e;
  --chart-bar-1:    #f3f4f6;
  --chart-bar-2:    #3a3d45;
  --accent-soft:    #2a2d34;
  --success-soft:   #143524;
  --warn-soft:      #2a2d34;
  --danger-soft:    #3a1a1a;
  --violet-soft:    #2a2d34;
  --teal-soft:      #2a2d34;
  --shadow-sm:      0 1px 2px rgba(0,0,0,.4);
  --shadow-md:      0 4px 16px rgba(0,0,0,.45);
  --hero-bg:           #0a0b0d;
  --hero-overlay:      linear-gradient(180deg, rgba(10,11,13,.72), rgba(10,11,13,.86));
  --hero-photo-filter: saturate(0.5) brightness(0.55) contrast(1);
  --accent-ink:        #0e0f12;
  --field-bg:          var(--surface);
  --field-bd:          var(--border);
  --field-bd-hover:    #3a3d45;
}

html[data-theme="dark"] body {
  background: var(--bg);
  color: var(--ink);
}
html[data-theme="dark"] .sidebar { background: var(--bg); }
html[data-theme="dark"] .brand-mark {
  background: #f3f4f6;
  color: #0e0f12;
}
html[data-theme="dark"] .nav-item.active {
  background: #f3f4f6;
  color: #0e0f12;
}
html[data-theme="dark"] .nav-item.active .ic { color: #0e0f12; }
html[data-theme="dark"] .nav-item.active .badge-soft {
  background: #0e0f12;
  color: #f3f4f6;
}
html[data-theme="dark"] .panel { background: var(--panel); }
html[data-theme="dark"] .card-soft {
  background: var(--surface);
  border-color: var(--border);
}
html[data-theme="dark"] .kpi-card {
  background: var(--surface);
  border-color: var(--border);
}
html[data-theme="dark"] table.adm thead th {
  background: var(--surface-2);
  color: var(--muted);
}
html[data-theme="dark"] table.adm tbody td { border-bottom-color: var(--border); }
html[data-theme="dark"] table.adm tbody tr:hover { background: var(--surface-2); }
html[data-theme="dark"] .btn-dark-pill {
  background: #f3f4f6;
  color: #0e0f12;
  border-color: #f3f4f6;
}
html[data-theme="dark"] .btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}
html[data-theme="dark"] .btn-ghost:hover { background: var(--surface-2); }
html[data-theme="dark"] .pill-filter {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
}
html[data-theme="dark"] .seg {
  background: var(--surface-2);
  border-color: var(--border);
}
html[data-theme="dark"] .seg button.on {
  background: var(--surface);
  color: var(--ink);
}
html[data-theme="dark"] .search .form-control {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--ink);
}
html[data-theme="dark"] .search .form-control:focus { background: var(--surface); }
html[data-theme="dark"] .search .kbd {
  background: var(--surface);
  border-color: var(--border);
  color: var(--muted);
}
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--ink);
}
html[data-theme="dark"] .tag {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--border);
}
html[data-theme="dark"] .ch-bar .tr { background: var(--surface-2); }
html[data-theme="dark"] .ch-bar .fl { background: linear-gradient(90deg, #f3f4f6, #a1a4ab); }
html[data-theme="dark"] .toggle-side:hover,
html[data-theme="dark"] .icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
html[data-theme="dark"] .form-switch .form-check-input {
  background-color: #3a3d45;
  border-color: #3a3d45;
}
html[data-theme="dark"] .form-switch .form-check-input:checked {
  background-color: #f3f4f6;
  border-color: #f3f4f6;
}
html[data-theme="dark"] hr { border-color: var(--border) !important; }
html[data-theme="dark"] .pagination .page-link {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
}
html[data-theme="dark"] .pagination .page-item.active .page-link {
  background: #f3f4f6;
  color: #0e0f12;
  border-color: #f3f4f6;
}
html[data-theme="dark"] .pagination .page-item.disabled .page-link {
  background: var(--surface);
  color: var(--muted-2);
}
html[data-theme="dark"] .avatar-square {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--ink-2);
}

/* ── 다크: 접힌 사이드바 ─────────────────────────────────── */
html[data-theme="dark"] .app.collapsed .nav-item .ic {
  background: var(--surface-2);
  color: var(--ink-2);
}
html[data-theme="dark"] .app.collapsed .nav-item:hover .ic { background: #2f323a; }
html[data-theme="dark"] .app.collapsed .nav-item.active { background: transparent; }
html[data-theme="dark"] .app.collapsed .nav-item.active .ic {
  background: #f3f4f6;
  color: #0e0f12;
}

/* ── 기본 ─────────────────────────────────────────────────── */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html,
body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  letter-spacing: -0.01em;
}
a {
  color: inherit;
  text-decoration: none;
}
::selection {
  background: #111;
  color: #fff;
}

/* ── 레이아웃 ─────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 10px 10px 0;
}

.panel {
  background: var(--panel);
  border-radius: var(--panel-radius);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: calc(100vh - 20px);
}

/* ── 사이드바 ─────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  height: var(--header-h);
  cursor: pointer;
  transition: opacity .15s ease;
}
.brand:hover { opacity: .7; }

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #111114;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  flex: 0 0 auto;
}

.brand-name {
  font-weight: 700;
  font-size: 16px;
}
.brand-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: -2px;
}

.search { padding: 12px 14px 6px; }

.search .form-control {
  background: var(--surface-2);
  border: 1px solid var(--border);
  height: 38px;
  font-size: 14px;
  padding-left: 34px;
  border-radius: 8px;
}
.search .form-control:focus {
  border-color: #cdd1d6;
  box-shadow: none;
  background: #fff;
}
.search .wrap { position: relative; }
.search .wrap i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  font-size: 14px;
}
.search .kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  line-height: 1;
}

.nav-section {
  padding: 6px 10px;
  overflow-y: auto;
  flex: 1;
}
.nav-section::-webkit-scrollbar { width: 6px; }
.nav-section::-webkit-scrollbar-thumb {
  background: #e4e5e9;
  border-radius: 10px;
}

.nav-label {
  padding: 14px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 500;
  margin-bottom: 2px;
  cursor: pointer;
  user-select: none;
  transition: background .12s ease, color .12s ease;
}
.nav-item .ic {
  width: 18px;
  display: inline-flex;
  justify-content: center;
  font-size: 16px;
  color: var(--muted);
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active {
  background: #111114;
  color: #fff;
}
.nav-item.active .ic { color: #fff; }
.nav-item .badge-soft {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #111114;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.nav-item.active .badge-soft {
  background: #fff;
  color: #111;
}

.nav-sub {
  margin-left: 26px;
  padding-left: 4px;
  border-left: 1px dashed var(--border-strong);
}
.nav-sub .nav-item {
  padding: 8px 11px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}
.nav-sub .nav-item:hover {
  color: var(--ink-2);
  background: transparent;
}
.nav-sub .nav-item.active {
  background: transparent;
  color: var(--ink);
  font-weight: 600;
}
.nav-sub .nav-item.active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #111;
  margin-right: -2px;
}

.nav-bottom {
  padding: 6px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-bottom .b-item {
  padding: 8px 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  border-radius: 6px;
}
.nav-bottom .b-item:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.side-footer {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border);
}
.side-footer .who { min-width: 0; }
.side-footer .name {
  font-size: 14px;
  font-weight: 600;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dfe3ea, #c6ccd4);
  color: #3b3f47;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  flex: 0 0 auto;
}

.avatar-square {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 17px;
  flex: 0 0 auto;
}

/* ── 사이드바 접힘 (데스크톱) ─────────────────────────────── */
.app.collapsed { grid-template-columns: 80px 1fr; }
.app.collapsed .sidebar { width: 80px; }
.app.collapsed .brand {
  justify-content: center;
  padding: 12px 0;
}
.app.collapsed .brand > div:not(.brand-mark) { display: none; }
.app.collapsed .search,
.app.collapsed .nav-label,
.app.collapsed .nav-sub,
.app.collapsed .nav-bottom,
.app.collapsed .nav-item .badge-soft,
.app.collapsed .side-footer .who,
.app.collapsed .side-footer .icon-btn { display: none; }
.app.collapsed .nav-section { padding: 8px 8px; }
.app.collapsed .nav-item {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 4px 9px;
  font-size: 11px;
  text-align: center;
  line-height: 1.25;
  font-weight: 500;
  color: var(--muted-2);
  background: transparent;
  border-radius: 12px;
}
.app.collapsed .nav-item .ic {
  width: 36px;
  height: 36px;
  font-size: 15px;
  background: #f1f2f4;
  color: var(--ink-2);
  border-radius: 10px;
  display: grid;
  place-items: center;
  transition: background .12s ease, color .12s ease;
}
.app.collapsed .nav-item:hover {
  background: transparent;
  color: var(--ink-2);
}
.app.collapsed .nav-item:hover .ic { background: #e6e7eb; }
.app.collapsed .nav-item.active {
  background: transparent;
  color: var(--ink);
}
.app.collapsed .nav-item.active .ic {
  background: #111114;
  color: #fff;
}
.app.collapsed .side-footer {
  justify-content: center;
  padding: 12px 0;
}

/* ── 상단 크럼바 ──────────────────────────────────────────── */
.crumb-bar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 8px;
  flex-shrink: 0;
}
.crumb-bar .crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.crumb-bar .crumbs .sep {
  color: var(--muted-2);
  font-size: 12px;
}
.crumb-bar .crumbs .cur {
  color: var(--ink);
  font-weight: 600;
  font-size: 13.5px;
}
.crumb-bar .actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.crumb-bar .icon-btn {
  width: 30px;
  height: 30px;
}
.crumb-bar .icon-btn i { font-size: 14px; }

.toggle-side {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.toggle-side:hover {
  background: rgba(0,0,0,.04);
  color: var(--ink);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  color: var(--ink-2);
  background: transparent;
  position: relative;
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--border);
}
.icon-btn .dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid #fff;
}

/* ── 헤더 크럼바 대시보드 링크 ────────────────────────────── */
.btn-crumb-dash {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
}

/* ── 페이지 콘텐츠 ────────────────────────────────────────── */
.content {
  padding: 28px 36px 36px;
  flex: 1;
  overflow-y: auto;
}
.content::-webkit-scrollbar { width: 8px; }
.content::-webkit-scrollbar-thumb {
  background: #e2e3e7;
  border-radius: 10px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
}
.page-sub {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0;
}

/* ── 버튼 ─────────────────────────────────────────────────── */
.btn-dark-pill,
.btn-ghost {
  height: 38px;
  padding: 0 14px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  line-height: 1;
  box-sizing: border-box;
  white-space: nowrap;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn-dark-pill {
  background: #111114;
  color: #fff;
  border: 1px solid #111114;
}
.btn-dark-pill:hover {
  background: #000;
  color: #fff;
}
.btn-ghost {
  background: #fff;
  color: var(--ink-2);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--surface-2); }

/* ── 카드 ─────────────────────────────────────────────────── */
.card-soft {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-soft .ch {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-soft .ch h6 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card-soft .ch .sub {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-soft .cb { padding: 20px 22px; }

/* ── KPI 카드 ─────────────────────────────────────────────── */
.kpi {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, 1fr);
}
.kpi-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 140px;
  position: relative;
  overflow: hidden;
}
.kpi-card .label {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kpi-card .ic-pill {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 16px;
  background: var(--accent-soft);
  color: var(--ink);
}
.kpi-card .val {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-top: 2px;
}
.kpi-card .val .unit {
  font-size: 15px;
  color: var(--muted);
  font-weight: 600;
  margin-left: 3px;
}
.kpi-card .delta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.delta .up {
  color: var(--success);
  font-weight: 700;
}
.delta .down {
  color: var(--danger);
  font-weight: 700;
}
.kpi-card .spark {
  position: absolute;
  right: 14px;
  bottom: 14px;
  opacity: .85;
}

/* ── 그리드 레이아웃 ──────────────────────────────────────── */
.grid-2 {
  display: grid;
  gap: 18px;
  grid-template-columns: 2fr 1fr;
}
.grid-3 {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, 1fr);
}

/* ── 테이블 ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.adm {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
table.adm thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  text-align: left;
}
table.adm tbody td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.adm tbody tr:last-child td { border-bottom: none; }
table.adm tbody tr:hover { background: #fafbfc; }

/* ── 태그 / 배지 ──────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--border);
}
.tag.success {
  background: var(--success-soft);
  color: var(--success);
  border-color: transparent;
}
.tag.warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}
.tag.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}
.tag.accent {
  background: #111114;
  color: #fff;
  border-color: transparent;
}
.tag.violet {
  background: var(--violet-soft);
  color: var(--ink);
  border-color: transparent;
}
.tag.dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}
.user-cell .avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}
.user-cell .name {
  font-weight: 600;
  font-size: 14px;
}
.user-cell .em {
  color: var(--muted);
  font-size: 12.5px;
}

/* ── 차트 래퍼 ────────────────────────────────────────────── */
.chart-h {
  height: 280px;
  position: relative;
}
.chart-h-sm {
  height: 220px;
  position: relative;
}
.chart-h-xs {
  height: 60px;
  position: relative;
}
.legend {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.legend .li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend .sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #111;
}

/* ── 실시간 활동 리스트 ───────────────────────────────────── */
.activity { display: flex; flex-direction: column; }
.activity .row-i {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.activity .row-i:last-child { border-bottom: none; }
.activity .ic {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex: 0 0 auto;
}
.activity .who { font-size: 14px; }
.activity .who b { font-weight: 600; }
.activity .when {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}

/* ── 세그먼트 / 필터 버튼 ────────────────────────────────── */
.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.seg button.on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.pill-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 600;
  cursor: pointer;
}
.pill-filter i { color: var(--muted); }

/* ── 진행 바 ──────────────────────────────────────────────── */
.ch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.ch-bar:last-child { margin-bottom: 0; }
.ch-bar .lbl {
  width: 96px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.ch-bar .tr {
  flex: 1;
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.ch-bar .fl {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: #111114;
  border-radius: 999px;
}
.ch-bar.alt  .fl { background: #2a2a2f; }
.ch-bar.alt2 .fl { background: #4b5159; }
.ch-bar.alt3 .fl { background: #8e939c; }
.ch-bar .val {
  width: 58px;
  text-align: right;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

/* ── 페이지 표시 ──────────────────────────────────────────── */
.page { display: none; }
.page.show { display: block; }

/* ── 설정 행 ──────────────────────────────────────────────── */
.set-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.set-row:last-child { border-bottom: none; }
.set-row .meta { flex: 1; }
.set-row .meta h6 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
}
.set-row .meta p {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.form-switch .form-check-input {
  background-color: #d6d8dd;
  border-color: #d6d8dd;
  width: 36px;
  height: 20px;
}
.form-switch .form-check-input:checked {
  background-color: #111114;
  border-color: #111114;
}
.form-switch .form-check-input:focus { box-shadow: none; }

/* ── 빈 상태 ──────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 42px 12px;
  color: var(--muted);
}
.empty i {
  font-size: 28px;
  color: var(--muted-2);
}

/* ── 모달 ─────────────────────────────────────────────────── */
.modal-bd {
  position: fixed;
  inset: 0;
  background: rgba(15,17,21,.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  backdrop-filter: blur(2px);
}
.modal-bd.show { display: flex; }

.modal-card {
  background: var(--surface);
  border-radius: 18px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,.28);
  border: 1px solid var(--border);
}
.modal-card.wide { max-width: 960px; }

.modal-h {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-h h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.015em;
}
.modal-h .close-btn {
  margin-left: auto;
  background: transparent;
  border: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.modal-h .close-btn:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.modal-b {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-f {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ── 폼 그룹 ──────────────────────────────────────────────── */
.fg { margin-bottom: 16px; }
.fg label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.fg .form-control,
.fg .form-select {
  height: 40px;
  font-size: 14px;
  border-radius: 8px;
  border-color: var(--border-strong);
}
.fg textarea.form-control {
  height: auto;
  min-height: 110px;
  resize: vertical;
}
.fg .form-control:focus,
.fg .form-select:focus {
  border-color: var(--ink);
  box-shadow: none;
}
.fg-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.fg .hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
}

/* ── 설정 모달 ────────────────────────────────────────────── */
.modal-settings .modal-b {
  padding: 0;
  overflow: hidden;
}
.modal-settings .ms-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: calc(88vh - 61px);
  min-height: 540px;
}
.modal-settings .ms-rail {
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  overflow-y: auto;
}
.modal-settings .ms-rail .ms-group {
  font-size: 11.5px;
  color: var(--muted-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 10px 6px;
}
.modal-settings .ms-rail .ms-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 2px;
}
.modal-settings .ms-rail .ms-item i {
  font-size: 14px;
  color: var(--muted);
  width: 16px;
  text-align: center;
}
.modal-settings .ms-rail .ms-item:hover { background: var(--surface-2); }
.modal-settings .ms-rail .ms-item.active {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
}
.modal-settings .ms-rail .ms-item.active i { color: var(--ink); }
.modal-settings .ms-rail .ms-profile {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}
.modal-settings .ms-rail .ms-profile:hover { background: var(--surface-2); }
.modal-settings .ms-rail .ms-profile .avatar-square {
  width: 38px;
  height: 38px;
  font-size: 18px;
}
.modal-settings .ms-rail .ms-profile .pn {
  font-size: 14.5px;
  font-weight: 700;
}
.modal-settings .ms-rail .ms-profile .ps {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.modal-settings .ms-detail {
  padding: 28px 32px;
  overflow-y: auto;
}
.modal-settings .ms-section-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 22px 0 10px;
}
.modal-settings .ms-section-label:first-child { margin-top: 0; }
.modal-settings .ms-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.modal-settings .ms-row:last-child { border-bottom: none; }
.modal-settings .ms-row .ms-meta { flex: 1; }
.modal-settings .ms-row .ms-meta h6 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
}
.modal-settings .ms-row .ms-meta p {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.modal-settings .ms-row .chev { color: var(--muted-2); }
.modal-settings .ms-callout {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.55;
  margin: 8px 0 18px;
}
.modal-settings .ms-callout b {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}
.modal-settings .ms-callout span { color: var(--muted); }

/* ── 모바일 스크림 ────────────────────────────────────────── */
.scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,12,16,.35);
  z-index: 30;
}

/* ── 게시글 본문 (서브 페이지) ─────────────────────────────── */
.board-body {
  line-height: 1.85;
  font-size: 15px;
}
.board-body img {
  max-width: 100%;
  border-radius: var(--radius);
}

/* ── 이전/다음 탐색 행 ─────────────────────────────────────── */
.board-nav-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.board-nav-item:last-child { border-bottom: none; }
.board-nav-item .nav-label {
  font-size: 12px;
  color: var(--muted);
  min-width: 48px;
  flex-shrink: 0;
}
.board-nav-item a {
  color: var(--ink);
  text-decoration: none;
}
.board-nav-item a:hover { color: var(--accent); }

/* ── 게시판 분류 배지 ──────────────────────────────────────── */
.board-cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
}
.board-cat.cat-b {
  background: var(--accent-soft);
  color: var(--accent);
}
.board-cat.cat-g {
  background: var(--success-soft);
  color: var(--success);
}

/* ── 첨부파일 목록 ─────────────────────────────────────────── */
.attach-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.attach-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.attach-list li:last-child { border-bottom: none; }
.attach-list li i { color: var(--muted); }
.attach-list li a {
  color: var(--ink);
  text-decoration: none;
}
.attach-list li a:hover { color: var(--accent); }

/* ── 갤러리 그리드 ─────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.gallery-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: box-shadow 0.15s;
}
.gallery-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.gallery-card .thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.gallery-card .thumb .placeholder {
  width: 100%;
  height: 100%;
  min-height: unset;
  border-radius: 0;
  border: none;
}
.gallery-card .thumb a {
  display: block;
  width: 100%;
  height: 100%;
}
.gallery-card .meta { padding: 10px 12px; }
.gallery-card .meta .title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-card .meta .info {
  font-size: 12px;
  color: var(--muted);
}

/* ── 플레이스홀더 ──────────────────────────────────────────── */
.placeholder {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  min-height: 120px;
}

/* ── 반응형 ───────────────────────────────────────────────── */
@media (max-width: 992px) {
  .kpi { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .content { padding: 24px 28px 28px; }
  .crumb-bar { padding: 0 22px; }
}

@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 72%;
    max-width: 280px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 40;
    border-right: 1px solid var(--border);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
  }
  .scrim.show {
    display: block;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .main { padding: 0; }
  .panel {
    min-height: 100vh;
    border-radius: 0;
    background: var(--bg);
  }
  .crumb-bar {
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 5;
  }
  .crumb-bar .crumbs .cur {
    font-size: 16px;
    font-weight: 700;
  }
  .toggle-side {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border-color: var(--border);
    background: var(--surface);
    color: var(--ink-2);
    font-size: 18px;
  }
  .toggle-side i { font-size: 18px; }
  .content { padding: 18px 16px 24px; }
  .kpi {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .grid-3 { grid-template-columns: 1fr; }
  .page-head .actions { width: 100%; }
  .crumbs .sep,
  .crumbs .root { display: none; }
  .kpi-card .val { font-size: 24px; }
  .modal-card {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  .modal-settings .ms-body { grid-template-columns: 1fr; }
  .modal-settings .ms-rail {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 480px) {
  .kpi { grid-template-columns: 1fr; }
}

/* ── 로그인 페이지 ─────────────────────────────────────────── */
.login-page button { font-family: inherit; }

.login-theme-toggle {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 20;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.login-theme-toggle:hover { background: var(--surface-2); }
.login-theme-toggle i { font-size: 13px; }

.login-stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
}

.login-hero {
  position: relative;
  background: var(--hero-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 56px;
  border-right: 1px solid var(--border);
  isolation: isolate;
}
.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--hero-photo);
  background-size: cover;
  background-position: center;
  filter: var(--hero-photo-filter);
  z-index: -2;
}
.login-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
  z-index: -1;
}

.login-hero-copy {
  max-width: 520px;
  color: var(--ink);
}
.login-hero-eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.login-hero-title {
  font-size: clamp(34px, 2.8vw, 46px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.03em;
  margin: 12px 0 18px;
  text-wrap: balance;
}
.login-hero-lede {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 28px;
  max-width: 460px;
}
.login-hero-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 10px 28px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
}
.login-hero-features li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-tick {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: 9px;
  flex-shrink: 0;
}

.login-auth {
  display: grid;
  place-items: center;
  padding: 64px 56px;
  position: relative;
}
.login-auth-inner {
  width: 100%;
  max-width: 360px;
}
.login-auth h1 {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  text-wrap: balance;
}
.login-auth-lede {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 32px;
}

.login-form-group { margin-bottom: 10px; }
.login-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}
.login-field {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  background: var(--field-bg);
  border: 1px solid var(--field-bd);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.login-field::placeholder { color: var(--muted-2); }
.login-field:hover { border-color: var(--field-bd-hover); }
.login-field:focus { border-color: var(--ink); }

.login-btn-primary {
  width: 100%;
  height: 48px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity .15s ease, transform .05s ease;
}
.login-btn-primary:hover { opacity: .9; }
.login-btn-primary:active { transform: translateY(1px); }
.login-btn-primary:disabled { opacity: .7; cursor: wait; }

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 4px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--ink-2);
}
.login-remember input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.login-remember-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--field-bd);
  background: var(--field-bg);
  display: grid;
  place-items: center;
  transition: background .12s ease, border-color .12s ease;
}
.login-remember-box i {
  font-size: 9px;
  color: var(--accent-ink);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .12s ease, transform .12s ease;
}
.login-remember:hover .login-remember-box { border-color: var(--field-bd-hover); }
.login-remember input:checked + .login-remember-box {
  background: var(--accent);
  border-color: var(--accent);
}
.login-remember input:checked + .login-remember-box i {
  opacity: 1;
  transform: scale(1);
}
.login-remember input:focus-visible + .login-remember-box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: var(--muted);
  font-size: 12px;
}
.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  background: var(--border);
}

.login-socials {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.login-soc {
  height: 52px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  font-size: 18px;
}
.login-soc:hover {
  background: var(--surface);
  border-color: var(--border-strong);
}
.login-soc-google i {
  background: conic-gradient(from -45deg, var(--danger), var(--warn), var(--success), var(--ink-2), var(--danger));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900;
}
.login-soc-apple i { color: var(--ink); }
.login-soc-naver::after {
  content: "N";
  font-weight: 800;
  color: var(--success);
  font-size: 18px;
  letter-spacing: -0.04em;
}
.login-soc-kakao { position: relative; }
.login-soc-kakao::after {
  content: "";
  width: 22px;
  height: 20px;
  background: var(--warn-soft);
  -webkit-mask: radial-gradient(ellipse at 50% 40%, var(--ink) 60%, transparent 62%);
  mask: radial-gradient(ellipse at 50% 40%, var(--ink) 60%, transparent 62%);
  border-radius: 6px;
}
.login-soc-kakao::before {
  content: "K";
  position: absolute;
  color: var(--ink);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: -0.04em;
  z-index: 2;
}

.login-terms {
  margin-top: 26px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}
.login-terms i {
  color: var(--ink);
  margin-top: 3px;
  font-size: 11px;
}
.login-terms u {
  text-decoration: underline;
  text-underline-offset: 2px;
  color: var(--ink-2);
}

.login-footer-links {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 11.5px;
  color: var(--muted-2);
}

html[data-theme="dark"] .login-theme-toggle:hover { background: var(--surface-2); }
html[data-theme="dark"] .login-btn-primary {
  background: var(--ink);
  color: var(--accent-ink);
  border-color: var(--ink);
}
html[data-theme="dark"] .login-tick {
  background: var(--ink);
  color: var(--accent-ink);
}
html[data-theme="dark"] .login-remember input:checked + .login-remember-box {
  background: var(--ink);
  border-color: var(--ink);
}

@media (max-width: 960px) {
  .login-stage { grid-template-columns: 1fr; }
  .login-hero {
    min-height: 360px;
    padding: 36px 24px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .login-auth { padding: 40px 24px 80px; }
  .login-hero-features { grid-template-columns: repeat(2, 1fr); }
}
