:root {
  --bg: #f8f7f4;
  --surface: #ffffff;
  --sidebar: #fffdf8;
  --line: #ede9e1;
  --ink: #1d2230;
  --muted: #7b8190;
  --soft: #f3f5f8;
  --nav-active: #f7eddf;
  --gold: #d79331;
  --blue: #4c6fff;
  --purple: #7d5ff2;
  --green: #39c493;
  --orange: #ff8a32;
  --red: #ef4d5c;
  --gray: #b9c0ca;
  --shadow: 0 18px 46px rgba(31, 38, 55, 0.06);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  font-family: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ══ 앱 레이아웃 ══════════════════════════════════════════════════════════ */
.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

/* ══ 사이드바 다크 테마 ═══════════════════════════════════════════════════ */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, #111827 0%, #0c1520 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 0;
  box-shadow: 4px 0 24px rgba(0,0,0,0.18);
}

/* 로고 영역 */
.sidebar-brand {
  flex-shrink: 0;
  padding: 24px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.brand {
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand-logo {
  width: 100px;
  height: auto;
  object-fit: contain;
}

/* 네비게이션 */
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  padding: 14px 12px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.45);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  transition: stroke 0.18s;
}

.nav-item:hover {
  color: rgba(255,255,255,0.88);
  background: rgba(255,255,255,0.07);
}

.nav-item.is-active {
  color: #fff;
  background: linear-gradient(90deg,
    rgba(215,147,49,0.22) 0%,
    rgba(215,147,49,0.06) 100%);
  font-weight: 700;
}

/* 활성 인디케이터 — 왼쪽 골드 바 */
.nav-item.is-active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #f0b943, #d4840a);
}

.nav-item.is-active svg {
  stroke: #d4a832;
}

/* 하단 유저 섹션 */
.sidebar-footer {
  flex-shrink: 0;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
}

.sidebar-user-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #3ecf8e;
  box-shadow: 0 0 0 3px rgba(62,207,142,0.25);
  flex-shrink: 0;
}

.sidebar-user strong {
  display: block;
  font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,0.88);
}

.sidebar-user em {
  display: block;
  font-size: 11px; font-style: normal;
  color: rgba(255,255,255,0.35);
  margin-top: 2px;
  letter-spacing: .02em;
}

/* ── 캐릭터 선택 그리드 ──────────────────────────────────────────────── */
.char-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
  padding: 14px;
  border: 1.5px solid #e5e9f0;
  border-radius: 12px;
  background: #f8f9fb;
}
.char-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; cursor: pointer;
}
.char-item-ring {
  width: 68px; height: 68px; border-radius: 50%;
  overflow: hidden;
  border: 3px solid transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.15s;
  background: #fff;
}
.char-item-ring img { width: 100%; height: 100%; object-fit: cover; display: block; }
.char-item:hover .char-item-ring {
  border-color: #a0b4ff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76,111,255,0.18);
}
.char-item.selected .char-item-ring {
  border-color: #4c6fff;
  box-shadow: 0 0 0 4px rgba(76,111,255,0.18);
}
.char-item-label { font-size: 10px; font-weight: 700; color: var(--muted); text-align: center; }
.char-item.selected .char-item-label { color: #4c6fff; }

/* 모바일 전용 요소 — PC에서 기본 숨김 */
.topbar-mobile-logo { display: none; }
.td-status-mobile   { display: none !important; }
.mobile-top-bar     { display: none; }

/* ── 사이드바 Logout 버튼 ────────────────────────────────────────────── */
.sidebar-logout {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.45);
  font-size: 13px; font-weight: 700;
  text-decoration: none;
  transition: all .18s;
}
.sidebar-logout svg {
  width: 17px; height: 17px; flex-shrink: 0;
}
.sidebar-logout:hover {
  color: #ff6b6b;
  background: rgba(255,107,107,0.1);
}

/* ── 모바일 상단 바 스타일 ───────────────────────────────────────────── */
.mobile-logout-btn {
  display: inline-flex; align-items: center;
  height: 32px; padding: 0 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
  font-size: 12px; font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.15);
  transition: all .15s;
}
.mobile-logout-btn:hover {
  background: rgba(255,107,107,0.2);
  color: #ff8080;
  border-color: rgba(255,107,107,0.3);
}
.topbar-greeting    { display: block; }

.add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #1c2a42 0%, #101827 100%);
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 2px 8px rgba(16,24,39,0.22), inset 0 1px 0 rgba(255,255,255,0.06);
  cursor: pointer;
  transition: box-shadow 0.18s, transform 0.18s;
  text-decoration: none;
  white-space: nowrap;
}
.add-button:hover {
  box-shadow: 0 4px 16px rgba(16,24,39,0.32);
  transform: translateY(-1px);
}

