@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #3182f6;
  --primary-light: #e8f3ff;
  --primary-dark: #1b64da;
  --success: #00c471;
  --success-light: #e8faf0;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #f04452;
  --danger-light: #fff0f1;
  --purple: #8b5cf6;
  --purple-light: #f3f0ff;
  --bg: #f7f8fa;
  --card: #ffffff;
  --border: #f0f0f4;
  --text-primary: #191f28;
  --text-secondary: #4e5968;
  --text-tertiary: #8b95a1;
  --text-disabled: #b0b8c1;
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.09);
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ================================
   HEADER - 토스 앱 스타일 내비게이션
   ================================ */
header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.92);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
}

header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}

.quick-record-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s var(--ease);
  box-shadow: 0 2px 8px rgba(49,130,246,0.25);
}

.quick-record-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(49,130,246,0.35);
}

nav {
  display: flex;
  gap: 2px;
}

.tab-btn {
  padding: 10px 18px 12px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  transition: all 0.15s;
  letter-spacing: -0.2px;
}

.tab-btn:hover { color: var(--text-secondary); }

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ================================
   MAIN LAYOUT
   ================================ */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

.tab-content {
  display: none;
  animation: fadeUp 0.25s var(--ease);
}
.tab-content.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================================
   DASHBOARD
   ================================ */
.dash-greeting {
  margin-bottom: 28px;
}
.dash-greeting h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--text-primary);
}
.dash-greeting p {
  font-size: 15px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* 숫자 카드 */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: default;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card .stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.8px;
}
.stat-card .stat-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.stat-card .stat-sub .up { color: var(--success); font-weight: 600; }
.stat-card .stat-sub .down { color: var(--danger); font-weight: 600; }

.stat-card.blue .stat-value { color: var(--primary); }
.stat-card.green .stat-value { color: var(--success); }
.stat-card.amber .stat-value { color: var(--warning); }
.stat-card.purple .stat-value { color: var(--purple); }

/* 대시보드 카드 공통 */
.dash-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 16px;
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.dash-card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.dash-card-header .view-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}
.dash-card-header .view-all:hover { color: var(--primary); }

/* 대시보드 2-column */
.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* 대시보드 3-column */
.dash-three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* 차트 영역 */
.chart-area {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 180px;
}

.chart-wrap {
  position: relative;
  flex-shrink: 0;
}
.chart-wrap canvas { display: block; }
.chart-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  text-align: center;
  pointer-events: none;
}
.chart-center .big { font-size: 22px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; }
.chart-center .small { font-size: 11px; color: var(--text-tertiary); }

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.legend-row:hover { background: var(--bg); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.legend-label { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-val { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.legend-pct { font-size: 11px; color: var(--text-tertiary); margin-left: 2px; }

/* 대시보드 아이템 리스트 */
.dash-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  border-radius: 6px;
}
.dash-list-item:last-child { border-bottom: none; }
.dash-list-item:hover { background: var(--bg); }

.dash-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.dash-list-info { flex: 1; min-width: 0; }
.dash-list-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-list-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-list-right {
  text-align: right;
  flex-shrink: 0;
}
.dash-list-right .time {
  font-size: 12px;
  color: var(--text-tertiary);
}
.dash-list-right .badge-small {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* 딜 파이프라인 (미니) */
.pipeline-mini { display: flex; gap: 4px; align-items: flex-end; height: 48px; padding-top: 8px; }
.pipeline-bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  position: relative;
  transition: all 0.3s var(--ease);
}
.pipeline-bar:hover { opacity: 0.85; transform: scaleY(1.05); transform-origin: bottom; }
.pipeline-labels { display: flex; gap: 4px; margin-top: 6px; }
.pipeline-label {
  flex: 1;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
}
.pipeline-count {
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 2px;
}

/* 주간 통화 히트맵 */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.week-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  transition: transform 0.15s;
}
.week-cell:hover { transform: scale(1.08); }
.week-cell .day { margin-bottom: 2px; }
.week-cell .count { font-size: 14px; font-weight: 800; color: var(--text-primary); }

/* 연락 안 한 지 오래된 리스트 */
.stale-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}
.stale-item:last-child { border-bottom: none; }
.stale-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.stale-info { flex: 1; min-width: 0; }
.stale-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.stale-detail { font-size: 11px; color: var(--text-tertiary); }
.stale-days {
  font-size: 12px; font-weight: 700; color: var(--danger);
  flex-shrink: 0;
}

/* ================================
   SECTION HEADER (연락처, 통화, 딜)
   ================================ */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-header h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
}
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ================================
   INPUTS
   ================================ */
.search-input {
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  width: 260px;
  outline: none;
  transition: all 0.15s;
  background: var(--bg);
  font-family: inherit;
}
.search-input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(49,130,246,0.1);
}

