:root {
  --sidebar-w: 240px;
  --topbar-h: 52px;
  --bg: #f0f2f5;
  --sidebar-bg: #ffffff;
  --surface: #ffffff;
  --text: #0d0d0d;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #10a37f;
  --accent-light: #e6f4f0;
  --blue: #2563eb;
  --blue-light: #eff6ff;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --nav-hover: #f3f4f6;
  --nav-active-bg: #e6f4f0;
  --nav-active-text: #0a7c5c;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  height: 100dvh;
  overflow: hidden;
}

/* ── Layout ── */
.app-layout {
  display: flex;
  height: 100dvh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  transition: transform 0.22s ease;
  z-index: 200;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.sidebar-close:hover { background: var(--nav-hover); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  margin-bottom: 1px;
}

.nav-item:hover {
  background: var(--nav-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
  font-weight: 600;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active .nav-icon { opacity: 1; }
.nav-item:hover .nav-icon { opacity: 0.9; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}

.sidebar-footer-link:hover {
  background: var(--nav-hover);
  color: var(--text);
}

/* ── Mobile overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 190;
}

/* ── Main wrap ── */
.main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  gap: 12px;
}

.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.hamburger:hover { background: var(--nav-hover); }

.page-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ── Content area ── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 48px;
}

.embedded-android body {
  overflow: auto;
}

.embedded-android .app-layout {
  display: block;
  height: auto;
  min-height: 100dvh;
}

.embedded-android .sidebar,
.embedded-android .sidebar-overlay,
.embedded-android .topbar {
  display: none !important;
}

.embedded-android .main-wrap {
  display: block;
  height: auto;
  min-height: 100dvh;
  overflow: visible;
}

.embedded-android .content {
  height: auto;
  min-height: 100dvh;
  overflow: visible;
  padding: 14px 14px 36px;
}

/* ── Components ── */
.hidden { display: none !important; }

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.metric {
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.metric strong {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
  color: var(--accent);
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

h2 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
}

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

.split {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.5fr);
  gap: 14px;
  align-items: start;
}

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

.panel-head h2 { margin: 0; }

.small-primary,
.manage-row button,
.form-actions button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.12s, background 0.12s;
}

.small-primary:hover { opacity: 0.88; }

.danger-btn {
  background: #fee2e2 !important;
  color: #b91c1c !important;
}

.secondary-btn {
  background: var(--accent-light) !important;
  color: var(--nav-active-text) !important;
}

.filters {
  display: grid;
  grid-template-columns: 130px minmax(140px, 1fr) minmax(130px, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9f9f9;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 7px 10px;
  transition: border-color 0.1s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #b0b0b0;
  background: #fff;
}

textarea { min-height: 72px; resize: vertical; }

.edit-form {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(200px, 2fr) minmax(110px, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.form-actions button:last-child {
  background: #f0f0f0;
  color: var(--text);
}

.form-actions button:last-child:hover { background: #e4e4e4; }

.list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid #f0f0f0;
}

.item:first-child {
  border-top: 0;
  padding-top: 0;
}

.manage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 60px 60px;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #f0f0f0;
}

.manage-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.company-card {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.company-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(16,163,127,0.10);
}

.company-card strong,
.company-card span,
.company-card small { display: block; }

.company-card span,
.company-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.record-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}

.record-type.meeting {
  background: #e6f3ee;
  color: #0a7c5c;
}

.record-type.call {
  background: #e8f0ff;
  color: #2457c5;
}

.detail-box {
  min-height: 160px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.detail-head,
.mini-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.detail-head h3,
.detail-section h3 { margin: 0; font-size: 14px; }

.detail-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.detail-section {
  margin-top: 0;
  border-top: 1px solid #f0f0f0;
}

/* 헤더+버튼 나란히 */
.section-header-with-extra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 4px;
}
.section-header-with-extra h3 { margin: 0; }

.company-card-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--card-bg));
}

.company-expand {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 14px;
  background: var(--card-bg);
  margin-bottom: 8px;
}