.main {
  min-width: 0;
  padding: 38px 38px 42px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.topbar h1 {
  margin: 0 0 8px;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: 0;
}

.topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.search-box {
  display: flex;
  align-items: center;
  width: min(280px, 28vw);
  height: 44px;
  padding: 0 14px 0 18px;
  border: 1px solid #f0edf0;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 26px rgba(31, 38, 55, 0.04);
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-box input::placeholder {
  color: #a5aab4;
}

.search-box svg,
.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.add-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #d4a832;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #4d5565;
  background: transparent;
}

.icon-button span {
  position: absolute;
  top: 1px;
  right: 2px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-size: 10px;
  font-weight: 900;
}

/* add-button min-width removed — pill style handles sizing */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card,
.panel,
.insight-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  min-height: 118px;
  padding: 22px;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
}

.stat-icon svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-card p {
  margin: 0 0 7px;
  font-size: 15px;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 34px;
  line-height: 1;
  font-weight: 500;
}

.stat-card strong span {
  margin-left: 4px;
  font-size: 16px;
}

.stat-card em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.stat-card.purple .stat-icon { color: #6d4be5; background: #eadcff; }
.stat-card.blue .stat-icon { color: var(--blue); background: #dce6ff; }
.stat-card.orange .stat-icon { color: var(--orange); background: #ffe1c2; }
.stat-card.green .stat-icon { color: #19a976; background: #d6f6e9; }
.stat-card.blue em { color: var(--blue); }
.stat-card.orange em { color: var(--orange); }
.stat-card.green em { color: #19a976; }

.content-grid {
  display: grid;
  grid-template-columns: 1.07fr 1fr 0.86fr;
  gap: 16px;
}

.panel {
  min-width: 0;
  padding: 22px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.panel-head a,
.panel-head button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.status-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: center;
  gap: 24px;
  min-height: 214px;
}

.donut {
  position: relative;
  display: grid;
  place-items: center;
  width: 170px;
  height: 170px;
  margin: 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--blue) 0 28%, var(--green) 28% 69%, #f5bc38 69% 91%, var(--gray) 91% 100%);
}

.donut::before {
  width: 94px;
  height: 94px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.donut span {
  position: absolute;
  z-index: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
}

.donut strong {
  display: block;
  margin-top: 6px;
  font-size: 23px;
}

.legend-list {
  display: grid;
  gap: 14px;
}

.legend-list div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.legend-list i,
.chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.growth { background: var(--blue); }
.maintain { background: var(--green); }
.watch { background: #f5bc38; }
.end { background: var(--gray); }

.legend-list span {
  color: #4d5565;
  font-weight: 700;
}

.legend-list strong {
  text-align: right;
  font-size: 14px;
}

.legend-list em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
}

.record-list,
.task-list {
  display: grid;
}

.record-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 47px;
  border-bottom: 1px solid var(--line);
}

.record-row:last-child,
.task-list label:last-child {
  border-bottom: 0;
}

.record-row strong,
.record-row em,
.task-list strong,
.task-list em {
  display: block;
}

.record-row strong,
.task-list strong {
  margin-bottom: 2px;
  font-size: 13px;
}

.record-row em,
.task-list em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.record-row time,
.task-list time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.mood {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 25px;
  border-radius: 999px;
  font-size: 11px;
}

.mood.good {
  color: #14a374;
  border: 1px solid #a7ead3;
  background: #f4fffb;
}

.mood.normal {
  color: #de8c12;
  border: 1px solid #f8d799;
  background: #fffaf0;
}

.task-list label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
}

.task-list input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
}

.trend-card {
  min-height: 290px;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #626a78;
  font-size: 12px;
  font-weight: 700;
}

.line-chart {
  width: 100%;
  height: 210px;
}

.grid-lines {
  fill: none;
  stroke: #e9edf3;
  stroke-dasharray: 5 6;
  stroke-width: 1;
}

.line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.growth-line { stroke: var(--blue); }
.maintain-line { stroke: var(--green); }
.watch-line { stroke: #f5bc38; }
.end-line { stroke: var(--gray); }

.rank-list {
  display: grid;
  gap: 14px;
}

.rank-list div {
  display: grid;
  grid-template-columns: 18px auto 58px minmax(80px, 1fr) 38px;
  align-items: center;
  gap: 12px;
}

.rank-list b {
  color: #b58a34;
  font-size: 19px;
}

.rank-list strong {
  font-size: 13px;
}

.rank-list i {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue) var(--score), #e8e8e8 var(--score));
}

.rank-list em {
  color: var(--ink);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.insight-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  gap: 10px;
  padding: 24px;
  background:
    radial-gradient(circle at 92% 74%, rgba(125, 95, 242, 0.14), transparent 32%),
    linear-gradient(135deg, #fbf8ff 0%, #fff 46%, #f5f0ff 100%);
}

.insight-card h2 {
  margin: 0 0 16px;
  color: #5332c5;
  font-size: 18px;
}

.insight-card span {
  display: inline-flex;
  align-items: center;
  height: 26px;
  margin-bottom: 10px;
  padding: 0 12px;
  border-radius: 999px;
  color: #7651e7;
  background: #eee6ff;
  font-size: 12px;
  font-weight: 800;
}

.insight-card strong {
  display: block;
  margin-bottom: 10px;
  color: #5332c5;
  font-size: 15px;
  line-height: 1.5;
}

.insight-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.7;
}

.insight-card button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #ded6fb;
  border-radius: var(--radius);
  color: #5e3dd1;
  background: #fff;
  font-weight: 800;
}

.insight-card svg {
  width: 100%;
  height: auto;
}

.rise-base {
  fill: rgba(125, 95, 242, 0.15);
}

.rise-line,
.rise-arrow {
  fill: none;
  stroke: #7d5ff2;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.insight-card circle {
  fill: #ffbd6a;
}

.avatar,
.character-slot {
  position: relative;
  overflow: hidden;
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(145deg, #e8efff, #fff3e0);
  color: #3f57d9;
  font-weight: 900;
  font-size: 15px;
}

.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 80px; height: 80px; font-size: 26px; }
.avatar.xl { width: 110px; height: 110px; font-size: 34px; }

.character-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.character-img:not([hidden]) + .avatar-initial {
  display: none;
}

.avatar-initial {
  position: relative;
  z-index: 1;
}

.status-card {
  grid-column: span 1;
}

.log-card {
  grid-column: span 1;
}

.action-card {
  grid-column: span 1;
}

.trend-card,
.rank-card,
.insight-card {
  min-height: 278px;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 16px;
}

.page-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.page-grid.single {
  grid-template-columns: 1fr;
}

.wide-panel {
  grid-column: 1 / -1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
.setting-row strong {
  color: #343b49;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  outline: 0;
}

.field textarea {
  min-height: 116px;
  padding: 12px;
  resize: vertical;
  line-height: 1.6;
}

.upload-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px dashed #d9dee8;
  border-radius: var(--radius);
  background: #fbfcff;
}

.upload-preview {
  width: 58px;
  height: 58px;
}

.upload-field input[type="file"] {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.upload-field p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #e5e8ef;
  border-radius: 999px;
  color: #596171;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.chip.is-selected {
  color: #3153dd;
  border-color: #cdd8ff;
  background: #eef3ff;
}

.status-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.status-option {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.status-option strong {
  font-size: 12px;
}

.status-option em {
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  line-height: 1.45;
}

.data-list {
  display: grid;
}

.data-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
}

.data-row:last-child {
  border-bottom: 0;
}

.data-row strong,
.data-row em {
  display: block;
}

.data-row em {
  margin-top: 3px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.page-table {
  width: 100%;
  border-collapse: collapse;
}

.page-table th,
.page-table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.page-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.page-table td {
  font-weight: 700;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.mini-badge.growth,
.mini-badge.todo {
  color: #3153dd;
  background: #eef3ff;
}

.mini-badge.maintain,
.mini-badge.progress {
  color: #128b63;
  background: #e9fbf4;
}

.mini-badge.watch,
.mini-badge.hold {
  color: #b47705;
  background: #fff5dc;
}

.mini-badge.end,
.mini-badge.done {
  color: #7c8491;
  background: #f0f2f5;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.day-cell,
.weekday {
  min-height: 42px;
  border-radius: var(--radius);
  padding: 9px;
}

.weekday {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.day-cell {
  min-height: 96px;
  border: 1px solid var(--line);
  background: #fff;
}

.day-cell.is-muted {
  color: #b5bbc6;
  background: #fafafa;
}

.day-cell.is-today {
  border-color: #cdd8ff;
  background: #f5f7ff;
}

.day-cell strong {
  display: block;
  margin-bottom: 8px;
}

.calendar-event {
  display: block;
  margin-top: 6px;
  padding: 5px 7px;
  border-radius: 6px;
  color: #3153dd;
  background: #eef3ff;
  font-size: 11px;
  font-weight: 800;
}

.insight-stack {
  display: grid;
  gap: 12px;
}

.insight-note,
.memo-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.insight-note {
  border-color: #e4defb;
  background: #fbf8ff;
}

.insight-note strong {
  display: block;
  margin-bottom: 7px;
  color: #5332c5;
}

.insight-note p,
.memo-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.memo-card {
  display: grid;
  gap: 10px;
}

.setting-list {
  display: grid;
  gap: 10px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.setting-row em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.toggle {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #d7dce5;
}

.toggle.is-on {
  background: var(--blue);
}

@media (max-width: 1320px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-grid,
  .page-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-card,
  .insight-card {
    grid-column: span 2;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .sidebar-brand { padding: 18px 10px 14px; }
  .brand-logo { width: 42px; }

  .nav-list { padding: 12px 8px; gap: 2px; }

  .nav-item {
    justify-content: center;
    padding: 0;
    height: 46px;
    border-radius: 10px;
  }
  .nav-item span { display: none; }
  .nav-item svg { width: 20px; height: 20px; }

  .sidebar-footer { padding: 10px 8px; }
  .sidebar-user { padding: 8px; justify-content: center; }
  .sidebar-user div { display: none; }
  .sidebar-user-dot { width: 9px; height: 9px; }

  .topbar,
  .toolbar {
    align-items: stretch;
  }

  .topbar {
    display: grid;
  }

  .toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .search-box {
    width: 100%;
  }
}

/* ══ 모바일 (≤760px) ══════════════════════════════════════════════════════ */
@media (max-width: 760px) {
  body { padding-bottom: 66px; background: #f2f4f8; }

  .app-shell { display: block; }

  /* ── 하단 탭바 ── */
  .sidebar {
    position: fixed;
    z-index: 20;
    right: 0; bottom: 0; left: 0; top: auto;
    height: 62px;
    flex-direction: row;
    padding: 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 -6px 24px rgba(0,0,0,0.32);
  }
  .sidebar-brand, .sidebar-footer { display: none; }
  .nav-list {
    flex-direction: row; flex: 1;
    padding: 5px 6px; gap: 2px; overflow: hidden;
  }
  .nav-item {
    flex: 1; flex-direction: column;
    height: auto; padding: 5px 2px 4px;
    gap: 3px; border-radius: 8px;
    font-size: 9px; font-weight: 700;
    justify-content: center; align-items: center;
  }
  .nav-item span { display: block; font-size: 9px; opacity: 0.85; }
  .nav-item svg { width: 19px; height: 19px; }
  .nav-item.is-active::before { display: none; }
  .nav-item.is-active {
    color: #f0b943;
    background: rgba(215,147,49,0.15);
  }
  .nav-item.is-active span { opacity: 1; }

  /* ── 모바일 상단 바 ── */
  .mobile-top-bar {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; top: 0; left: 0; right: 0; z-index: 30;
    height: 52px; padding: 0 14px;
    background: linear-gradient(180deg, #111827, #0c1520);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  }
  .mobile-top-logo-link img {
    height: 34px; width: auto;
    border-radius: 7px;
    background: #fff;
    padding: 4px 12px;
    display: block;
  }

  /* ── 메인 영역 ── */
  .main { padding: 14px 12px 12px; }
  body { padding-top: 52px; } /* 상단 바 높이만큼 오프셋 */

  /* ── 모바일 토바: 로고+검색 ── */
  .topbar {
    display: flex; flex-direction: column;
    gap: 10px; margin-bottom: 14px; align-items: stretch;
  }
  .topbar-greeting { display: none; }
  .topbar-mobile-logo {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 2px;
  }
  .topbar-mobile-logo {
    justify-content: center;
    margin-bottom: 4px;
  }
  .topbar-mobile-logo img {
    height: 80px; width: auto;
    max-width: 240px;
    border-radius: 12px;
    background: #fff;
    padding: 10px 24px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.13);
    display: block;
  }
  .toolbar {
    display: flex; gap: 8px; align-items: center;
  }
  .search-box {
    flex: 1; width: 100%; height: 38px;
    padding: 0 12px 0 14px;
  }
  .add-button { height: 38px; padding: 0 14px; }

  /* ── 스탯 그리드: 2×2 ── */
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
    margin-bottom: 14px;
  }

  /* 스탯 카드: 세로 중앙 정렬, 컴팩트 */
  .stat-card {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    padding: 16px 10px 14px;
    min-height: 0;
    border-radius: 14px;
    gap: 6px;
  }
  .stat-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: grid; place-items: center;
  }
  .stat-icon svg { width: 22px; height: 22px; }
  .stat-card p {
    margin: 0; font-size: 11px; font-weight: 700;
    color: var(--muted); order: -1;
    /* 아이콘 위에 레이블 */
  }
  .stat-card strong {
    font-size: 26px; line-height: 1; margin: 0;
  }
  .stat-card strong span { font-size: 13px; margin-left: 2px; }
  .stat-card em { display: none; } /* 서브텍스트 숨김 */

  /* ── 콘텐츠 그리드: 단일 컬럼 ── */
  .content-grid,
  .page-grid,
  .page-grid.three {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .action-card, .insight-card { grid-column: auto; }

  /* ── 패널 ── */
  .panel { padding: 14px; border-radius: 12px; }
  .panel-head { margin-bottom: 12px; }
  .panel-head h2 { font-size: 14px; }

  /* ── 상태 도넛: 세로 ── */
  .status-layout { grid-template-columns: 1fr; gap: 14px; }
  .donut { width: 130px; height: 130px; }

  /* ── 기록 리스트 ── */
  .record-row {
    grid-template-columns: auto minmax(0,1fr) auto;
    gap: 8px; min-height: 42px;
  }
  .record-row .mood { display: none; }
  .record-row .avatar { width: 36px; height: 36px; }

  /* ── 인사이트 카드 ── */
  .insight-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .insight-card svg { display: none; }
  .insight-card h2 { font-size: 15px; margin-bottom: 10px; }
  .insight-card strong { font-size: 13px; }

  /* ── 테이블 → 카드 (CSS Grid 방식 — 신뢰성 높음) ── */
  .wide-panel { overflow-x: visible; }
  .page-table { min-width: 0; width: 100%; }
  .page-table, .page-table tbody { display: block; }
  .page-table thead { display: none; }

  /* tr을 그리드 컨테이너로 */
  .page-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: box-shadow 0.15s;
  }
  .page-table tr:hover { box-shadow: 0 4px 16px rgba(76,111,255,0.1); }
  .page-table tr.is-selected { border-color: #4c6fff; background: #f5f7ff; }

  /* 이름 셀 — 전체 너비 헤더 */
  .page-table td.td-name {
    grid-column: 1 / -1;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, #f4f7ff 0%, #fff 100%);
  }
  .td-status-mobile { display: none; }    /* 이름 행에서 상태 제거 */

  /* data-label 셀 — 그리드 자동 배치 */
  .page-table td[data-label] {
    display: flex; flex-direction: column;
    padding: 10px 14px;
    font-size: 13px; font-weight: 700;
    border-bottom: 1px solid var(--line);
    min-width: 0; overflow: hidden;
  }
  /* 홀수 셀 오른쪽 구분선 */
  .page-table td[data-label]:nth-child(odd) {
    border-right: 1px solid var(--line);
  }
  /* 마지막 행 하단 테두리 제거 */
  .page-table tr > td:nth-last-child(1),
  .page-table tr > td:nth-last-child(2) {
    border-bottom: 0;
  }

  /* 레이블 */
  .page-table td[data-label]::before {
    content: attr(data-label);
    font-size: 10px; font-weight: 900;
    color: var(--muted);
    text-transform: uppercase; letter-spacing: .05em;
    margin-bottom: 4px; display: block;
  }

  /* 불필요 열 숨김 */
  .page-table td:nth-child(n+8) { display: none; }

  /* ── 모달 → 전체 페이지 변환 (모바일 네이티브 느낌) ── */
  .modal-overlay {
    padding: 0 !important;
    display: none;
    position: fixed;
    inset: 0;
    background: #f2f4f8;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 100;
  }
  .modal-overlay.open {
    display: block !important;      /* flex 아님 — 블록으로 전체화면 */
  }
  .modal-box {
    width: 100% !important;
    min-height: 100% !important;
    max-height: none !important;
    height: auto !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    animation: none !important;
    background: #f2f4f8;
    display: flex !important;
    flex-direction: column !important;
  }
  /* 상단 바 — 고정 */
  .modal-header {
    position: sticky; top: 0; z-index: 10;
    background: #fff;
    padding: 14px 16px !important;
    border-bottom: 1px solid var(--line);
    border-radius: 0 !important;
  }
  /* X버튼 → ← 뒤로 느낌 */
  .modal-x { background: #f0f2f6; }
  /* 바디 — 자연스러운 스크롤 */
  .modal-body {
    flex: 1 !important;
    overflow: visible !important;   /* 페이지 자체가 스크롤 */
    padding: 16px 14px 0 !important;
    height: auto !important;
    min-height: 0 !important;
  }
  /* 하단 저장 버튼 — 고정 */
  .modal-footer {
    position: sticky; bottom: 0;
    background: #fff;
    padding: 12px 16px 28px !important;
    border-top: 1px solid var(--line);
    border-radius: 0 !important;
  }
  /* 섹션 구분 */
  .form-section { margin-bottom: 20px; }
  .form-section-title { margin-bottom: 12px; }

  /* ── 폼 그리드 ── */
  .form-grid, .status-options { grid-template-columns: 1fr; }
  .upload-field { flex-direction: column; align-items: flex-start; }

  /* ── 캘린더 ── */
  .calendar-grid { gap: 3px; }
  .day-cell { min-height: 60px; padding: 5px; font-size: 12px; }
  .calendar-event { font-size: 10px; padding: 3px 5px; }

  /* ── 모달 ── */
  .modal-overlay { padding: 12px 8px 40px; align-items: flex-end; }
  .modal-box {
    border-radius: 18px 18px 14px 14px;
    max-height: 90vh;
  }
  .modal-header { padding: 16px 18px; }
  .modal-body { padding: 16px 16px 4px; }
  .modal-footer { padding: 12px 16px; }
  .form-grid.cols-3,
  .form-grid.cols-4 { grid-template-columns: 1fr 1fr; }
  .status-options { grid-template-columns: repeat(2, 1fr); }

  /* ── 상세 패널 ── */
  .detail-panel { width: 100%; right: -100%; }

  /* ── 랭크 리스트 ── */
  .rank-list div {
    grid-template-columns: 18px auto 44px minmax(0,1fr) 30px;
    gap: 8px;
  }
  .rank-list strong { font-size: 12px; }
}

/* ══ 모달 전면 재설계 ═══════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(12, 18, 35, 0.60);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
  padding: 32px 16px 60px;
}
.modal-overlay.open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.modal-box {
  background: #fff;
  border-radius: 20px;
  width: min(1020px, 96vw);
  box-shadow:
    0 32px 80px rgba(12,18,35,0.22),
    0 0 0 1px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-in 0.22s cubic-bezier(.34,1.3,.64,1);
}
@keyframes modal-in {
  from { opacity:0; transform:translateY(18px) scale(0.97); }
  to   { opacity:1; transform:none; }
}

/* 헤더 */
.modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, #f8faff, #fff);
  flex-shrink: 0;
}
.modal-header-icon {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.modal-header-icon svg {
  width: 22px; height: 22px;
  fill: none; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.modal-header-text { flex: 1; min-width: 0; }
.modal-header-text h3 { margin: 0 0 3px; font-size: 17px; font-weight: 900; }
.modal-header-text p  { margin: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.modal-x {
  width: 36px; height: 36px;
  border-radius: 50%; border: 0;
  background: #f0f2f6;
  cursor: pointer; font-size: 17px;
  display: grid; place-items: center;
  color: var(--muted); flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.modal-x:hover { background: #e0e3ec; color: var(--ink); }

/* 바디 */
.modal-body { flex: 1; padding: 28px 28px 8px; overflow-y: auto; }

/* 섹션 */
.form-section { margin-bottom: 28px; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px; font-weight: 900;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.form-section-title::before {
  content: '';
  display: block;
  width: 3px; height: 14px;
  border-radius: 99px;
  background: var(--blue);
}

/* 3열 그리드 (넓은 모달용) */
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

/* 폼 필드 개선 */
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1/-1; }
.field label {
  font-size: 12px; font-weight: 800;
  color: #3a4154; letter-spacing: .01em;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  height: 44px;
  border: 1.5px solid #e5e9f0;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 13px; font-family: inherit;
  color: var(--ink); background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #4c6fff;
  box-shadow: 0 0 0 3px rgba(76,111,255,0.1);
}
.field textarea {
  height: auto; min-height: 100px;
  padding: 12px 14px;
  resize: vertical; line-height: 1.65;
}
.field input::placeholder,
.field textarea::placeholder { color: #b0b8c8; }

/* 상태 옵션 카드 */
.status-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}
.status-option {
  cursor: pointer;
  display: flex; flex-direction: column; gap: 5px;
  padding: 15px 13px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: all 0.15s;
  user-select: none;
}
.status-option:hover { border-color: #a0b4ff; background: #f5f7ff; }
.status-option strong { font-size: 12px; font-weight: 900; }
.status-option em { font-style: normal; font-size: 11px; color: var(--muted); line-height: 1.45; }
.status-option.sel-growth  { border-color: var(--blue); background: #eef3ff; }
.status-option.sel-maintain{ border-color: var(--green); background: #f0fbf6; }
.status-option.sel-watch   { border-color: #f5bc38; background: #fffbf0; }
.status-option.sel-end     { border-color: var(--gray); background: #f5f6f8; }

/* 칩 개선 */
.chip-group { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center;
  min-height: 32px; padding: 0 14px;
  border: 1.5px solid #e5e8ef;
  border-radius: 999px;
  color: #596171; background: #fff;
  font-size: 12px; font-weight: 700;
  cursor: pointer; user-select: none;
  transition: all 0.14s;
}
.chip:hover { border-color: #a0b0ff; color: #3153dd; background: #f5f7ff; }
.chip.is-selected {
  color: #3153dd; border-color: #4c6fff;
  background: #eef3ff;
  box-shadow: 0 0 0 3px rgba(76,111,255,0.1);
}

/* 업로드 필드 */
.upload-field {
  display: flex; align-items: center; gap: 18px;
  padding: 18px;
  border: 2px dashed #d4d9e5;
  border-radius: 12px; background: #fafbff;
  transition: border-color 0.15s;
}
.upload-field:hover { border-color: #8fa5ff; }
.upload-field input[type="file"] {
  min-height: auto; height: auto; padding: 0;
  border: 0; background: transparent; font-size: 12px;
}
.upload-field p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }

/* 푸터 */
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 28px;
  border-top: 1px solid var(--line);
  background: #f8f9fb;
  flex-shrink: 0;
}
.modal-footer button {
  height: 42px; padding: 0 28px;
  border-radius: 10px; font-weight: 800;
  font-size: 14px; cursor: pointer;
  transition: all 0.15s;
}
.modal-footer .save {
  background: linear-gradient(135deg, #1c2a42, #101827);
  color: #fff; border: 0;
  box-shadow: 0 2px 8px rgba(16,24,39,0.22);
}
.modal-footer .save:hover { box-shadow: 0 4px 14px rgba(16,24,39,0.32); transform: translateY(-1px); }
.modal-footer .cancel {
  background: #fff; color: #596171;
  border: 1.5px solid #e5e8ef;
}
.modal-footer .cancel:hover { background: #f5f6f8; }

@media (max-width: 760px) {
  .modal-overlay { padding: 16px 8px 40px; }
  .modal-box { border-radius: 16px; }
  .modal-header { padding: 16px 18px; }
  .modal-body { padding: 18px 18px 6px; }
  .modal-footer { padding: 14px 18px; }
  .form-grid.cols-3,
  .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .status-options { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 480px) {
  .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
}

/* ── 테이블 셀 중앙 정렬 ─────────────────────────────────────────────── */
.page-table th,
.page-table td {
  vertical-align: middle;
  text-align: center;
}
.page-table th:first-child,
.page-table td:first-child { text-align: center; }

.page-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}
.page-table tbody tr:hover { background: #f5f7ff; }
.page-table tbody tr.is-selected { background: #eef3ff; }

/* ══ 상세 슬라이드 패널 전면 재설계 ══════════════════════════════════════ */
.detail-backdrop {
  display: none; position: fixed; inset: 0;
  z-index: 150; background: rgba(12,18,35,.3);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.detail-backdrop.open { display: block; }

.detail-panel {
  position: fixed; top: 0; right: -500px; z-index: 160;
  width: 480px; max-width: 96vw; height: 100vh;
  background: #f4f6fa;
  box-shadow: -4px 0 48px rgba(12,18,35,.16);
  display: flex; flex-direction: column;
  transition: right 0.3s cubic-bezier(.4,0,.2,1);
}
.detail-panel.open { right: 0; }

/* 최상단 바 — 패널 위에 float, X버튼만 노출 */
.detail-header {
  position: absolute; top: 12px; right: 14px; z-index: 20;
  padding: 0;
  background: transparent;
}
.detail-header h3 { display: none; }
.detail-close {
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  cursor: pointer; font-size: 15px;
  display: grid; place-items: center; color: #555;
  transition: background .15s, color .15s; line-height: 1;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.detail-close:hover { background: #fff; color: var(--ink); }

/* 스크롤 영역 — 내용이 길면 스크롤 */
.detail-scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 0;
  -webkit-overflow-scrolling: touch;
}

/* 히어로 영역 — overflow 제거, 상단 패딩으로 X버튼 회피 */
.detail-hero {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  padding: 56px 24px 26px;   /* 상단 56px: X버튼(34px) + 여유 */
  /* background는 JS에서 inline style로 주입 */
}
.detail-hero-ring {
  width: 108px; height: 108px; border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, #fff, rgba(255,255,255,.6));
  box-shadow: 0 8px 28px rgba(12,18,35,.18);
  flex-shrink: 0;
}
.detail-hero-avatar {
  width: 100%; height: 100%; border-radius: 50%;
  background: linear-gradient(145deg,#e8efff,#fff3e0);
  overflow: hidden; display: grid; place-items: center;
  font-size: 34px; font-weight: 900; color: #3f57d9;
}
.detail-hero-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}
.detail-hero-name {
  font-size: 22px; font-weight: 900;
  color: var(--ink); text-align: center; margin: 2px 0 0;
}
.detail-hero-sub {
  font-size: 13px; color: var(--muted); font-weight: 600; text-align: center;
}
.detail-hero .mini-badge {
  font-size: 12px; padding: 0 14px; min-height: 28px; margin-top: 2px;
}

/* 섹션 카드 — overflow 제거로 내용 잘림 방지 */
.detail-card {
  background: #fff;
  margin: 12px 14px 0;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.detail-card:last-child { margin-bottom: 14px; }
.detail-card-title {
  display: flex; align-items: center; gap: 7px;
  padding: 13px 16px 11px;
  font-size: 11px; font-weight: 900;
  color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--line);
}
.detail-card-title::before {
  content: ''; width: 3px; height: 12px;
  border-radius: 99px; background: var(--blue);
}
.detail-card-body { padding: 14px 16px; }

/* 메타 그리드 */
.detail-meta-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.detail-meta-item { }
.detail-meta-item dt {
  font-size: 10px; font-weight: 900; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px;
}
.detail-meta-item dd {
  margin: 0; font-size: 13px; font-weight: 700; color: var(--ink); word-break: break-word;
}
.detail-meta-item.full { grid-column: 1/-1; }

/* 칩 (needs/value) */
.detail-chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-chip {
  display: inline-flex; align-items: center;
  padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  background: #eef3ff; color: #3153dd;
  border: 1px solid #cdd8ff;
}
.detail-chip.green { background: #e9fbf4; color: #128b63; border-color: #a7ead3; }
.detail-chip.muted { background: #f0f2f5; color: #7c8491; border-color: #dde0e6; }

/* 만남 기록 타임라인 */
.detail-log-item {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.detail-log-item:last-child { border-bottom: 0; padding-bottom: 0; }
.detail-log-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  margin-top: 4px; background: #d0d5df;
}
.detail-log-dot.good    { background: var(--green); }
.detail-log-dot.normal  { background: #f5bc38; }
.detail-log-dot.bad     { background: var(--red); }
.detail-log-content { flex: 1; min-width: 0; }
.detail-log-meta {
  display: flex; align-items: center; gap: 8px; margin-bottom: 5px;
}
.detail-log-date { font-size: 11px; color: var(--muted); font-weight: 700; }
.detail-log-text { font-size: 13px; line-height: 1.55; color: var(--ink); }
.detail-log-next {
  margin-top: 6px; font-size: 12px; font-weight: 700;
  color: #4c6fff; display: flex; align-items: center; gap: 4px;
}

/* 예정 액션 */
.detail-action-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.detail-action-item:last-child { border-bottom: 0; }
.detail-action-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue); flex-shrink: 0;
}
.detail-action-text { flex: 1; font-size: 13px; font-weight: 700; }
.detail-action-due { font-size: 11px; color: var(--muted); }

/* 하단 액션 바 — 버튼 소형화 */
.detail-actions-bar {
  display: flex; gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: #fff; flex-shrink: 0;
}
.detail-actions-bar .btn-edit {
  flex: 1; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg,#1c2a42,#101827);
  color: #fff; border: 0;
  font-weight: 700; font-size: 13px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(16,24,39,.18);
  transition: all .15s;
}
.detail-actions-bar .btn-edit:hover {
  box-shadow: 0 3px 10px rgba(16,24,39,.28); transform: translateY(-1px);
}
.detail-actions-bar .btn-delete {
  flex: 1; height: 36px; border-radius: 8px;
  background: #fff; color: #c42b2b;
  border: 1.5px solid #f5bcbc;
  font-weight: 700; font-size: 13px; cursor: pointer;
  transition: all .15s;
}
.detail-actions-bar .btn-delete:hover { background: #fff0f0; }

/* ── 리스트 행 스타일 ────────────────────────────────────────────────── */
.record-row { cursor: pointer; transition: background 0.15s; border-radius: 6px; }
.record-row:hover { background: #f5f7ff; }
.record-row .avatar { width: 46px; height: 46px; font-size: 16px; }

.data-row { cursor: pointer; transition: background 0.15s; }
.data-row:hover { background: #f5f7ff; }
.data-row .avatar { width: 44px; height: 44px; font-size: 15px; }

@media (max-width: 760px) {
  .detail-panel { width: 100%; right: -100%; }
}