select {
  padding: 10px 32px 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: white;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: all 0.15s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b95a1' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(49,130,246,0.1);
}

/* ================================
   BUTTONS
   ================================ */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: inherit;
}
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 6px rgba(49,130,246,0.2);
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(49,130,246,0.3);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg);
  color: var(--text-secondary);
}
.btn-secondary:hover { background: #e9ebee; color: var(--text-primary); }
.btn-danger { background: var(--danger-light); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 6px; }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 14px;
}
.btn-ghost:hover { background: var(--bg); color: var(--text-primary); }

/* ================================
   LIST ITEMS
   ================================ */
.list-container { display: flex; flex-direction: column; gap: 6px; }

.list-item {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-xs);
}
.list-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.list-item:active { transform: translateY(0); box-shadow: var(--shadow-xs); }

.list-item-info { flex: 1; min-width: 0; }
.list-item-info h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 3px;
  letter-spacing: -0.2px;
}
.list-item-info p {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-actions {
  display: flex; gap: 4px; flex-shrink: 0;
  opacity: 0; transition: opacity 0.15s;
}
.list-item:hover .list-item-actions { opacity: 1; }

/* ================================
   BADGES
   ================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.1px;
}
.badge-검토중 { background: var(--warning-light); color: #92400e; }
.badge-진행중 { background: var(--primary-light); color: #1b64da; }
.badge-완료   { background: var(--success-light); color: #047857; }
.badge-무산   { background: var(--danger-light); color: #b91c1c; }

.badge-부동산  { background: #ecfdf5; color: #065f46; }
.badge-인프라  { background: #eff6ff; color: #1e40af; }
.badge-PEF     { background: #f5f3ff; color: #6d28d9; }
.badge-사모대출 { background: #fff7ed; color: #9a3412; }

.badge-google {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: #4285F4; color: white;
  font-size: 10px; font-weight: 700;
  vertical-align: middle; margin-left: 4px;
}

/* ================================
   GOOGLE SYNC BAR
   ================================ */
.google-sync-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}
.google-connected-badge { color: var(--success); font-weight: 600; font-size: 14px; }
.google-disconnected-badge { color: var(--text-tertiary); font-size: 14px; }
#google-actions { display: flex; gap: 8px; align-items: center; }
.btn-google {
  display: inline-flex; align-items: center;
  padding: 8px 16px;
  background: white; border: 1.5px solid #e0e0e0;
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600; color: #3c4043;
  cursor: pointer; transition: all 0.15s;
  font-family: inherit;
}
.btn-google:hover { background: #f8f9fa; box-shadow: var(--shadow-sm); }
.btn-google-sync {
  padding: 8px 16px;
  background: var(--primary); color: white;
  border: none; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.15s;
}
.btn-google-sync:hover { background: var(--primary-dark); }
.btn-google-sync:disabled { opacity: 0.5; cursor: not-allowed; }

/* ================================
   DEAL TOGGLE / NEW DEAL BOX
   ================================ */
.deal-toggle {
  display: flex; gap: 4px;
  background: var(--bg); padding: 3px; border-radius: var(--radius-md);
}
.deal-toggle-btn {
  flex: 1; padding: 8px 12px; border: none;
  background: transparent; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.deal-toggle-btn.active {
  background: white; color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.new-deal-box {
  background: var(--bg); border-radius: var(--radius-lg);
  padding: 18px; margin-top: 8px;
}

/* ================================
   FILE ITEMS
   ================================ */
.file-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; background: var(--bg);
  border-radius: var(--radius-sm); margin-bottom: 4px;
  transition: background 0.12s;
}
.file-item:hover { background: #eceef1; }
.file-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.file-icon { font-size: 20px; flex-shrink: 0; }
.file-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 11px; color: var(--text-tertiary); }
.file-actions { display: flex; gap: 4px; flex-shrink: 0; margin-left: 8px; }
.file-actions a { text-decoration: none; }

/* ================================
   MODAL
   ================================ */
.modal-overlay {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 16px;
  overflow-y: auto;
}
.modal-overlay.show { display: flex; }

.modal {
  background: var(--card);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 540px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 60px;
  animation: modalSlide 0.22s var(--ease);
}
@keyframes modalSlide {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.3px; color: var(--text-primary);
  margin-bottom: 0;
}
.modal-close {
  background: var(--bg); border: none;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-tertiary);
  transition: all 0.15s;
}
.modal-close:hover { background: #e5e7ea; color: var(--text-primary); }
.modal-body { padding: 24px; }

/* ================================
   FORMS
   ================================ */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px; font-family: inherit;
  outline: none; transition: all 0.15s;
  background: var(--bg);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(49,130,246,0.08);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-disabled); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 24px;
}
.form-actions .btn-primary { padding: 12px 28px; font-size: 15px; border-radius: 14px; }
.form-actions .btn-secondary { padding: 12px 20px; font-size: 15px; border-radius: 14px; }