.detail-section h3 {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.mini-row {
  padding: 9px 0;
  border-top: 1px solid #f0f0f0;
}

.copy-report-btn {
  padding: 2px 10px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f4f4;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}
.copy-report-btn:hover { background: #e8e8e8; }

.toast-popup {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #222;
  color: #fff;
  padding: 10px 22px;
  border-radius: 20px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  pointer-events: none;
}
.toast-popup.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }

.kakao-report-body {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 10px 0 0;
  padding: 0;
  background: none;
  border: none;
  color: var(--text);
}

.full-report-body { line-height: 1.7; font-size: 14px; }
.full-report-body h4 { margin: 14px 0 4px; font-size: 14px; font-weight: 700; color: var(--fg); }
.full-report-body h5 { margin: 10px 0 3px; font-size: 13px; font-weight: 600; color: var(--muted); }
.full-report-body ul { margin: 4px 0 8px 18px; padding: 0; }
.full-report-body li { margin-bottom: 3px; }
.full-report-body p { margin: 6px 0; }

/* ── 영업 신호 ── */
.signal-list { display: flex; flex-direction: column; gap: 6px; }

.signal-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 9px 10px;
  border-radius: 8px;
  border-left: 3px solid transparent;
}

.signal-row.sig-high { background: #fff7ed; border-left-color: #ea580c; }
.signal-row.sig-med  { background: #eff6ff; border-left-color: var(--blue); }
.signal-row.sig-low  { background: #f9fafb; border-left-color: var(--line); }

.signal-icon { font-size: 16px; line-height: 1.4; }

.signal-body { min-width: 0; }
.signal-body strong { display: block; font-size: 13px; font-weight: 700; }
.signal-body span   { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); line-height: 1.35; }

.signal-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; white-space: nowrap; }

.signal-strength {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 99px;
  letter-spacing: 0.04em;
}
.sig-high .signal-strength { background: #fed7aa; color: #9a3412; }
.sig-med  .signal-strength { background: #dbeafe; color: #1e40af; }
.sig-low  .signal-strength { background: #f3f4f6; color: #6b7280; }

.signal-meta time { font-size: 11px; color: var(--muted); }

.hot-score-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 99px;
  background: #fff7ed;
  color: #ea580c;
}

/* ── HOT 고객 (대시보드) ── */
.hot-company-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #f0f0f0;
  transition: background 0.1s;
}
.hot-company-row:first-child { border-top: 0; padding-top: 0; }
.hot-company-row:hover { background: var(--accent-light); border-radius: 8px; padding-left: 6px; }

.hot-main strong { display: block; font-size: 14px; font-weight: 700; }
.hot-main span   { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.hot-signals { display: flex; gap: 5px; flex-wrap: wrap; }

.hot-signal-chip {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 99px;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 600;
  white-space: nowrap;
}

.hot-score {
  font-size: 13px;
  font-weight: 800;
  color: #ea580c;
  white-space: nowrap;
}

/* ── 이슈 태그 & 히스토리 ── */
.issue-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.issue-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}

.issue-tag-badge strong {
  font-size: 13px;
  font-weight: 800;
}

.history-table {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
  font-size: 13px;
}

.history-head {
  display: grid;
  grid-template-columns: 62px 80px 1fr 52px 72px;
  gap: 8px;
  padding: 4px 0 6px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.history-row {
  display: grid;
  grid-template-columns: 62px 80px 1fr 52px 72px;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #f5f5f5;
  align-items: center;
}

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

.hist-ym { font-weight: 700; color: var(--text); }
.hist-stage { color: var(--muted); font-size: 12px; }

.hist-trust {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hist-bar-wrap {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: #e5e7eb;
  overflow: hidden;
}

.hist-bar.trust-bar { height: 100%; background: var(--accent); border-radius: 99px; }

.hist-trust em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* ── 고객 정보 파악 시점 배지 ── */
.info-detected-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 11px;
  border-radius: 99px;
  background: #e8f5e9;
  color: #2e7d32;
  font-weight: 600;
  vertical-align: middle;
}

/* ── 월간 인사이트 패널 ── */
.monthly-insight-panel { margin-top: 8px; }
.insight-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--card-bg);
}
.insight-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.insight-ym {
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
}
.insight-stage-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
}
.insight-gen-btn {
  margin-left: auto;
  font-size: 12px;
  padding: 3px 10px;
}
.insight-summary { font-size: 13px; color: var(--text); line-height: 1.6; margin-bottom: 8px; }
.insight-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.insight-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  background: #f3f4f6;
  color: #374151;
  font-weight: 600;
}
.insight-scores { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.insight-score-item strong { color: var(--text); font-weight: 700; }

.insight-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 8px 0 4px;
}

.hist-risk { font-weight: 700; font-size: 13px; }

@media (max-width: 768px) {
  .history-head,
  .history-row { grid-template-columns: 58px 72px 1fr 44px 60px; gap: 6px; font-size: 12px; }
}

