﻿  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

  :root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --surface2: #f5f5f7;
    --surface3: #e8e8ed;
    --border: rgba(0,0,0,0.14);
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #aeaeb2;
    --accent: #0071e3;
    --accent-light: #e8f2fd;
    --accent-hover: #0077ed;
    --green: #34c759;
    --green-light: #e8f9ed;
    --red: #ff3b30;
    --red-light: #fff0ef;
    --orange: #ff9500;
    --orange-light: #fff5e6;
    --purple: #af52de;
    --purple-light: #f5eafd;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
    --sidebar-w: 240px;
    --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
  }

  /* ════════════════════════════════════════
     DARK MODE — 전체 컴포넌트 대응
  ════════════════════════════════════════ */
  body.dark {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface2: #2c2c2e;
    --surface3: #3a3a3c;
    --border: rgba(255,255,255,0.12);
    --text-primary: #f5f5f7;
    --text-secondary: #aeaeb2;
    --text-tertiary: #636366;
    --accent: #0a84ff;
    --accent-light: rgba(10,132,255,0.15);
    --accent-hover: #1a8fff;
    --green: #30d158;
    --green-light: rgba(48,209,88,0.12);
    --red: #ff453a;
    --red-light: rgba(255,69,58,0.12);
    --orange: #ff9f0a;
    --orange-light: rgba(255,159,10,0.12);
    --purple: #bf5af2;
    --purple-light: rgba(191,90,242,0.12);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  }

  /* ── 기본 카드·레이아웃 ── */
  body.dark .card          { background: var(--surface); border-color: var(--border); }
  body.dark .stat-card     { background: var(--surface); border-color: var(--border); }
  body.dark .table-container { background: var(--surface); border-color: var(--border); }

  /* ── 사이드바 ── */
  body.dark .sidebar       { background: #111113; border-color: var(--border); }
  body.dark .nav-item:hover { background: var(--surface2); box-shadow: none; transform: none; color: var(--text-primary); }
  body.dark .nav-item.active { background: var(--accent-light); color: var(--accent); }

  /* ── 상단 바 ── */
  body.dark .topbar        { background: rgba(17,17,19,0.95); border-color: var(--border); }
  body.dark .topbar-search input { background: var(--surface2); color: var(--text-primary); border-color: var(--border); }
  body.dark .topbar-search input:focus { background: var(--surface3); border-color: var(--accent); }

  /* ── 버튼 ── */
  body.dark .btn-secondary { background: var(--surface2); border-color: var(--border); color: var(--text-primary); }
  body.dark .btn-secondary:hover { background: var(--surface3); }
  body.dark .btn-icon      { background: var(--surface2); border-color: var(--border); }
  body.dark .btn-icon:hover { background: var(--surface3); }
  body.dark .btn-danger    { background: rgba(255,69,58,0.15); color: var(--red); border-color: rgba(255,69,58,0.2); }
  body.dark .btn-danger:hover { background: var(--red); color: white; }
  body.dark .btn-ghost:hover { background: var(--accent-light); }

  /* ── 폼 입력 ── */
  body.dark .form-input    { background: var(--surface2); color: var(--text-primary); border-color: var(--border); }
  body.dark .form-input:focus { background: var(--surface3); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10,132,255,0.15); }
  body.dark select.form-input { color-scheme: dark; }
  /* 클래스 없는 inline input/textarea 도 다크모드 적용 */
  body.dark input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]),
  body.dark textarea,
  body.dark select {
    background: var(--surface2);
    color: var(--text-primary);
    color-scheme: dark;
  }
  body.dark .modal-overlay { background: rgba(0,0,0,0.7); }
  body.dark .modal-box     { background: var(--surface); }

  /* ── 모달 ── */
  body.dark .modal         { background: var(--surface); border: 1px solid var(--border); }
  body.dark .modal-header  { border-color: var(--border); }
  body.dark .modal-footer  { border-color: var(--border); }
  body.dark .modal-close   { background: var(--surface2); color: var(--text-secondary); }
  body.dark .modal-close:hover { background: var(--surface3); }

  /* ── 필터 탭 (pill group) ── */
  body.dark .filter-tabs   { background: var(--surface3); }
  body.dark .filter-tab    { color: var(--text-secondary); }
  body.dark .filter-tab.active { background: var(--surface); color: var(--text-primary); box-shadow: 0 1px 4px rgba(0,0,0,0.4); }

  /* ── 결제 서브탭 ── */
  body.dark .pay-sub-tab:hover { color: var(--text-primary); }

  /* ── 복합 추가 모달 탭 ── */
  body.dark .comb-tab-bar  { background: var(--surface2); border-color: var(--border); }
  body.dark .comb-tab.active { background: var(--surface); }

  /* ── 테이블 ── */
  body.dark thead th       { background: var(--surface2); border-color: var(--border); }
  body.dark tbody tr       { border-bottom-color: var(--border); }
  body.dark tbody tr:hover { background: var(--surface2); }
  body.dark #payment-table-body tr.pay-placeholder td { background: var(--surface); }

  /* ── 뱃지 ── */
  body.dark .badge-green  { background: var(--green-light); color: var(--green); }
  body.dark .badge-red    { background: var(--red-light); color: var(--red); }
  body.dark .badge-orange { background: var(--orange-light); color: var(--orange); }
  body.dark .badge-blue   { background: var(--accent-light); color: var(--accent); }
  body.dark .badge-purple { background: var(--purple-light); color: var(--purple); }
  body.dark .badge-gray   { background: var(--surface2); color: var(--text-secondary); }

  /* ── 증감치 뱃지 ── */
  body.dark .delta-up   { background: var(--green-light); color: var(--green); }
  body.dark .delta-down { background: var(--red-light); color: var(--red); }

  /* ── 경고 박스 ── */
  body.dark .alert-warning { background: var(--orange-light); color: var(--orange); border-color: rgba(255,159,10,0.25); }
  body.dark .alert-error   { background: var(--red-light); color: var(--red); border-color: rgba(255,69,58,0.25); }

  /* ── 리스트 아이템 ── */
  body.dark .list-item { background: var(--surface); border-color: var(--border); }

  /* ── 스케줄 ── */
  body.dark .schedule-grid-clip::before { background: linear-gradient(to right, #000 20%, transparent 100%); }
  body.dark .schedule-grid-clip::after  { background: linear-gradient(to left,  #000 20%, transparent 100%); }
  body.dark .schedule-day-col.focus-col { background: var(--surface); }
  body.dark .schedule-slot              { background: var(--surface2); }
  body.dark .schedule-slot:hover        { box-shadow: 0 2px 10px rgba(0,0,0,0.4); }

  /* ── 미니 캘린더 ── */
  body.dark .cal-day:hover   { background: var(--surface2); }
  body.dark .cal-day.focused:not(.today) { background: var(--accent-light); }

  /* ── 출석 캘린더 ── */
  body.dark .att-cal         { background: var(--surface); border-color: var(--border); }
  body.dark .att-cal-header  { border-color: var(--border); }
  body.dark .att-cal-dow     { background: var(--surface2); color: var(--text-secondary); }
  body.dark .att-cal-grid    { background: var(--border); }
  body.dark .att-day         { background: var(--surface); }
  body.dark .att-day:hover   { background: var(--surface2); }
  body.dark .att-day.other   { background: var(--surface2); color: var(--text-tertiary); }
  body.dark .att-legend      { border-color: var(--border); }
  body.dark .att-stat        { background: var(--surface); border-color: var(--border); }

  /* ── 운동일지 ── */
  body.dark .ex-log-item         { background: var(--surface); border-color: var(--border); }
  body.dark .ex-log-header:hover { background: var(--surface2); }
  body.dark .ex-log-date-badge   { background: var(--surface2); }
  body.dark .ex-log-body         { background: var(--surface2); border-color: var(--border); }
  body.dark .ex-log-item.ex-log-selected { background: var(--accent-light); border-color: var(--accent); }
  body.dark .ex-set-row:hover    { background: var(--surface3); }

  /* ── 루틴 카드 ── */
  body.dark .routine-card             { background: var(--surface); border-color: var(--border); }
  body.dark .routine-card:hover       { background: var(--accent-light); border-color: var(--accent); }
  body.dark .routine-card.active      { background: var(--accent-light); border-color: var(--accent); }
  body.dark .routine-ex-item:hover    { background: var(--surface2); }

  /* ── PAR-Q / 건강 문진 ── */
  body.dark .parq-q       { background: var(--surface); border-color: var(--border); }
  body.dark .cvd-factor   { border-color: var(--border); }
  body.dark .cvd-factor:hover { background: var(--surface2); }

  /* ── 측정 차트 카드 ── */
  body.dark .chart-card { background: var(--surface); border-color: var(--border); }
  body.dark .norm-bar   { background: var(--surface3); }

  /* ── 타입 칩 ── */
  body.dark .type-chip                    { background: var(--surface2); border-color: var(--border); color: var(--text-secondary); }
  body.dark .type-chip:hover:not(.active) { background: var(--surface3); border-color: var(--surface3); }

  /* ── 인바디 / 체성분 ── */
  body.dark .body-comp-card { background: var(--surface2); }

  /* ── info 아이템 ── */
  body.dark .info-item { background: var(--surface2); }

  /* ── 회원 상세(MDP) ── */
  body.dark .mdp            { background: var(--bg); }
  body.dark .mdp-topbar     { background: rgba(17,17,19,0.95); border-color: var(--border); }
  body.dark .mdp-tabs-wrap  { background: var(--surface); border-color: var(--border); }
  body.dark .mdp-tab        { color: var(--text-secondary); }
  body.dark .mdp-tab:hover  { color: var(--text-primary); }
  body.dark .mdp-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
  body.dark .mdp-content    { background: var(--bg); }

  /* ── 드롭다운 ── */
  body.dark .add-dropdown   { background: var(--surface); border-color: var(--border); }
  body.dark .add-dropdown-item { color: var(--text-primary); }
  body.dark .add-dropdown-item:hover { background: var(--surface2); }
  body.dark .add-dropdown-item + .add-dropdown-item { border-color: var(--border); }

  /* ── 툴팁 ── */
  body.dark #status-tooltip { background: var(--surface2); color: var(--text-primary); border-color: var(--border); box-shadow: 0 4px 14px rgba(0,0,0,0.5); }
  body.dark .metric-help-panel { background: var(--surface); border-color: var(--border); }

  /* ── 스크롤바 ── */
  body.dark ::-webkit-scrollbar-thumb { background: var(--surface3); }

  /* ── SVG 차트 중립 텍스트·그리드 ── */
  body.dark svg text[fill="#48484a"]  { fill: #8e8e93 !important; }
  body.dark svg text[fill="#636366"]  { fill: #8e8e93 !important; }
  body.dark svg line[stroke="#e5e5ea"] { stroke: #3a3a3c !important; }

  * { margin:0; padding:0; box-sizing:border-box; -webkit-font-smoothing:antialiased; }

  html { scrollbar-gutter: stable; }
  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
  }

  /* ── SIDEBAR ── */
  .sidebar {
    width: var(--sidebar-w);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
  }

  .sidebar-logo {
    padding: 28px 20px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #0050d8, #3a1c94);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    padding: 6px; box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(0,80,216,0.3);
  }
  .logo-icon svg { width: 100%; height: 100%; display: block; }
  .logo-text { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
  .logo-sub { font-size: 12px; color: var(--text-secondary); font-weight: 400; letter-spacing: 0.2px; }

  .sidebar-section { padding: 8px 12px 4px; }
  .sidebar-section-label {
    font-size: 12px; font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0 8px;
    margin-bottom: 4px;
  }

  .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 1px;
    user-select: none;
  }
  .nav-item:hover { background: white; color: var(--text-primary); box-shadow: var(--shadow); transform: translateY(-1px); }
  .nav-item.active { background: var(--accent-light); color: var(--accent); border-left: 3px solid var(--accent); padding-left: 7px; }
  .nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }
  .nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
  }

  .sidebar-spacer { flex: 1; }
  .sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
  }
  .trainer-card {
    display: flex; align-items: center; gap: 10px;
    cursor: pointer;
  }
  .trainer-avatar {
    width: 36px; height: 36px;
    background: #e9e9e9;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
  }
  .trainer-name { font-size: 14px; font-weight: 600; }
  .trainer-role { font-size: 12px; color: var(--text-secondary); }

  /* ── MAIN AREA ── */
  .main {
    margin-left: var(--sidebar-w);
  }

  /* ── TOPBAR ── */
  .topbar {
    height: 64px;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: relative; z-index: 50;
    display: flex; align-items: center;
    padding: 0 28px;
    gap: 16px;
  }
  .topbar-title { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; flex: 1; }
  .topbar-search {
    position: relative;
    width: 240px;
  }
  .topbar-search input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px 8px 36px;
    font-size: 14px;
    outline: none;
    transition: all var(--transition);
    font-family: inherit;
    color: var(--text-primary);
  }
  .topbar-search input:focus {
    background: white;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
  }
  .topbar-search input::placeholder { color: var(--text-tertiary); }
  .search-icon {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: var(--text-tertiary); font-size: 14px;
  }

  .btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600;
    cursor: pointer; border: none;
    transition: all var(--transition);
    font-family: inherit;
    white-space: nowrap;
  }
  .btn-primary { background: var(--accent); color: white; }
  .btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,113,227,0.3); }
  .btn-secondary { background: var(--surface2); color: var(--text-primary); border: 1px solid var(--border); }
  .btn-secondary:hover { background: var(--surface3); }
  .btn-ghost { background: transparent; color: var(--accent); padding: 6px 10px; font-size: 13px; }
  .btn-ghost:hover { background: var(--accent-light); }
  .btn-danger { background: var(--red-light); color: var(--red); border: 1px solid rgba(255,59,48,0.15); }
  .btn-danger:hover { background: var(--red); color: white; }
  .btn-sm { padding: 6px 12px; font-size: 13px; }
  .btn-icon { padding: 8px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border); cursor: pointer; transition: all var(--transition); }
  .btn-icon:hover { background: var(--surface3); }

  /* ── PAGE CONTENT ── */
  .page { display: none; }
  .page.active {
    display: block;
    height: calc(100vh - 64px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px;
    box-sizing: border-box;
  }
  @keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

  /* ── DASHBOARD ── */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
  }
  .stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
  }
  .stat-card:hover { box-shadow: var(--shadow); }
  .stat-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.3px; text-transform: uppercase; margin-bottom: 6px; }
  .stat-value { font-size: 26px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
  /* 결제 탭 집계 카드: 이모지 제거 후 높이 보정 */
  .pay-stat-card { padding: 22px 18px; }
  .pay-stat-card .stat-label { font-size: 13px; }
  .pay-stat-card .stat-value { font-size: 30px; }
  .stat-sub { font-size: 12px; color: var(--text-secondary); margin-top: 5px; display: flex; align-items: center; gap: 4px; }
  .stat-up { color: var(--green); }
  .stat-down { color: var(--red); }

  .dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 16px;
  }

  .card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }
  .card-header {
    padding: 18px 20px 14px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
  }
  .card-title { font-size: 15px; font-weight: 700; }
  .card-body { padding: 8px 0; }

  /* ── SESSION LIST ── */
  .session-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 20px;
    transition: background var(--transition);
    cursor: pointer;
    border-radius: 0;
  }
  .session-item:hover { background: var(--surface2); }
  .pt-sched-item {
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  }
  .pt-sched-item:hover {
    background: var(--surface2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transform: translateY(-1px);
  }
  .session-time {
    font-size: 12px; font-weight: 600;
    color: var(--text-secondary);
    width: 44px; text-align: right;
    flex-shrink: 0;
  }
  .session-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .session-info { flex: 1; min-width: 0; }
  .session-member { font-size: 14px; font-weight: 600; }
  .session-type { font-size: 12px; color: var(--text-secondary); }
  .session-badge {
    font-size: 12px; font-weight: 600;
    padding: 3px 9px; border-radius: 20px;
  }

  /* ── MEMBER LIST ── */
  .table-container {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: clip;
    box-shadow: var(--shadow-sm);
  }
  .table-header {
    padding: 16px 20px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
    gap: 12px;
  }
  .filter-tabs {
    display: flex; gap: 4px;
    background: #e2e2e7;
    padding: 3px;
    border-radius: 9px;
  }
  .filter-tab {
    padding: 5px 14px;
    border-radius: 7px;
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-secondary);
    border: none; background: none; font-family: inherit;
  }
  .filter-tab.active { background: white; color: var(--text-primary); font-weight: 600; box-shadow: var(--shadow-sm); }

  /* ── 결제 페이지 서브탭 (언더라인 스타일) ── */
  .pay-sub-tab {
    padding: 13px 18px;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    border: none; border-bottom: 2px solid transparent;
    background: none;
    font-family: inherit;
    color: var(--text-secondary);
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color var(--transition);
  }
  .pay-sub-tab:hover { color: var(--text-primary); }
  .pay-sub-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 700;
  }

  table { width: 100%; border-collapse: collapse; }
  .table-container table { table-layout: fixed; width: 100%; }
  /* 회원 관리 탭 — 헤더/바디 분리 2-테이블 구조 */
  .member-header-table, .member-body-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
  }
  .member-body-scroll {
    overflow: visible;
  }
  thead th {
    text-align: left;
    font-size: 12px; font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 10px 20px;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }
  .sortable-th { cursor: pointer; user-select: none; }
  .sortable-th:hover { color: var(--text-primary); background: var(--surface3); }
  .sortable-th.sort-active { color: var(--accent); }
  .sort-indicator { font-size: 11px; opacity: 0.8; }
  tbody tr {
    border-bottom: 1px solid rgba(0,0,0,0.10);
    cursor: pointer;
    transition: background var(--transition);
  }
  tbody tr:last-child { border-bottom: none; }
  tbody tr:hover { background: var(--surface2); }
  td { padding: 14px 20px; vertical-align: middle; }
  /* 회원 관리 헤더: 전체 좌정렬 */
  .member-header-table th { text-align: left; }
  /* 회원 테이블 바디: 전체 좌정렬 */
  #member-table-body td:not(:first-child) { text-align: left; }
  /* 잔여 횟수 progress bar */
  #member-table-body td:nth-child(4) .progress-bar { margin: 4px 0 0; }

  /* 결제 테이블 행 높이 고정 */
  #payment-table-body td { padding: 0; overflow: hidden; vertical-align: middle; }
  .pay-cell-inner {
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    overflow: hidden;
    box-sizing: border-box;
  }
  .pay-cell-expiry {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
  }
  #payment-table-body tr.pay-placeholder td { border: none; background: var(--surface); }
  .pay-row-spacer { display: block; height: 52px; }

  /* 회원 테이블 행 높이 고정 */
  #member-table-body tr { height: 65.4px; }
  #member-table-body td {
    height: 65.4px;
    box-sizing: border-box;
    overflow: hidden;
    vertical-align: middle;
    padding: 13px 20px; /* 전역 14px → 13px: 콘텐츠(39px)+패딩(26px)=65px 정합 */
  }

  .member-cell { display: flex; align-items: center; gap: 12px; }
  .avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
    flex-shrink: 0;
    color: white;
  }
  .member-name { font-size: 14px; font-weight: 600; }
  .member-id { font-size: 12px; color: var(--text-secondary); }

  .badge {
    display: inline-flex; align-items: center;
    font-size: 12px; font-weight: 600;
    padding: 3px 10px; border-radius: 20px;
  }
  .badge-green { background: var(--green-light); color: #1a7a35; }
  .badge-red { background: var(--red-light); color: #c0392b; }
  .badge-orange { background: var(--orange-light); color: #c05500; }
  .badge-blue { background: var(--accent-light); color: #0050a0; }
  .badge-purple { background: var(--purple-light); color: #7a1fa2; }
  .badge-gray { background: var(--surface2); color: var(--text-secondary); }

  /* ── PROGRESS BARS ── */
  .progress-bar { height: 6px; background: var(--surface3); border-radius: 3px; overflow: hidden; }
  .progress-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }

  /* ── MINI CALENDAR ── */
  .mini-calendar { padding: 16px 20px; }
  .cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .cal-title { font-size: 14px; font-weight: 700; }
  .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
  .cal-day-label { font-size: 10px; font-weight: 600; color: var(--text-tertiary); padding: 4px 0; }
  .cal-day-label.sun { color: #e0434b; }
  .cal-day-label.sat { color: #4A90D9; }
  .cal-day {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    font-size: 13px; border-radius: 50%; cursor: pointer;
    transition: all var(--transition);
  }
  .cal-day:hover { background: var(--surface2); }
  .cal-day.sun { color: #e0434b; }
  .cal-day.sat { color: #4A90D9; }
  .cal-day.other { opacity: 0.38; }
  .cal-day.today { background: var(--accent); color: white !important; font-weight: 700; }
  .cal-day.has-session { position: relative; }
  .cal-day.has-session::after {
    content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--accent);
  }
  .cal-day.sun.has-session::after { background: #e0434b; }
  .cal-day.sat.has-session::after { background: #4A90D9; }
  .cal-day.today.has-session::after { background: white; }
  .cal-day.focused:not(.today) { background: var(--accent-light); color: var(--accent); font-weight: 700; }
  .cal-day.focused.sun:not(.today) { color: #e0434b; }
  .cal-day.focused.sat:not(.today) { color: #4A90D9; }
  .cal-day.focused.has-session:not(.today)::after { background: var(--accent); }

  /* ── COMBINED ADD MODAL TABS ── */
  .comb-tab-bar {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
  }
  .comb-tab {
    flex: 1;
    padding: 11px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2.5px solid transparent;
    transition: color var(--transition), border-color var(--transition);
  }
  .comb-tab:hover { color: var(--text-primary); }
  .comb-tab.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--surface); }

  /* ── ADD DROPDOWN ── */
  .add-dropdown-wrap { position: relative; }
  .add-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    min-width: 130px;
    z-index: 200;
    overflow: hidden;
  }
  .add-dropdown.open { display: block; }
  .add-dropdown-item {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
  }
  .add-dropdown-item:hover { background: var(--surface2); }
  .add-dropdown-item + .add-dropdown-item { border-top: 1px solid var(--border); }

  /* ── MODAL ── */
  .modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .modal-overlay.show {
    opacity: 1;
    pointer-events: all;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .modal {
    background: white;
    border-radius: 18px;
    width: 100%; max-width: 520px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .modal.modal-wide { max-width: 860px; }
  .modal-overlay.show .modal { transform: scale(1) translateY(0); }
  .modal-header {
    padding: 24px 24px 16px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .modal-title { font-size: 18px; font-weight: 700; }
  .modal-close {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--surface2);
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: var(--text-secondary);
    transition: all var(--transition);
  }
  .modal-close:hover { background: var(--surface3); color: var(--text-primary); }
  .modal-body { padding: 20px 24px; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0; }

  /* ── FORM ── */
  .form-group { margin-bottom: 16px; }
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 0.3px; text-transform: uppercase; }
  .form-input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: all var(--transition);
    font-family: inherit;
    color: var(--text-primary);
    appearance: none;
  }
  .form-input:focus { background: white; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,0.12); }
  .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e6e73' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
  }
  textarea.form-input { resize: vertical; min-height: 80px; }

  /* ── MEMBER DETAIL ── */
  .member-hero {
    background: linear-gradient(135deg, #1d1d1f 0%, #2d2d2f 100%);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 28px;
    color: white;
    display: flex; align-items: center; gap: 20px;
    margin: -28px -28px 0;
    margin-bottom: 24px;
  }
  .member-hero-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 28px;
    color: white;
    border: 3px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
  }
  .member-hero-name { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
  .member-hero-sub { font-size: 14px; color: rgba(255,255,255,0.6); margin-top: 2px; }
  .hero-badges { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
  .hero-badge { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.9); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
  .member-hero-actions { margin-left: auto; display: flex; gap: 8px; }

  .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .detail-section { margin-bottom: 24px; }
  .section-title { font-size: 13px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }

  .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .info-item {
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 14px;
  }
  .info-item-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.3px; }
  .info-item-value { font-size: 18px; font-weight: 700; margin-top: 2px; }
  .info-item-unit { font-size: 12px; color: var(--text-secondary); font-weight: 400; }

  .workout-log-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }
  .workout-log-item:last-child { border-bottom: none; }
  .workout-date-badge {
    background: var(--surface2);
    border-radius: 8px;
    padding: 6px 10px;
    text-align: center;
    flex-shrink: 0;
  }
  .workout-date-day { font-size: 18px; font-weight: 800; line-height: 1; }
  .workout-date-month { font-size: 10px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; }
  .workout-info { flex: 1; }
  .workout-name { font-size: 14px; font-weight: 600; }
  .workout-detail { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
  .workout-duration { font-size: 13px; font-weight: 600; color: var(--text-secondary); }

  /* ── SCHEDULE PAGE ── */
  .schedule-grid-clip {
    position: relative;
    overflow: hidden;
    margin-top: 20px;
    padding: 22px 0 26px;
    isolation: isolate;
  }
  .schedule-grid-clip::before,
  .schedule-grid-clip::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 22%;
    pointer-events: none;
    z-index: 5;
  }
  .schedule-grid-clip::before {
    left: 0;
    background: linear-gradient(to right, white 20%, transparent 100%);
  }
  .schedule-grid-clip::after {
    right: 0;
    background: linear-gradient(to left, white 20%, transparent 100%);
  }
  .schedule-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    align-items: start;
    transform: translate3d(0,0,0);
    backface-visibility: hidden;
    will-change: transform;
  }
  .schedule-grid.sched-live { position: relative; z-index: 2; }
  .schedule-day-col {
    align-self: start;
    height: fit-content;
    min-width: 0;
    --schedule-scale: 1;
    transform: translate3d(0,0,0) scale(var(--schedule-scale));
    transform-origin: center center;
    backface-visibility: hidden;
  }
  .schedule-day-col.focus-col {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0 32px 40px;
    position: relative;
    z-index: 2;
  }
  .focus-col-sessions {
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    padding-bottom: 16px;
  }
  .focus-col-sessions::-webkit-scrollbar { width: 4px; }
  .focus-col-sessions::-webkit-scrollbar-track { background: transparent; }
  .focus-col-sessions::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 2px; }
  .schedule-day-col.blur-1 { --schedule-scale: 0.8; filter: none; opacity: 1; transform-origin: top center; transition: opacity 0.24s ease, transform 0.24s ease; }
  .schedule-day-col.blur-2 { --schedule-scale: 0.8; filter: none; opacity: 1; transform-origin: top center; transition: opacity 0.24s ease, transform 0.24s ease; }
  .schedule-day-col.blur-3 { --schedule-scale: 0.8; filter: none; opacity: 1; transform-origin: top center; transition: opacity 0.24s ease, transform 0.24s ease; }
  .schedule-day-col.blur-1:hover,
  .schedule-day-col.blur-2:hover,
  .schedule-day-col.blur-3:hover { cursor: pointer; opacity: 0.75; }
  .is-schedule-animating .schedule-day-col,
  .is-schedule-animating .schedule-slot {
    transition: none;
  }
  .is-schedule-animating .schedule-grid {
    pointer-events: none;
  }
  .schedule-day-header {
    text-align: center;
    padding: 10px 6px;
    margin-bottom: 8px;
  }
  .schedule-day-col.focus-col .schedule-day-header { padding: 18px 10px 14px; }
  .schedule-day-name { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
  .schedule-day-col.focus-col .schedule-day-name { font-size: 14px; font-weight: 700; }
  .schedule-day-num { font-size: 22px; font-weight: 700; line-height: 1; margin-top: 2px; }
  .schedule-day-col.focus-col .schedule-day-num { font-size: 36px; font-weight: 800; }
  /* 포커스 컬럼 미완료 슬롯 크기 */
  .schedule-day-col.focus-col .schedule-slot:not(.done):not(.cancelled):not(.noshow) { padding: 11px 14px; }
  .schedule-day-col.focus-col .schedule-slot:not(.done):not(.cancelled):not(.noshow) .slot-time   { font-size: 12px; }
  .schedule-day-col.focus-col .schedule-slot:not(.done):not(.cancelled):not(.noshow) .slot-member { font-size: 15px; }
  .schedule-day-col.focus-col .schedule-slot:not(.done):not(.cancelled):not(.noshow) .slot-type   { font-size: 12px; }
  .schedule-slot {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 10px;
    margin-bottom: 8px;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
  }
  /* 미완료 슬롯: 시간·이름·유형 한 줄 (불참은 별도 .noshow 클래스로 처리) */
  .schedule-slot:not(.done):not(.cancelled):not(.noshow) {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
  }
  .schedule-slot:not(.done):not(.cancelled):not(.noshow) .slot-time {
    font-size: 11px; font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
    width: 44px;
    text-align: center;
    padding-right: 8px;
    border-right: 1.5px solid var(--border);
  }
  .schedule-slot:not(.done):not(.cancelled):not(.noshow) .slot-member {
    font-size: 13px; font-weight: 700;
    margin-top: 0; flex-shrink: 0;
  }
  .schedule-slot:not(.done):not(.cancelled):not(.noshow) .slot-type {
    font-size: 11px; color: var(--text-tertiary);
    margin-top: 0; flex: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .schedule-slot:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
  .schedule-slot.done {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    margin-bottom: 8px;
  }
  .schedule-day-col.focus-col .schedule-slot.done { padding: 11px 14px; }
  .schedule-slot.done .slot-time {
    font-size: 11px; font-weight: 600;
    color: var(--green);
    width: 44px; text-align: center;
    padding-right: 8px;
    border-right: 1.5px solid var(--border);
    flex-shrink: 0;
  }
  .schedule-slot.done .slot-member {
    font-size: 13px; font-weight: 700;
    margin-top: 0; flex-shrink: 0;
  }
  .schedule-slot.done .slot-type {
    font-size: 11px; color: var(--text-tertiary);
    margin-top: 0; flex: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .schedule-slot.done .slot-status-badge {
    font-size: 11px; font-weight: 700;
    margin-top: 0; margin-left: auto;
    white-space: nowrap; color: var(--green); flex-shrink: 0;
  }
  /* 포커스 컬럼 완료 슬롯 크기 */
  .schedule-day-col.focus-col .schedule-slot.done .slot-time   { font-size: 12px; }
  .schedule-day-col.focus-col .schedule-slot.done .slot-member { font-size: 15px; }
  .schedule-day-col.focus-col .schedule-slot.done .slot-type   { font-size: 12px; }
  .schedule-slot.cancelled {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    margin-bottom: 8px;
    opacity: 0.5;
  }
  .schedule-day-col.focus-col .schedule-slot.cancelled { padding: 11px 14px; }
  .schedule-slot.cancelled .slot-time { font-size: 11px; font-weight: 600; color: var(--text-secondary); width: 44px; text-align: center; padding-right: 8px; border-right: 1.5px solid var(--border); flex-shrink: 0; }
  .schedule-slot.cancelled .slot-member { font-size: 13px; font-weight: 700; margin-top: 0; flex-shrink: 0; text-decoration: line-through; }
  .schedule-slot.cancelled .slot-type { font-size: 11px; color: var(--text-tertiary); margin-top: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .schedule-slot.cancelled .slot-status-badge { font-size: 11px; font-weight: 700; margin-top: 0; margin-left: auto; white-space: nowrap; flex-shrink: 0; }
  /* 포커스 컬럼 취소 슬롯 크기 */
  .schedule-day-col.focus-col .schedule-slot.cancelled .slot-time   { font-size: 12px; }
  .schedule-day-col.focus-col .schedule-slot.cancelled .slot-member { font-size: 15px; }
  .schedule-day-col.focus-col .schedule-slot.cancelled .slot-type   { font-size: 12px; }
  /* 불참 슬롯: 흐림 없이 진한 글씨 유지, 시간만 오렌지 */
  .schedule-slot.noshow {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; margin-bottom: 8px;
  }
  .schedule-day-col.focus-col .schedule-slot.noshow { padding: 11px 14px; }
  .schedule-slot.noshow .slot-time {
    font-size: 11px; font-weight: 700;
    color: var(--orange);
    width: 44px; text-align: center;
    padding-right: 8px; border-right: 1.5px solid var(--border); flex-shrink: 0;
  }
  .schedule-slot.noshow .slot-member { font-size: 13px; font-weight: 700; margin-top: 0; flex-shrink: 0; }
  .schedule-slot.noshow .slot-type   { font-size: 11px; color: var(--text-tertiary); margin-top: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .schedule-day-col.focus-col .schedule-slot.noshow .slot-time   { font-size: 12px; }
  .schedule-day-col.focus-col .schedule-slot.noshow .slot-member { font-size: 15px; }
  .schedule-day-col.focus-col .schedule-slot.noshow .slot-type   { font-size: 12px; }
  .slot-time { font-size: 10px; font-weight: 600; color: var(--text-secondary); }
  .slot-member { font-size: 13px; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .slot-type { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
  .slot-status-badge { font-size: 10px; font-weight: 700; margin-top: 3px; }

  /* ── NOTIFICATION DOT ── */
  .notif-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--red);
    margin-left: auto;
  }

  /* ── QUICK STATS ROW ── */
  .quick-stats {
    display: flex; gap: 12px;
    margin-bottom: 20px;
  }
  .quick-stat {
    flex: 1;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
    cursor: pointer;
    transition: all var(--transition);
  }
  .quick-stat:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
  .quick-stat-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
  }
  .quick-stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
  .quick-stat-value { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; margin-top: 1px; }

  /* ── EMPTY STATE ── */
  .empty-state {
    text-align: center; padding: 60px 20px;
    color: var(--text-secondary);
  }
  .empty-icon { font-size: 48px; margin-bottom: 12px; }
  .empty-text { font-size: 16px; font-weight: 600; color: var(--text-primary); }
  .empty-sub { font-size: 14px; margin-top: 4px; }

  /* ── TOAST ── */
  .toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
  .toast {
    background: #1d1d1f;
    color: white;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px; font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 10px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  }
  .toast.show { transform: translateX(0); }
  .toast-icon { font-size: 16px; }

  /* ── CHART ── */
  .chart-container { padding: 16px 20px; }
  .chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 171px; }
  #dash-schedule-clip { margin-top: 0; padding-top: 32px; padding-bottom: 36px; height: 568px; overflow: clip; }
  #dash-right-col { align-self: stretch; }
  #dash-chart-card { flex: 1; display: flex; flex-direction: column; }
  #dash-chart-container { flex: 1; display: flex; flex-direction: column; }
  #dash-chart-container .chart-bars { flex: 1; height: auto; }
  #dash-schedule-clip .schedule-day-col:not(.focus-col) { overflow: hidden; max-height: 504px; }
  .chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
  .chart-bar {
    width: 100%; border-radius: 4px 4px 0 0;
    background: var(--accent-light);
    transition: height 0.6s cubic-bezier(0.4,0,0.2,1);
    cursor: pointer;
    position: relative;
  }
  .chart-bar:hover { background: var(--accent); }
  .chart-bar-label { font-size: 10px; color: var(--text-secondary); font-weight: 600; }
  .chart-bar-val { font-size: 12px; font-weight: 700; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); color: var(--text-primary); white-space: nowrap; opacity: 0; transition: opacity 0.2s; }
  .chart-bar:hover .chart-bar-val { opacity: 1; }

  .page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
  .page-title { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
  .page-sub { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }

  .tag {
    display: inline-flex; align-items: center;
    background: var(--surface2); color: var(--text-secondary);
    font-size: 12px; font-weight: 600;
    padding: 2px 8px; border-radius: 6px;
    gap: 3px;
  }
  .tags { display: flex; flex-wrap: wrap; gap: 4px; }

  /* ── STATUS TOOLTIP ── */
  .member-status-tip { cursor: default; }
  #status-tooltip {
    position: fixed;
    z-index: 9999;
    background: white;
    color: #3a3a3c;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    padding: 5px 11px;
    border-radius: 7px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 14px rgba(0,0,0,0.10);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
  }
  #status-tooltip.show { opacity: 1; }

  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }

  .divider { height: 1px; background: var(--border); margin: 0 20px; }

  /* ── INBODY / BODY COMP ── */
  .body-comp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .body-comp-card {
    background: var(--surface2);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
  }
  .body-comp-val { font-size: 22px; font-weight: 800; }
  .body-comp-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; margin-top: 2px; }

  /* ── MEMBERSHIP EXPIRY ALERT ── */
  .alert {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex; align-items: center; gap: 10px;
    font-size: 14px; font-weight: 500;
    margin-bottom: 12px;
  }
  .alert-warning { background: var(--orange-light); color: #854d00; border: 1px solid rgba(255,149,0,0.2); }
  .alert-error { background: var(--red-light); color: #9b1c15; border: 1px solid rgba(255,59,48,0.2); }
  .alert-icon { font-size: 16px; flex-shrink: 0; }

  /* ── MEMBER DETAIL PAGE (full-page overlay) ── */
  .mdp {
    position: fixed; left: var(--sidebar-w); top: 0; right: 0; bottom: 0;
    background: var(--bg); z-index: 200; display: none; flex-direction: column; overflow: hidden;
    outline: none;
  }
  .mdp.show { display: flex; animation: mdpIn .22s ease; }
  @keyframes mdpIn { from { opacity:0; transform:translateX(16px); } to { opacity:1; transform:translateX(0); } }

  .mdp-topbar {
    background: rgba(255,255,255,.9); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border); padding: 0 12px 0 16px;
    height: 56px; display: flex; align-items: center; gap: 6px; flex-shrink: 0;
    overflow: hidden; width: 100%; box-sizing: border-box;
  }
  .mdp-back { background: none; border: none; font-size: 13px; font-weight: 600;
    color: var(--accent); cursor: pointer; display: flex; align-items: center; gap: 4px;
    padding: 6px 10px; border-radius: 8px; font-family: inherit; white-space: nowrap; flex-shrink: 0; }
  .mdp-back:hover { background: var(--accent-light); }
  .mdp-topbar-name { font-size: 16px; font-weight: 700; }
  .mdp-topbar-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: nowrap; flex-shrink: 0; }

  .mdp-hero {
    background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
    padding: 20px 28px; flex-shrink: 0; display: flex; align-items: center; gap: 18px; color: white;
  }
  .mdp-hero-av {
    width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 24px; font-weight: 800; color: white;
    border: 2px solid rgba(255,255,255,.2); flex-shrink: 0; overflow: hidden;
  }
  .mdp-hero-av-wrap {
    position: relative; flex-shrink: 0; cursor: pointer; display: block;
  }
  .mdp-hero-name { font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
  .mdp-hero-sub { font-size: 13px; color: rgba(255,255,255,.6); margin-top: 3px; }
  .mdp-hero-badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
  .mdp-hero-badge { background: rgba(255,255,255,.15); font-size: 12px; font-weight: 600;
    padding: 3px 9px; border-radius: 20px; color: rgba(255,255,255,.9); }
  .mdp-hero-stats { margin-left: auto; display: flex; gap: 20px; }
  .mdp-stat { text-align: center; }
  .mdp-stat-val { font-size: 22px; font-weight: 800; }
  .mdp-stat-lbl { font-size: 10px; color: rgba(255,255,255,.5); font-weight: 600; text-transform: uppercase; margin-top: 2px; }

  /* TABS */
  .mdp-tabs-wrap { background: white; border-bottom: 2px solid var(--border); flex-shrink: 0; overflow-x: auto; }
  .mdp-tabs { display: flex; padding: 0 20px; min-width: max-content; }
  .mdp-tab {
    padding: 13px 16px; font-size: 13px; font-weight: 600; color: var(--text-secondary);
    cursor: pointer; white-space: nowrap; font-family: inherit;
    border: none; border-bottom: 3px solid transparent;
    background: none; transition: color var(--transition), border-color var(--transition);
    margin-bottom: -2px;
  }
  .mdp-tab:hover { color: var(--text-primary); }
  .mdp-tab:focus { outline: none; }
  .mdp-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
  .mdp-tab .tab-badge {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: white; font-size: 10px; font-weight: 700;
    min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px; margin-left: 5px;
  }
  .mdp-content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 28px; }

  /* PAR-Q */
  .parq-q { background: white; border: 1px solid var(--border); border-radius: 12px;
    padding: 16px; margin-bottom: 10px; }
  .parq-q-text { font-size: 14px; font-weight: 500; line-height: 1.5; margin-bottom: 12px; }
  .parq-q-num { font-weight: 700; color: var(--accent); margin-right: 6px; }
  .parq-radio-row { display: flex; gap: 12px; }
  .parq-radio { display: flex; align-items: center; gap: 6px; cursor: pointer; }
  .parq-radio input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
  .parq-radio span { font-size: 13px; font-weight: 600; }
  .parq-sub-input { margin-top: 10px; display: none; }
  .parq-sub-input.show { display: block; }
  .risk-badge { padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 700;
    display: inline-flex; align-items: center; gap: 6px; }
  .risk-low { background: var(--green-light); color: #1a7a35; }
  .risk-mod { background: var(--orange-light); color: #9a4500; }
  .risk-high { background: var(--red-light); color: #c0392b; }
  .cvd-factor { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
    border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer;
    transition: background var(--transition), border-color var(--transition); }
  .cvd-factor:hover { background: var(--surface2); }
  .cvd-factor input { accent-color: var(--accent); width: 16px; height: 16px; margin-top: 4px; flex-shrink: 0; cursor: pointer; }
  .cvd-label {
    display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.3px;
    padding: 3px 9px; border-radius: 20px;
    background: rgba(0,113,227,0.1); color: var(--accent);
    margin-bottom: 5px; }
  .cvd-detail { font-size: 13px; color: var(--text-primary); line-height: 1.55; }

  /* TYPE CHIPS */
  .type-chip {
    padding: 6px 13px; border-radius: 20px; font-size: 12px; font-weight: 600;
    border: 1.5px solid var(--border); background: white; color: var(--text-secondary);
    cursor: pointer; transition: all var(--transition); white-space: nowrap;
  }
  .type-chip.active { background: var(--accent); color: white; border-color: var(--accent); }
  .type-chip:hover:not(.active) { background: var(--surface2); border-color: #aaa; }

  /* CHARTS */
  .chart-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
  .chart-card-title { font-size: 13px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 14px; }
  .chart-single-val { font-size: 32px; font-weight: 800; }
  .chart-trend { font-size: 13px; font-weight: 600; margin-top: 2px; }
  .trend-up-good { color: var(--green); } .trend-down-good { color: var(--green); }
  .trend-up-bad { color: var(--red); } .trend-down-bad { color: var(--red); }
  .trend-neutral { color: var(--text-secondary); }
  .chart-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 14px; }
  .chart-grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin-bottom: 14px; }
  .norm-bar-wrap { margin-top: 6px; }
  .norm-bar { height: 8px; background: var(--surface3); border-radius: 4px; overflow: visible; position: relative; }
  .norm-fill { height: 100%; border-radius: 4px; transition: width .8s ease; }
  .norm-marker { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--text-primary); border-radius: 1px; }
  .norm-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-tertiary); margin-top: 3px; }

  /* ATTENDANCE CALENDAR */
  .att-cal { background: white; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
  .att-cal-header { padding: 10px 14px; display: flex; align-items: center; gap: 8px;
    border-bottom: 1px solid var(--border); }
  .att-cal-title { font-size: 14px; font-weight: 700; }
  .att-cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; background: var(--border); }
  .att-cal-dow { background: var(--surface2); text-align: center; font-size: 10px; font-weight: 700;
    color: var(--text-secondary); padding: 5px 2px; }
  .att-cal-dow.sun { color: #e05a5a; }
  .att-cal-dow.sat { color: #5a7fe0; }
  .att-day { background: white; min-height: 80px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; cursor: pointer; transition: background var(--transition);
    font-size: 12px; font-weight: 500; gap: 2px; position: relative; }
  .att-day:hover { background: var(--surface2); }
  .att-day.other { color: var(--text-tertiary); background: var(--surface2); }
  .att-day.sun { color: #e05a5a; }
  .att-day.sat { color: #5a7fe0; }
  .att-day.sun.other, .att-day.sat.other { opacity: 0.45; }
  .att-day.today .att-day-num { background: var(--accent); color: white; border-radius: 50%;
    width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
  .att-dot { width: 5px; height: 5px; border-radius: 50%; }
  .att-dot.출석 { background: var(--green); }
  .att-dot.결석 { background: var(--red); }
  .att-dot.지각 { background: var(--orange); }
  .att-dot.취소 { background: var(--text-tertiary); }
  .att-dot.pt-session { background: var(--accent); width: 7px; height: 7px; }
  .att-legend { display: flex; gap: 12px; padding: 8px 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
  .att-legend-item { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--text-secondary); }
  .att-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
  .att-stat { background: white; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 8px; text-align: center; }
  .att-stat-val { font-size: 20px; font-weight: 800; }
  .att-stat-lbl { font-size: 12px; color: var(--text-secondary); font-weight: 600; margin-top: 2px; }

  /* EXERCISE LOG */
  .ex-log-item { background: white; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0; overflow: hidden; cursor: pointer; }
  .ex-log-item.ex-log-selected { border-color: var(--accent); background: var(--accent-light); }
  .ex-log-item.ex-log-selected .ex-log-type { color: var(--accent); }
  .ex-log-header { padding: 14px 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
  .ex-log-header:hover { background: var(--surface2); }
  .ex-log-date-badge { background: var(--surface2); border-radius: 8px; padding: 6px 10px; text-align: center; flex-shrink: 0; }
  .ex-log-day { font-size: 20px; font-weight: 800; line-height: 1; }
  .ex-log-month { font-size: 10px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; }
  .ex-log-info { flex: 1; }
  .ex-log-type { font-size: 14px; font-weight: 700; }
  .ex-log-detail { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
  .ex-log-body { border-top: 1px solid var(--border); padding: 14px 16px; display: none; background: var(--surface2); }
  .ex-log-body.open { display: block; }
  .ex-row-header { display: grid; grid-template-columns: 1fr repeat(5,50px); gap: 6px; font-size: 12px;
    font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; padding: 0 4px; margin-bottom: 6px; }
  .ex-set-row { display: grid; grid-template-columns: 1fr repeat(5,50px); gap: 6px;
    padding: 5px 4px; border-radius: 6px; }
  .ex-set-row:hover { background: white; }
  .ex-set-cell { font-size: 13px; text-align: center; color: var(--text-secondary); }
  .ex-set-cell:first-child { text-align: left; font-weight: 600; color: var(--text-primary); }

  /* ─── 운동일지: 루틴 카드 ─────────────────────────── */
  .sec-label { font-size: 11px; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; }

  .routine-card {
    background: white; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px 14px; cursor: pointer; transition: all .15s ease;
  }
  .routine-card:hover { border-color: var(--accent); background: var(--accent-light); }
  .routine-card.active { border-color: var(--accent); background: var(--accent-light); }
  .routine-card-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
  .routine-card.active .routine-card-name { color: var(--accent); }
  .routine-card-count { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

  .routine-ex-list-wrap { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
  .routine-ex-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px;
    border-radius: var(--radius-sm); cursor: pointer; transition: background .12s ease;
    margin-bottom: 4px;
  }
  .routine-ex-item:hover { background: var(--surface2); }
  .routine-ex-bullet {
    width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex-shrink: 0; transition: background .12s;
  }
  .routine-ex-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
  .routine-ex-prev { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }

  /* ─── 증감치 배지 ──────────────────────────────────── */
  .delta-badge {
    font-size: 10px; font-weight: 700; border-radius: 10px; padding: 2px 5px;
    white-space: nowrap; flex-shrink: 0;
  }
  .delta-up   { background: #dcfce7; color: #16a34a; }
  .delta-down { background: #fee2e2; color: #dc2626; }
  .delta-same { background: var(--surface2); color: var(--text-tertiary); }

  /* 인바디 테이블 — 체지방률/체지방량 호버 전환 */
  .ib-fat-cell .ib-fat-pct,
  .ib-fat-cell .ib-fat-mass { transition: opacity .18s ease; }
  .ib-fat-cell:hover .ib-fat-pct { display: none; }
  .ib-fat-cell:hover .ib-fat-mass { display: inline !important; }

  /* MODAL SCROLL */
  .modal { max-height: 88vh; }

  /* SECTION BLOCKS */
  .sec-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .sec-title { font-size: 13px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .4px; }
  .empty-tab { text-align: center; padding: 48px 20px; color: var(--text-secondary); }
  .empty-tab-icon { font-size: 40px; margin-bottom: 10px; }
  .empty-tab-text { font-size: 15px; font-weight: 600; color: var(--text-primary); }
  .empty-tab-sub { font-size: 13px; margin-top: 4px; }

  /* PAYMENT / SCHEDULE LIST */
  .list-item { background: white; border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 14px 16px; margin-bottom: 6px; display: flex; align-items: center; gap: 14px; }
  .list-item-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center;
    justify-content: center; font-size: 16px; flex-shrink: 0; }
  .list-item-info { flex: 1; min-width: 0; }
  .list-item-title { font-size: 14px; font-weight: 600; }
  .list-item-sub { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
  .list-item-right { text-align: right; flex-shrink: 0; }
  .list-item-amount { font-size: 15px; font-weight: 700; }
  .list-item-date { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ════════════════════════════════════════
   모바일 반응형
════════════════════════════════════════ */

/* ── 햄버거 버튼 (기본 숨김, 모바일에서 표시) ── */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}
.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.2s ease;
}

/* ── 사이드바 오버레이 ── */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
  backdrop-filter: blur(2px);
}
#sidebar-overlay.show { display: block; }

/* ── 태블릿 (≤1024px) ── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  #dash-right-col { flex-direction: row; flex-wrap: wrap; }
  #dash-right-col > .card { flex: 1; min-width: 260px; }
}

/* ── 모바일 (≤768px) ── */
@media (max-width: 768px) {

  /* 사이드바: 기본 숨김, 열리면 슬라이드인 */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }

  /* 메인: 사이드바 공간 없앰 */
  .main { margin-left: 0; }

  /* 햄버거 표시 */
  .hamburger-btn { display: flex; }

  /* 탑바 */
  .topbar { padding: 0 16px; gap: 10px; height: 56px; }
  .topbar-title { font-size: 17px; }
  .topbar-search { display: none; }

  /* 페이지 패딩 */
  .page { padding: 16px; }

  /* 스탯 그리드: 2열 */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
  .stat-card { padding: 12px 14px; }
  .stat-value { font-size: 22px; }

  /* 대시보드 그리드: 1열 */
  .dashboard-grid { grid-template-columns: 1fr; gap: 14px; }
  #dash-right-col { flex-direction: column; }

  /* 카드 */
  .card { border-radius: var(--radius-sm); }
  .card-header { padding: 14px 16px; }

  /* 회원 테이블: 가로 스크롤 */
  .member-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .member-table { min-width: 600px; }

  /* 결제 테이블 */
  .payment-table-wrap, #payment-table-body { overflow-x: auto; }

  /* 모달: 풀스크린에 가깝게 */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    width: 100%;
    margin: 0;
  }

  /* 회원 상세 페이지(MDP) */
  .mdp { padding: 0; }
  .mdp-header { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* 버튼 */
  .btn { padding: 8px 12px; font-size: 13px; }

  /* 필터 탭 스크롤 */
  .filter-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .filter-tab { white-space: nowrap; flex-shrink: 0; }

  /* 도전과제 탭 */
  #page-challenges .filter-tabs,
  #page-challenges [style*="flex-wrap:wrap"] { flex-wrap: nowrap !important; overflow-x: auto; }
}

/* ── 설문평가 서브탭 스크롤바 숨김 ── */
.survey-subtab-nav::-webkit-scrollbar { display: none; }

/* ── 소형 모바일 (≤480px) ── */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 10px 12px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 11px; }
  .topbar-title { font-size: 15px; }
  .page { padding: 12px; }
  .card-title { font-size: 14px; }
}