/* ================================
   CONTACT AUTOCOMPLETE (모달 내)
   ================================ */
.contact-ac-wrap { position: relative; }
.contact-ac-input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px; font-family: inherit;
  outline: none; background: var(--bg);
  transition: all 0.15s;
}
.contact-ac-input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(49,130,246,0.08);
}
.contact-ac-input::placeholder { color: var(--text-disabled); }
.contact-ac-list {
  position: absolute; top: calc(100% + 4px);
  left: 0; right: 0; z-index: 20;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 220px; overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  display: none;
}
.contact-ac-list.show { display: block; }
.contact-ac-item {
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.contact-ac-item:last-child { border-bottom: none; }
.contact-ac-item:hover { background: var(--bg); }
.contact-ac-item .ac-name {
  font-size: 14px; font-weight: 600; color: var(--text-primary);
}
.contact-ac-item .ac-sub {
  font-size: 12px; color: var(--text-tertiary); margin-top: 1px;
}
.contact-ac-selected {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  background: var(--primary-light);
  border-radius: var(--radius-md);
  margin-top: 6px;
}
.contact-ac-selected .ac-sel-name {
  font-size: 15px; font-weight: 600; color: var(--text-primary);
}
.contact-ac-selected .ac-sel-sub {
  font-size: 12px; color: var(--text-tertiary);
}
.contact-ac-selected .ac-sel-remove {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: var(--text-tertiary);
  padding: 2px 6px; border-radius: 6px;
  transition: all 0.12s;
}
.contact-ac-selected .ac-sel-remove:hover {
  background: rgba(0,0,0,0.06); color: var(--text-primary);
}

/* ================================
   DETAIL VIEW
   ================================ */
.detail-header { margin-bottom: 20px; }
.detail-header h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }
.detail-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-meta span { font-size: 13px; color: var(--text-secondary); }

.detail-section { margin-top: 24px; }
.detail-section h4 {
  font-size: 13px; font-weight: 700; color: var(--text-secondary);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-field { margin-bottom: 6px; }
.detail-field .label { font-size: 11px; color: var(--text-tertiary); font-weight: 500; margin-bottom: 2px; }
.detail-field .value { font-size: 15px; font-weight: 600; color: var(--text-primary); }

.call-item {
  padding: 12px 14px; background: var(--bg);
  border-radius: var(--radius-sm); margin-bottom: 6px;
  transition: background 0.12s;
}
.call-item:hover { background: #eceef1; }
.call-item .call-date { font-size: 11px; color: var(--text-tertiary); font-weight: 500; }
.call-item .call-summary { font-size: 13px; margin-top: 3px; color: var(--text-primary); line-height: 1.5; }
.call-item .call-contact { font-size: 11px; color: var(--primary); font-weight: 600; margin-top: 3px; }

/* ================================
   EMPTY STATE
   ================================ */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text-tertiary);
}
.empty-state p { font-size: 14px; }
.empty-icon { font-size: 36px; margin-bottom: 10px; opacity: 0.4; }

/* ================================
   BRIEFING CARD (오늘의 브리핑)
   ================================ */
.briefing-card {
  background: linear-gradient(135deg, #1b64da 0%, #3182f6 60%, #60a5fa 100%);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 20px;
  color: white;
  box-shadow: 0 8px 32px rgba(49,130,246,0.25);
}
.briefing-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.briefing-header h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: white;
}
.briefing-header p {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  margin-top: 4px;
}
.briefing-quick-actions {
  display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap;
}
.briefing-quick-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px;
  background: rgba(255,255,255,0.18);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  backdrop-filter: blur(4px);
}
.briefing-quick-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}
.briefing-alerts {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.briefing-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid rgba(255,255,255,0.08);
}
.briefing-alert:hover {
  background: rgba(255,255,255,0.2);
  transform: translateX(2px);
}
.briefing-alert-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
}
.briefing-alert-text {
  flex: 1; font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.92);
  line-height: 1.4;
}
.briefing-alert-text strong { font-weight: 700; color: white; }
.briefing-alert-arrow {
  color: rgba(255,255,255,0.4);
  font-size: 14px; flex-shrink: 0;
}

/* ================================
   WEEKLY REPORT (주간 리포트)
   ================================ */