/* ── 회의 분위기 & 경쟁사 ── */
.mood-row {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mood-block {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mood-label {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.mood-bar-wrap {
  flex: 1;
  min-width: 80px;
  max-width: 160px;
  height: 6px;
  border-radius: 99px;
  background: #e5e7eb;
  overflow: hidden;
}

.mood-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}

.mood-score {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.mood-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mood-signal {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--accent-light);
  color: var(--nav-active-text);
  font-weight: 600;
}

.mood-concern {
  font-size: 12px;
  color: var(--warning);
  margin: 0;
}

.competitor-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.competitor-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.competitor-tag {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 99px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 600;
}

.mini-row:first-of-type { border-top: 0; }

.mini-row strong,
.mini-row span { display: block; }

.mini-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-item-wrap {
  border: 0;
}

.timeline-card {
  width: 100%;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.timeline-card-clickable {
  cursor: pointer;
}

.timeline-card-clickable:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.timeline-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: #f3f4f6;
  color: #374151;
}

.timeline-main {
  min-width: 0;
}

.timeline-main strong,
.timeline-main span,
.timeline-main small {
  display: block;
}

.timeline-main strong {
  font-size: 13px;
  line-height: 1.35;
}

.timeline-main span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-main small {
  margin-top: 5px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.timeline-call .timeline-dot { background: #dcfce7; color: #166534; }
.timeline-meeting .timeline-dot { background: #dbeafe; color: #1d4ed8; }
.timeline-action .timeline-dot { background: #fef3c7; color: #92400e; }
.timeline-promise .timeline-dot { background: #fce7f3; color: #9d174d; }
.timeline-schedule .timeline-dot { background: #ede9fe; color: #5b21b6; }

.row-actions {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}

.row-actions button,
.inline-form button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f4f4f4;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s;
}

.row-actions button:hover,
.inline-form button:hover { background: #eaeaea; }

.inline-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

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

.wide-field {
  grid-column: 1 / -1;
  min-height: 130px;
}

.notice {
  margin-top: 12px;
  color: #047857;
  font-size: 13px;
  font-weight: 500;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
  margin-bottom: 14px;
}

.result-group {
  margin-top: 18px;
}

.result-group h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.search-row {
  width: 100%;
  display: block;
  padding: 10px 0;
  border: 0;
  border-top: 1px solid #f0f0f0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.search-row strong,
.search-row span,
.search-row small { display: block; }

.search-row span,
.search-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.risk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.risk-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: left;
}

.risk-card strong,
.risk-card span,
.risk-card small { display: block; }

.risk-card strong { font-size: 1.7rem; font-weight: 700; }
.risk-card span { margin-top: 4px; font-size: 13px; font-weight: 600; }
.risk-card small { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }

.risk-card.high { border-color: #fecaca; background: #fff1f2; }
.risk-card.mid  { border-color: #fde68a; background: #fffbeb; }
.risk-card.low  { border-color: #bbf7d0; background: #f0fdf4; }

.button-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.button-grid button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f4f4;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s;
}

.button-grid button:hover { background: #eaeaea; }

.tg-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 14px;
  margin-bottom: 4px;
}

.tg-date-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tg-date-row input[type="date"] {
  flex: 1;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  background: #f4f4f4;
  color: var(--text);
}

.tg-date-row button {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f4f4;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.tg-date-row button:hover { background: #eaeaea; }

.candidate-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 10px;
}

.candidate-head strong,
.candidate-head span { display: block; }

.candidate-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

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

.check {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  color: var(--muted);
  font-size: 13px;
}

.check input { width: auto; min-height: auto; }

.overdue .title,
.overdue .date { color: var(--danger); }

.date {
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
}

.title {
  font-weight: 600;
  line-height: 1.4;
}

.meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.empty,
.error {
  color: var(--muted);
  font-size: 13px;
}

/* ── Calendar iframe ── */
.view-calendar {
  height: calc(100dvh - var(--topbar-h));
  margin: -20px -22px -48px;
  overflow: hidden;
}

.calendar-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    transform: translateX(-100%);
    box-shadow: 2px 0 16px rgba(0,0,0,0.1);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close { display: flex; }

  .sidebar-overlay.open { display: block; }

  .hamburger { display: flex; }

  .main-wrap { width: 100%; }

  .content { padding: 14px 14px 48px; }

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

  .grid,
  .follow-up-grid { grid-template-columns: 1fr; }

  .filters { grid-template-columns: 1fr; }

  .edit-form { grid-template-columns: 1fr; }

  .manage-row { grid-template-columns: 1fr 1fr; align-items: stretch; }

  .split { grid-template-columns: 1fr; }

  .inline-form { grid-template-columns: 1fr; }

  .upload-form { grid-template-columns: 1fr; }

  .search-form { grid-template-columns: minmax(0, 1fr) 80px; }

  .risk-grid { grid-template-columns: 1fr; }

  .button-grid { grid-template-columns: 1fr 1fr; }

  .two-cols { grid-template-columns: 1fr; }

  .detail-head,
  .mini-row { flex-direction: column; }

  .item { grid-template-columns: 60px minmax(0, 1fr); }
}

.workspace-login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.workspace-login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.workspace-login-card h1 {
  margin-bottom: 8px;
  font-size: 28px;
  letter-spacing: 0;
}

.workspace-login-card label {
  color: var(--muted);
  font-weight: 700;
}

.workspace-login-card button {
  margin-top: 8px;
}

.section-intro {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: -2px 0 14px;
  color: var(--muted);
}

.section-intro strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.section-intro span {
  font-size: 13px;
}

.today-focus-panel {
  margin-bottom: 14px;
}

.follow-up-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.follow-up-card {
  position: relative;
  width: 100%;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.follow-up-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.follow-score {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 30px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.follow-up-card strong {
  padding-right: 38px;
  font-size: 15px;
  line-height: 1.3;
}

.follow-up-card span,
.follow-up-card time {
  color: var(--muted);
  font-size: 12px;
}

.follow-up-card small {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}

.follow-up-card small em {
  padding: 2px 7px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.metric {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: end;
}

.metric span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.metric strong {
  margin: 0;
  font-size: 2rem;
  color: var(--accent);
}

.metric em {
  margin-bottom: 2px;
  color: var(--text);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.empty-state {
  padding: 16px 0;
  color: var(--muted);
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state strong {
  color: var(--text);
  font-weight: 700;
}

.empty-state span {
  margin-top: 4px;
  font-size: 12px;
}

.dash-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid #f0f0f0;
  width: 100%;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.dash-item:first-child { border-top: 0; padding-top: 0; }

.dash-main strong,
.dash-main span,
.dash-side time {
  display: block;
}

.dash-main strong {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.dash-main span,
.dash-side time {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.dash-side {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 74px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f2f2f2;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.active  { background: var(--accent-light); color: var(--nav-active-text); }
.badge.done    { background: #dcfce7; color: #047857; }
.badge.danger  { background: #fee2e2; color: #b91c1c; }
.badge.neutral { background: #f3f4f6; color: #4b5563; }
.badge.warn    { background: var(--warning-light); color: var(--warning); }

/* 날짜 상대표현 색상 */
time.date-today  { color: #0a7c5c; font-weight: 700; }
time.date-tomorrow { color: #2563eb; font-weight: 600; }
time.date-past   { color: var(--danger); }

.panel-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid #f0f0f0;
}

.task-card:first-child { border-top: 0; padding-top: 0; }

.task-body {
  min-width: 0;
}

.task-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.task-topline time {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.task-body strong,
.task-body span,
.task-body p {
  display: block;
}

.task-body strong {
  font-size: 15px;
  font-weight: 750;
  line-height: 1.4;
}

.task-body span,
.task-body p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.task-actions {
  display: grid;
  grid-template-columns: 124px 56px 56px;
  gap: 8px;
  align-items: start;
}

.task-actions button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: #f0f0f0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.task-card.overdue .task-body strong {
  color: var(--danger);
}

@media (max-width: 768px) {
  .section-intro {
    display: block;
  }

  .section-intro span {
    display: block;
    margin-top: 3px;
  }

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

  .metric {
    padding: 14px;
  }

  .dash-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .dash-side {
    justify-items: start;
    grid-auto-flow: column;
    justify-content: start;
  }

  .task-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .task-actions {
    grid-template-columns: minmax(0, 1fr) 64px 64px;
  }
}

.accept-btn {
  background: var(--accent-light) !important;
  color: var(--nav-active-text) !important;
}

.task-actions {
  grid-template-columns: 124px 88px 56px 56px;
}

@media (max-width: 768px) {
  .task-actions {
    grid-template-columns: minmax(0, 1fr) 92px repeat(2, 58px);
  }
}

/* ── Monthly Report ──────────────────────────────────── */
.report-stat-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.report-stat {
  flex: 1 1 80px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}
.report-stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}
.report-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.report-section {
  margin-bottom: 18px;
}
.report-section h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.report-summary-text {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.report-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.report-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.report-card-name {
  font-weight: 700;
  font-size: 0.95rem;
}
.report-score-badges {
  display: flex;
  gap: 5px;
}
.badge-deal, .badge-rel {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
}
.badge-deal {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}
.badge-rel {
  background: color-mix(in srgb, #10b981 15%, transparent);
  color: #10b981;
}
.report-card-signal, .report-card-issue {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.report-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.report-row:last-child {
  border-bottom: none;
}
.stagnant-row .report-row-name {
  font-weight: 600;
  min-width: 90px;
}
.stagnant-row .report-row-days {
  color: #f59e0b;
  font-weight: 600;
  min-width: 55px;
}
.risk-row .report-row-name {
  font-weight: 600;
  min-width: 90px;
}
.risk-row .report-row-reason {
  color: var(--text-muted);
  flex: 1;
}
.report-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.report-action-item {
  display: flex;
  gap: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
}
.report-action-num {
  font-weight: 700;
  color: var(--accent);
  min-width: 20px;
}

/* Android APK embedded mode: keep the web UI, but size it for a real phone viewport. */
.embedded-android {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.embedded-android body {
  background: var(--bg);
  overflow-x: hidden !important;
}

.embedded-android .app-layout,
.embedded-android .main-wrap {
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 100dvh !important;
  overflow: visible !important;
}

.embedded-android .sidebar,
.embedded-android .sidebar-overlay,
.embedded-android .topbar {
  display: none !important;
}

.embedded-android .content {
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 100dvh !important;
  overflow: visible !important;
  padding: 16px 14px 34px !important;
}

.embedded-android h1 {
  font-size: 1.55rem;
  line-height: 1.25;
  margin-bottom: 14px;
}

.embedded-android h2 {
  font-size: 1.18rem;
  line-height: 1.32;
}

.embedded-android .metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 18px !important;
}

.embedded-android .metric {
  min-height: 116px;
  padding: 16px !important;
  border-radius: 14px;
}

.embedded-android .metric strong {
  font-size: 2.65rem !important;
  line-height: 1;
}

.embedded-android .metric em {
  font-size: 1.08rem !important;
  line-height: 1.25;
}

.embedded-android .metric span {
  font-size: 0.9rem !important;
}

.embedded-android .grid,
.embedded-android .split,
.embedded-android .filters,
.embedded-android .edit-form,
.embedded-android .inline-form,
.embedded-android .upload-form,
.embedded-android .two-cols,
.embedded-android .risk-grid,
.embedded-android .follow-up-grid {
  grid-template-columns: 1fr !important;
}

.embedded-android .follow-up-card {
  min-height: 96px;
  padding: 18px;
  border-radius: 14px;
  gap: 8px;
}

.embedded-android .follow-up-card strong {
  font-size: 1.12rem;
  line-height: 1.38;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.embedded-android .follow-up-card span,
.embedded-android .follow-up-card time {
  font-size: 0.95rem;
  line-height: 1.45;
}

.embedded-android .follow-score {
  top: 16px;
  right: 16px;
  min-width: 36px;
  height: 28px;
  font-size: 0.9rem;
}

.embedded-android .dash-item {
  min-height: 76px;
  padding: 16px 0;
  gap: 14px;
}

.embedded-android .dash-main strong {
  font-size: 1.04rem;
  line-height: 1.42;
}

.embedded-android .dash-main span,
.embedded-android .dash-side time {
  font-size: 0.92rem;
  line-height: 1.42;
}

.embedded-android .badge {
  min-height: 26px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.embedded-android .panel-head p,
.embedded-android .empty-state span {
  font-size: 0.92rem;
  line-height: 1.45;
}

.embedded-android .card,
.embedded-android .panel,
.embedded-android .today-focus-panel,
.embedded-android .section,
.embedded-android .company-card,
.embedded-android .task-card,
.embedded-android .timeline-card,
.embedded-android .risk-card,
.embedded-android .candidate-card {
  max-width: 100%;
}

.embedded-android .company-card,
.embedded-android .task-card,
.embedded-android .timeline-card {
  font-size: 1rem;
}

.embedded-android .view-calendar {
  height: calc(100dvh - 6px) !important;
  min-height: calc(100dvh - 6px) !important;
  margin: 0 !important;
  overflow: hidden !important;
  border-radius: 14px;
  background: var(--card-bg);
}

.embedded-android .calendar-frame {
  width: 100% !important;
  height: 100% !important;
  border-radius: 14px;
  background: #fff;
}