.report-period {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.weekly-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.weekly-metric {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 14px;
}
.weekly-metric .wm-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 600;
  margin-bottom: 6px;
}
.weekly-metric .wm-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.weekly-metric .wm-change {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
}
.wm-change.up { background: var(--success-light); color: var(--success); }
.wm-change.down { background: var(--danger-light); color: var(--danger); }
.wm-change.same { background: var(--bg); color: var(--text-tertiary); }
.weekly-top-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.12s;
}
.weekly-top-contact:hover { background: #eceef1; }
.wtc-info { flex: 1; min-width: 0; }
.wtc-label { font-size: 11px; color: var(--text-tertiary); font-weight: 500; }
.wtc-name { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-top: 1px; }
.wtc-count { font-size: 20px; font-weight: 800; color: var(--primary); }

/* ================================
   RELATIONSHIP HEALTH (관계 건강도)
   ================================ */
.health-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.health-ring .dash-avatar,
.health-ring .stale-avatar {
  border: 2.5px solid transparent;
}
.health-ring.health-good .dash-avatar,
.health-ring.health-good .stale-avatar { border-color: var(--success); }
.health-ring.health-warn .dash-avatar,
.health-ring.health-warn .stale-avatar { border-color: var(--warning); }
.health-ring.health-cold .dash-avatar,
.health-ring.health-cold .stale-avatar { border-color: var(--danger); }

.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}
.health-badge.health-good { background: var(--success-light); color: var(--success); }
.health-badge.health-warn { background: var(--warning-light); color: #92400e; }
.health-badge.health-cold { background: var(--danger-light); color: var(--danger); }

.health-score-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.health-score-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s var(--ease);
}

/* ================================
   KANBAN BOARD (딜 칸반)
   ================================ */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: flex-start;
}
.kanban-col {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 14px;
  min-height: 200px;
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 10px;
  border-bottom: 2px solid transparent;
}
.kanban-col-header .col-title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kanban-col-header .col-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0,0,0,0.06);
}
.kanban-col.col-검토중 .kanban-col-header { border-bottom-color: var(--warning); }
.kanban-col.col-진행중 .kanban-col-header { border-bottom-color: var(--primary); }
.kanban-col.col-완료 .kanban-col-header { border-bottom-color: var(--success); }
.kanban-col.col-무산 .kanban-col-header { border-bottom-color: var(--danger); }

.kanban-col.col-검토중 .col-title { color: #92400e; }
.kanban-col.col-진행중 .col-title { color: var(--primary-dark); }
.kanban-col.col-완료 .col-title { color: #047857; }
.kanban-col.col-무산 .col-title { color: #b91c1c; }

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}
.kanban-cards.drag-over {
  background: rgba(49,130,246,0.06);
  border-radius: var(--radius-md);
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
}
.kanban-card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: grab;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s var(--ease);
  border: 1px solid var(--border);
}
.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.kanban-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}
.kanban-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
  line-height: 1.4;
}
.kanban-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.kanban-card-meta .badge { font-size: 10px; padding: 1px 7px; }
.kanban-card-detail {
  font-size: 11px;
  color: var(--text-tertiary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kanban-card-detail .kcd-rate {
  font-weight: 700;
  color: var(--text-secondary);
}
.kanban-card-detail .kcd-date {
  font-size: 10px;
}
.kanban-empty {
  text-align: center;
  padding: 20px 10px;
  font-size: 12px;
  color: var(--text-disabled);
}

/* 뷰 토글 */
.view-toggle {
  display: flex; gap: 2px;
  background: var(--bg); padding: 3px; border-radius: var(--radius-md);
}
.view-toggle-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border: none;
  background: transparent; border-radius: 10px;
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.view-toggle-btn.active {
  background: white; color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.view-toggle-btn svg { stroke: currentColor; }

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 900px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .dash-two-col, .dash-three-col { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  main { padding: 16px 14px 60px; }
  .header-inner { padding: 0 16px; }
  .briefing-card { padding: 20px; }
  .briefing-header { flex-direction: column; }
  .briefing-header h2 { font-size: 20px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 16px; }
  .stat-card .stat-value { font-size: 24px; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .header-actions { width: 100%; flex-wrap: wrap; }
  .search-input { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  nav { overflow-x: auto; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  .tab-btn { padding: 10px 14px; font-size: 13px; flex-shrink: 0; }
  .list-item { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px; }
  .list-item-actions { opacity: 1; width: 100%; justify-content: flex-end; }
  .google-sync-bar { flex-direction: column; gap: 10px; align-items: flex-start; }
  .chart-area { flex-direction: column; gap: 16px; }
  .chart-legend { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .modal { border-radius: var(--radius-xl) var(--radius-xl) 0 0; max-width: 100%; margin: auto 0 0; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .kanban-board { grid-template-columns: 1fr; }
  .kanban-col { min-height: auto; }
  .weekly-metrics { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
