/* ===== 기본 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { zoom: 1.2; }
html, body { height: 100%; font-family: "Pretendard Variable", Pretendard, -apple-system, sans-serif; background: #f1f5f9; color: #0f172a; font-size: 14px; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ===== 토스트 ===== */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1e293b; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; transition: all 0.2s; z-index: 9999; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #dc2626; }

/* ===== 버튼 ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; border: none; transition: all 0.12s; cursor: pointer; white-space: nowrap; }
.btn-primary { background: #3b63e7; color: #fff; }
.btn-primary:hover { background: #2a4fd1; }
.btn-ghost { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.btn-ghost:hover { background: #e2e8f0; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { border: none; background: transparent; color: #64748b; font-size: 16px; padding: 4px 6px; border-radius: 6px; transition: background 0.1s; }
.btn-icon:hover { background: #f1f5f9; }
.btn-text { border: none; background: transparent; font-size: 12px; font-weight: 700; padding: 3px 7px; border-radius: 5px; transition: background 0.1s; }
.btn-text.green { color: #059669; } .btn-text.green:hover { background: #d1fae5; }
.btn-text.orange { color: #d97706; } .btn-text.orange:hover { background: #fef3c7; }
.btn-text.red { color: #dc2626; } .btn-text.red:hover { background: #fee2e2; }
.btn-text.gray { color: #94a3b8; } .btn-text.gray:hover { background: #f1f5f9; }
.btn-text.blue { color: #2563eb; } .btn-text.blue:hover { background: #dbeafe; }

/* ===== 레이아웃 ===== */
#root { display: flex; flex-direction: column; min-height: 100vh; }

.topbar { display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 54px; background: #fff; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; position: sticky; top: 0; z-index: 100; }
.topbar-logo { font-size: 15px; font-weight: 800; color: #1e40af; white-space: nowrap; }
.topbar-center { flex: 1; display: flex; justify-content: center; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.month-nav { display: flex; align-items: center; gap: 10px; }
.month-label { font-size: 15px; font-weight: 700; color: #0f172a; min-width: 110px; text-align: center; }

.tab-bar { display: flex; gap: 2px; padding: 0 20px; background: #fff; border-bottom: 1px solid #e2e8f0; flex-shrink: 0; overflow-x: auto; }
.tab-btn { padding: 12px 16px; border: none; background: transparent; color: #64748b; font-size: 13px; font-weight: 600; cursor: pointer; border-bottom: 2.5px solid transparent; white-space: nowrap; transition: all 0.12s; }
.tab-btn:hover { color: #334155; }
.tab-btn.active { color: #3b63e7; border-bottom-color: #3b63e7; }

.content { flex: 1; padding: 20px; max-width: 1200px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 20px; }

/* ===== 섹션 ===== */
.section { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.section-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #f1f5f9; }
.section-title { font-size: 14px; font-weight: 700; color: #0f172a; display: flex; align-items: center; gap: 8px; }
.empty { padding: 32px; text-align: center; color: #94a3b8; font-size: 13px; }

/* ===== 요약 카드 ===== */
.summary-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.summary-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px 20px; }
.summary-card.blue  { border-left: 4px solid #3b63e7; }
.summary-card.green { border-left: 4px solid #059669; }
.summary-card.purple{ border-left: 4px solid #7c3aed; }
.sc-label { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.sc-val   { font-size: 22px; font-weight: 800; color: #0f172a; }
.sc-sub   { font-size: 11px; color: #94a3b8; margin-top: 4px; }

/* ===== 배지 ===== */
.badge       { background: #eff1fe; color: #3b63e7; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.badge.gray  { background: #f1f5f9; color: #64748b; }
.badge-active { background: #dcfce7; color: #059669; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.badge-closed { background: #f1f5f9; color: #64748b; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }

/* ===== 클라이언트 테이블 ===== */
.client-table { width: 100%; }
.ct-head {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr 1.1fr 0.7fr 1.6fr;
  padding: 8px 18px; background: #f8fafc;
  font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid #f1f5f9;
}
.ct-head-contact { grid-template-columns: 1.5fr 1fr 2fr 1.3fr !important; }
.ct-row {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr 1.1fr 0.7fr 1.6fr;
  padding: 8px 18px; align-items: center;
  border-bottom: 1px solid #f8fafc;
  transition: background 0.1s;
}
.ct-row:hover { background: #fafbff; }
.ct-row.closed { opacity: 0.6; }
.ct-row.overdue { background: #fff5f5; }
.ct-row.overdue:hover { background: #fee2e2; }
.ct-name { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notion-link { background: #000; color: #fff; font-size: 10px; font-weight: 800; width: 18px; height: 18px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notion-link:hover { background: #333; }
.cell-inp { border: 1.5px solid #e2e8f0; border-radius: 6px; padding: 4px 8px; font-size: 12px; width: 100%; max-width: 130px; outline: none; transition: border 0.1s; background: #fff; }
.cell-inp:focus { border-color: #3b63e7; }
.date-inp { max-width: 140px; font-size: 12px; cursor: pointer; }
.profit-cell { font-size: 13px; font-weight: 700; color: #059669; }
.profit-cell.neg { color: #dc2626; }
.ct-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

/* 컨택 테이블 (대기탭) */
.contact-table .ct-row { grid-template-columns: 1.5fr 1fr 2fr 1.3fr; }

/* 종료/완료 리스트 */
.done-list { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.done-item { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border-radius: 8px; background: #f8fafc; font-size: 13px; }

/* ===== 일정 탭 레이아웃 ===== */
.sch-layout {
  display: flex; gap: 0;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden;
  min-height: 600px;
}

/* 좌측 사이드바 */
.sch-sidebar {
  width: 200px; flex-shrink: 0;
  border-right: 1px solid #e2e8f0;
  display: flex; flex-direction: column;
  background: #fafbff;
}
.sch-sb-title {
  padding: 14px 14px 10px;
  font-size: 11px; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid #f1f5f9;
}
.sch-sb-list { flex: 1; overflow-y: auto; padding: 6px 8px; }
.sch-sb-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  transition: background 0.1s; margin-bottom: 2px;
  font-size: 13px; font-weight: 500; color: #334155;
}
.sch-sb-item:hover { background: #eff1fe; }
.sch-sb-item.selected { background: #eff1fe; font-weight: 700; color: #1e40af; }
.sch-color-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.sch-sb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 선택 업체 정보 입력 패널 */
.sch-edit-panel {
  margin: 4px 6px 10px;
  background: #fff; border: 1.5px solid #c7d2fe;
  border-radius: 10px; padding: 10px 10px 6px;
  display: flex; flex-direction: column; gap: 8px;
}
.sch-edit-row { display: flex; flex-direction: column; gap: 3px; }
.sch-edit-label { font-size: 10px; font-weight: 700; color: #6366f1; text-transform: uppercase; letter-spacing: 0.04em; }
.sch-edit-row .cell-inp { max-width: 100%; font-size: 12px; }

/* 우측 달력 */
.sch-cal-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sch-cal-header { padding: 14px 16px 10px; border-bottom: 1px solid #f1f5f9; }

/* 기존 legend는 제거, 새 구조 사용 */
.legend { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 18px; border-bottom: 1px solid #f1f5f9; }
.legend-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; color: #fff; }

/* 달력 그리드 — 기본 */
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; padding: 8px 10px; }
.cal-hdr { text-align: center; font-size: 11px; font-weight: 700; color: #64748b; padding: 6px 0; }
.cal-cell { border: 1px solid #f1f5f9; border-radius: 6px; padding: 4px; background: #fff; overflow: hidden; }
.cal-cell.sat .cal-day { color: #2563eb; }
.cal-cell.sun .cal-day { color: #dc2626; }
.cal-cell.today { border-color: #3b63e7; background: #eff1fe; }
.cal-cell.cal-empty { background: transparent; border-color: transparent; }
.cal-day { font-size: 12px; font-weight: 700; color: #334155; margin-bottom: 4px; }
.cal-bars { display: flex; flex-direction: column; gap: 2px; }
.cal-bar { font-size: 10px; font-weight: 700; color: #fff; padding: 2px 5px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: opacity 0.15s; }
.cal-bar-selected { box-shadow: 0 0 0 1.5px #fff, 0 0 0 3px currentColor; }
.cal-deadline-badge { font-size: 10px; font-weight: 700; color: #dc2626; background: #fee2e2; padding: 2px 5px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-quote-badge { font-size: 10px; font-weight: 700; padding: 2px 5px; border-radius: 4px; border: 1.5px solid; background: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 큰 달력 셀 (일정 탭 전용) */
.cal-grid-lg { padding: 10px 12px; gap: 3px; }
.cal-cell-lg { min-height: 120px; padding: 6px; }
.cal-cell-lg .cal-day { font-size: 13px; margin-bottom: 6px; }

/* ===== 분석 테이블 ===== */
.analysis-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.analysis-table th { padding: 9px 16px; background: #f8fafc; font-size: 11px; font-weight: 700; color: #64748b; text-align: left; border-bottom: 1px solid #e2e8f0; }
.analysis-table td { padding: 9px 16px; border-bottom: 1px solid #f8fafc; }
.analysis-table tbody tr:hover td { background: #fafbff; }
.total-row td { font-weight: 700; background: #f8fafc; border-top: 2px solid #e2e8f0; }
.neg { color: #dc2626; }

/* ===== 모달 ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 500; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 500px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); display: flex; flex-direction: column; max-height: 90vh; overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid #f1f5f9; }
.modal-header h2 { font-size: 15px; font-weight: 800; color: #0f172a; }
.modal-close { font-size: 18px; color: #94a3b8; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid #f1f5f9; }

.form-grid { display: grid; grid-template-columns: 100px 1fr; gap: 10px 12px; align-items: center; }
.form-label { font-size: 12px; font-weight: 700; color: #475569; }
.req { color: #dc2626; }
.form-inp { border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 7px 10px; font-size: 13px; width: 100%; outline: none; transition: border 0.1s; }
.form-inp:focus { border-color: #3b63e7; }
.form-textarea { min-height: 80px; resize: vertical; }

/* ===== 행 액션 토글 메뉴 ===== */
.btn-edit-toggle { border: none; background: transparent; color: #64748b; font-size: 15px; padding: 4px 6px; border-radius: 6px; transition: background 0.1s; }
.btn-edit-toggle:hover { background: #f1f5f9; }
.btn-edit-toggle.active { background: #eff1fe; color: #3b63e7; }
.row-action-popup { display: none; align-items: center; gap: 2px; }
.row-action-popup.visible { display: flex; }

/* ===== 마케팅 업체 관리 탭 ===== */
.mkt-layout {
  display: flex; flex: 1;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden;
  min-height: 600px;
}

/* 좌측 사이드바 */
.mkt-sidebar { width: 210px; flex-shrink: 0; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column; background: #fafbff; }
.mkt-sb-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 8px; border-bottom: 1px solid #f1f5f9; flex-shrink: 0; }
.mkt-sb-title-text { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.06em; }
.mkt-sb-edit-btn { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; border: 1.5px solid #e2e8f0; background: #f8fafc; color: #64748b; cursor: pointer; white-space: nowrap; transition: all 0.1s; }
.mkt-sb-edit-btn:hover, .mkt-sb-edit-btn.active { border-color: #3b63e7; color: #3b63e7; background: #eff1fe; }
.mkt-sb-scroll { flex: 1; overflow-y: auto; padding: 6px 0 10px; }

/* 카테고리 섹션 */
.mkt-sb-cat { margin-bottom: 6px; }
.mkt-sb-cat-label { display: flex; align-items: center; gap: 6px; padding: 7px 10px 5px 9px; margin: 0 4px 2px; border-radius: 5px; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; }
.mkt-sb-cat-cnt { font-size: 10px; font-weight: 800; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: currentColor; color: #fff; opacity: 0.75; }

/* 업체 카드 */
.mkt-sb-card { display: flex; align-items: center; gap: 6px; padding: 7px 9px; margin: 0 4px 2px; border-radius: 7px; cursor: pointer; transition: background 0.1s; font-size: 12px; color: #334155; }
.mkt-sb-card:hover { background: #f1f5f9; }
.mkt-sb-card.selected { background: #eff1fe; font-weight: 700; color: #1e40af; }
.mkt-sb-card.uncat { opacity: 0.65; }
.mkt-sb-card.uncat.selected { opacity: 1; }
.mkt-sb-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mkt-sb-card-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mkt-sb-card-cnt { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 8px; flex-shrink: 0; }

/* 드래그 앤 드롭 */
.mkt-drag-handle { font-size: 14px; color: #94a3b8; cursor: grab; flex-shrink: 0; }
.mkt-sb-card[draggable="true"] { cursor: grab; user-select: none; }
.mkt-sb-card.dragging { opacity: 0.35; }
.mkt-sb-card.drag-over { background: #eff1fe !important; outline: 2px dashed #3b63e7; outline-offset: -2px; }
.mkt-sb-name-input { flex: 1; border: 1px solid #e2e8f0; border-radius: 5px; padding: 2px 6px; font-size: 12px; color: #334155; font-family: inherit; background: #fff; min-width: 0; }
.mkt-sb-name-input:focus { outline: none; border-color: #3b63e7; box-shadow: 0 0 0 2px #3b63e720; }
.mkt-sb-del-btn { flex-shrink: 0; border: none; background: none; cursor: pointer; font-size: 13px; padding: 2px 4px; border-radius: 4px; opacity: 0.45; transition: opacity 0.1s, background 0.1s; line-height: 1; }
.mkt-sb-del-btn:hover { opacity: 1; background: #fee2e2; }
.mkt-sb-del-header-btn { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; border: 1.5px solid #fca5a5; background: #fff1f2; color: #ef4444; cursor: pointer; white-space: nowrap; transition: all 0.1s; }
.mkt-sb-del-header-btn:hover:not(:disabled) { background: #fee2e2; border-color: #ef4444; }
.mkt-sb-del-header-btn:disabled { opacity: 0.35; cursor: default; }

/* 우측 메인 */
.mkt-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.mkt-placeholder { flex: 1; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 14px; }
.mkt-client-hdr { padding: 16px 20px 12px; border-bottom: 1px solid #f1f5f9; flex-shrink: 0; }
.mkt-client-name { font-size: 17px; font-weight: 800; color: #0f172a; }
.mkt-client-sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.mkt-cat-badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 12px; }
.mkt-catalog { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 20px; }

/* 카테고리 섹션 */
.mkt-cat-sec { display: flex; flex-direction: column; gap: 5px; }
.mkt-cat-title { font-size: 12px; font-weight: 800; color: #64748b; padding: 5px 0 8px; border-bottom: 2px solid #f1f5f9; margin-bottom: 6px; letter-spacing: 0.03em; }

/* 상품 아이템 */
.mkt-item { border: 1.5px solid #f1f5f9; border-radius: 8px; padding: 10px 12px; background: #fafbff; transition: border-color 0.12s; }
.mkt-item.active { border-color: #c7d2fe; background: #f5f7ff; }
.mkt-item-head { display: flex; align-items: center; gap: 10px; }
.mkt-cb { width: 16px; height: 16px; accent-color: #3b63e7; cursor: pointer; flex-shrink: 0; }
.mkt-item-info { flex: 1; min-width: 0; }
.mkt-item-name { font-size: 13px; font-weight: 700; color: #0f172a; }
.mkt-item-desc { font-size: 11px; color: #64748b; margin-top: 2px; }
.mkt-price { color: #3b63e7; font-weight: 700; }

/* 진행 상태 도트 */
.mkt-status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.mkt-status-dot.pending  { background: #e2e8f0; }
.mkt-status-dot.partial  { background: #f59e0b; }
.mkt-status-dot.done     { background: #10b981; }

/* 수량 컨트롤 */
.mkt-qty { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.mkt-qty-btn { width: 24px; height: 24px; border: 1.5px solid #e2e8f0; border-radius: 5px; background: #fff; color: #334155; font-size: 15px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.1s; line-height: 1; }
.mkt-qty-btn:hover { border-color: #3b63e7; color: #3b63e7; background: #eff1fe; }
.mkt-qty-val { font-size: 14px; font-weight: 800; color: #0f172a; min-width: 28px; text-align: center; }
.mkt-qty-unit { font-size: 11px; color: #94a3b8; font-weight: 600; }
.mkt-qty-reset { width: 22px; height: 22px; border: 1px solid #e2e8f0; border-radius: 5px; background: #f8fafc; color: #94a3b8; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.1s; }
.mkt-qty-reset:hover { border-color: #fca5a5; color: #dc2626; background: #fff5f5; }

/* 링크 섹션 */
.mkt-links { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #e2e8f0; display: flex; flex-direction: column; gap: 5px; }
.mkt-link-row { display: flex; align-items: center; gap: 6px; }
.mkt-link-no { font-size: 11px; font-weight: 700; color: #94a3b8; min-width: 30px; text-align: right; flex-shrink: 0; }
.mkt-link-inp { flex: 1; border: 1.5px solid #e2e8f0; border-radius: 6px; padding: 5px 8px; font-size: 12px; outline: none; transition: border 0.1s; min-width: 0; }
.mkt-link-inp:focus { border-color: #3b63e7; }
.mkt-link-go { font-size: 12px; color: #3b63e7; text-decoration: none; font-weight: 700; padding: 4px 8px; border-radius: 5px; background: #eff1fe; flex-shrink: 0; }
.mkt-link-go:hover { background: #dbeafe; }

/* 커스텀 상품 폼 */
.mkt-custom-form { display: flex; gap: 8px; align-items: center; padding: 8px 0 4px; flex-wrap: wrap; }
.mkt-custom-inp { border: 1.5px solid #e2e8f0; border-radius: 7px; padding: 6px 10px; font-size: 12px; outline: none; flex: 1; min-width: 120px; transition: border 0.1s; font-family: inherit; }
.mkt-custom-inp:focus { border-color: #3b63e7; }

/* SNS 집행 트래커 */
.mkt-sns-tracker { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.mkt-sns-row { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.mkt-sns-card { flex: 1; min-width: 80px; padding: 8px 12px; border-radius: 8px; }
.mkt-sns-card.blue   { background: #dbeafe; }
.mkt-sns-card.orange { background: #fef3c7; }
.mkt-sns-card.green  { background: #dcfce7; }
.mkt-sns-card.red    { background: #fee2e2; }
.mkt-sns-lbl { font-size: 10px; font-weight: 700; color: #64748b; margin-bottom: 3px; }
.mkt-sns-val { font-size: 15px; font-weight: 800; color: #0f172a; }
.mkt-sns-inp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mkt-sns-inp-lbl { font-size: 11px; font-weight: 700; color: #475569; flex-shrink: 0; white-space: nowrap; }

/* ===== 일정 탭 읽기 전용 패널 ===== */
.sch-info-panel { background: #f8fafc; border-radius: 8px; margin: 4px 6px 6px; padding: 8px 10px; border: 1px solid #f1f5f9; }
.sch-info-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #f1f5f9; }
.sch-info-row:last-of-type { border-bottom: none; }
.sch-info-lbl { font-size: 10px; font-weight: 700; color: #94a3b8; }
.sch-info-val { font-size: 11px; font-weight: 600; color: #334155; }
.sch-info-edit-hint { text-align: center; font-size: 9px; color: #c7d2fe; margin-top: 6px; }

/* ===== 마케팅 편집 패널 광고 일정 섹션 ===== */
.mkt-sch-date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 4px 0 2px; }
.mkt-sch-date-row { display: flex; flex-direction: column; gap: 4px; }
.mkt-sch-date-lbl { font-size: 10px; font-weight: 700; color: #64748b; }

/* ===== SNS 집행 달력 ===== */
.mkt-sns-full { display: flex; flex-direction: column; gap: 12px; }
.mkt-sns-overview { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; }
.mkt-sns-row { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.mkt-sns-card { flex: 1; min-width: 80px; padding: 8px 12px; border-radius: 8px; }
.mkt-sns-card.blue   { background: #dbeafe; }
.mkt-sns-card.orange { background: #fef3c7; }
.mkt-sns-card.green  { background: #dcfce7; }
.mkt-sns-card.red, .mkt-sns-card.red-card { background: #fee2e2; }
.mkt-sns-card.yellow { background: #fef9c3; }
.mkt-sns-card.teal   { background: #ccfbf1; }
.mkt-sns-lbl { font-size: 10px; font-weight: 700; color: #64748b; margin-bottom: 3px; }
.mkt-sns-val { font-size: 14px; font-weight: 800; color: #0f172a; }
.mkt-sns-edit-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid #e2e8f0; }
.mkt-sns-ratio-btns { display: flex; gap: 4px; }
.mkt-sns-ratio-btn { padding: 3px 10px; border-radius: 6px; border: 1.5px solid #e2e8f0; background: #fff; font-size: 11px; font-weight: 700; cursor: pointer; color: #475569; }
.mkt-sns-ratio-btn.act { border-color: #3b63e7; background: #eef2ff; color: #3b63e7; }
.mkt-sns-ph { text-align: center; padding: 24px; color: #94a3b8; font-size: 13px; }

/* 달력 감싸기 */
.mkt-sns-cal-wrap { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }
.mkt-sns-nav { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #f1f5f9; flex-wrap: wrap; }
.mkt-nav-btn { border: 1.5px solid #e2e8f0; background: #fff; border-radius: 6px; width: 28px; height: 28px; cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.mkt-nav-btn:hover { background: #f1f5f9; }
.mkt-month-lbl { font-size: 13px; font-weight: 800; color: #1e293b; }
.mkt-sns-month-total { font-size: 11px; font-weight: 700; color: #64748b; margin-left: 4px; }
.mkt-multisel-btn { margin-left: auto; padding: 4px 12px; border-radius: 6px; border: 1.5px solid #e2e8f0; background: #fff; font-size: 11px; font-weight: 700; cursor: pointer; color: #475569; }
.mkt-multisel-btn.act { border-color: #3b63e7; background: #eef2ff; color: #3b63e7; }

/* 다중선택 일괄 적용 바 */
.mkt-bulk-bar { display: flex; gap: 6px; align-items: center; padding: 8px 12px; background: #eff6ff; border-bottom: 1px solid #dbeafe; flex-wrap: wrap; }
.mkt-bulk-lbl { font-size: 11px; font-weight: 700; color: #1d4ed8; white-space: nowrap; }
.mkt-bulk-btn { padding: 3px 10px; border-radius: 6px; border: 1.5px solid #bfdbfe; background: #fff; font-size: 11px; font-weight: 700; cursor: pointer; color: #1d4ed8; }
.mkt-bulk-btn:hover { background: #dbeafe; }
.mkt-bulk-btn.primary { background: #3b63e7; color: #fff; border-color: #3b63e7; }
.mkt-bulk-btn.danger  { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.mkt-bulk-inp { border: 1.5px solid #bfdbfe; border-radius: 6px; padding: 3px 8px; font-size: 11px; width: 100px; outline: none; }

/* 달력 그리드 */
.mkt-sns-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.mkt-sns-cal-hdr { text-align: center; font-size: 10px; font-weight: 800; color: #94a3b8; padding: 6px 0; background: #f8fafc; border-bottom: 1px solid #f1f5f9; }
.mkt-sns-cal-cell { min-height: 52px; padding: 4px 5px; border-right: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9; cursor: pointer; position: relative; transition: background 0.12s; }
.mkt-sns-cal-cell:hover { background: #f0f4ff; }
.mkt-sns-cal-cell.empty { cursor: default; background: #fafafa; }
.mkt-sns-cal-cell.sat .mkt-sns-day { color: #2563eb; }
.mkt-sns-cal-cell.sun .mkt-sns-day { color: #dc2626; }
.mkt-sns-cal-cell.today { background: #eff6ff; }
.mkt-sns-cal-cell.today .mkt-sns-day { font-weight: 900; color: #3b63e7; }
.mkt-sns-cal-cell.has-amt { background: #f0fdf4; }
.mkt-sns-cal-cell.sel { background: #e0e7ff; outline: 2px solid #3b63e7; outline-offset: -2px; }
.mkt-sns-day { font-size: 11px; font-weight: 700; color: #334155; }
.mkt-sns-amt { font-size: 10px; font-weight: 800; color: #059669; margin-top: 3px; }

/* 일자 팝업 */
.mkt-sns-day-pop { position: absolute; top: 100%; left: 0; z-index: 200; background: #fff; border: 1.5px solid #e2e8f0; border-radius: 10px; padding: 12px; min-width: 180px; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.mkt-pop-hd { font-size: 12px; font-weight: 800; color: #1e293b; margin-bottom: 8px; }
.mkt-pop-presets { display: flex; gap: 5px; flex-wrap: wrap; }
.mkt-pop-preset { padding: 4px 10px; border-radius: 6px; border: 1.5px solid #e2e8f0; background: #f8fafc; font-size: 11px; font-weight: 700; cursor: pointer; color: #334155; }
.mkt-pop-preset:hover, .mkt-pop-preset.act { background: #3b63e7; color: #fff; border-color: #3b63e7; }
.mkt-pop-del { display: block; width: 100%; margin-top: 6px; padding: 4px; border: none; background: #fee2e2; color: #dc2626; border-radius: 6px; font-size: 11px; font-weight: 700; cursor: pointer; }
.mkt-pop-close { display: block; width: 100%; margin-top: 5px; padding: 4px; border: none; background: #f1f5f9; color: #64748b; border-radius: 6px; font-size: 11px; cursor: pointer; }

/* ===== 네이버 플레이스 관리 전용 UI ===== */
.np-check-section { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px 6px; border-top: 1px solid #f1f5f9; }
.np-check-row { display: flex; align-items: center; gap: 10px; }
.np-check-btn { border: none; background: none; cursor: pointer; font-size: 18px; padding: 0; line-height: 1; transition: transform .1s; flex-shrink: 0; }
.np-check-btn:hover { transform: scale(1.15); }
.np-check-label { font-size: 13px; font-weight: 600; color: #475569; }
.np-check-label.done { color: #059669; text-decoration: line-through; text-decoration-color: #a7f3d0; }

.np-kw-section { border-top: 1px solid #f1f5f9; margin-top: 4px; }
.np-kw-hdr { display: flex; align-items: center; gap: 6px; padding: 8px 14px; cursor: pointer; }
.np-kw-icon { font-size: 14px; }
.np-kw-title { font-size: 12px; font-weight: 800; color: #334155; flex: 1; }
.np-kw-cnt { font-size: 10px; font-weight: 700; color: #94a3b8; background: #f1f5f9; padding: 2px 8px; border-radius: 10px; }
.np-kw-toggle { border: 1.5px solid #e2e8f0; background: #fff; border-radius: 6px; padding: 2px 10px; font-size: 10px; font-weight: 700; color: #475569; cursor: pointer; white-space: nowrap; }
.np-kw-toggle:hover { background: #f1f5f9; }

.np-kw-list { padding: 0 14px 10px; display: flex; flex-direction: column; gap: 0; }
.np-kw-col-hdr { display: grid; grid-template-columns: 28px 1fr 130px; gap: 6px; padding: 4px 2px 4px; font-size: 10px; font-weight: 700; color: #94a3b8; border-bottom: 1px solid #f1f5f9; margin-bottom: 4px; }
.np-kw-no-hdr { text-align: center; }
.np-kw-row { display: grid; grid-template-columns: 28px 1fr 130px; gap: 6px; align-items: center; padding: 3px 0; border-bottom: 1px solid #f8fafc; }
.np-kw-no { text-align: center; font-size: 10px; font-weight: 700; color: #cbd5e1; }
.np-kw-inp { border: 1.5px solid #e2e8f0; border-radius: 6px; padding: 5px 8px; font-size: 12px; outline: none; width: 100%; font-family: inherit; }
.np-kw-inp:focus { border-color: #3b63e7; background: #f5f7ff; }
.np-cpc-wrap { display: flex; align-items: center; gap: 4px; }
.np-cpc-inp { border: 1.5px solid #e2e8f0; border-radius: 6px; padding: 5px 6px; font-size: 12px; outline: none; width: 90px; text-align: right; font-family: inherit; }
.np-cpc-inp:focus { border-color: #3b63e7; background: #f5f7ff; }
.np-cpc-unit { font-size: 11px; color: #64748b; white-space: nowrap; }
.np-kw-add-btn { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 8px; width: 100%; padding: 6px; border: 1.5px dashed #c7d2fe; border-radius: 7px; background: #f5f7ff; color: #3b63e7; font-size: 11px; font-weight: 700; cursor: pointer; font-family: inherit; }
.np-kw-add-btn:hover { background: #eef2ff; border-color: #818cf8; }

/* ===== 견적서 버튼 & 모달 ===== */
.mkt-quote-bar { display: flex; justify-content: flex-end; padding: 14px 16px 10px; border-top: 1.5px solid #f1f5f9; flex-shrink: 0; }
.mkt-quote-btn { display: flex; align-items: center; gap: 7px; padding: 9px 20px; background: #1e293b; color: #fff; border: none; border-radius: 9px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; transition: background .15s; }
.mkt-quote-btn:hover { background: #334155; }

.quote-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.quote-modal { background: #fff; border-radius: 16px; padding: 28px 28px 20px; min-width: 340px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.quote-modal-title { font-size: 17px; font-weight: 900; color: #0f172a; margin-bottom: 4px; }
.quote-modal-sub { font-size: 12px; color: #64748b; margin-bottom: 22px; }
.quote-modal-btns { display: flex; gap: 12px; margin-bottom: 14px; }
.quote-type-btn { flex: 1; border: 2px solid #e2e8f0; border-radius: 12px; padding: 16px 12px; cursor: pointer; background: #fff; display: flex; flex-direction: column; align-items: center; gap: 5px; transition: all .15s; font-family: inherit; }
.quote-type-btn:hover { border-color: #3b63e7; background: #f5f7ff; }
.quote-type-btn.biz:hover { border-color: #1d4ed8; }
.quote-type-btn.personal:hover { border-color: #15803d; }
.quote-type-icon { font-size: 24px; }
.quote-type-label { font-size: 14px; font-weight: 800; color: #1e293b; }
.quote-type-desc { font-size: 10px; color: #94a3b8; text-align: center; }
.quote-modal-close { width: 100%; padding: 8px; border: none; background: #f1f5f9; color: #64748b; border-radius: 8px; font-size: 12px; cursor: pointer; font-family: inherit; }
.quote-modal-close:hover { background: #e2e8f0; }

/* ===== 일정 탭 구간 편집 ===== */
.sch-grp-sec { border-top: 1.5px solid #e2e8f0; padding: 8px 6px 6px; flex-shrink: 0; }
.sch-grp-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.sch-grp-title { font-size: 10px; font-weight: 800; color: #64748b; letter-spacing: .05em; text-transform: uppercase; }
.sch-grp-add-btn { font-size: 10px; font-weight: 700; color: #3b63e7; background: #eef2ff; border: none; border-radius: 5px; padding: 2px 8px; cursor: pointer; }
.sch-grp-add-btn:hover { background: #dbeafe; }
.sch-grp-row { display: flex; align-items: center; gap: 5px; padding: 4px 3px; border-radius: 6px; }
.sch-grp-row:hover { background: #f8fafc; }
.sch-grp-label { font-size: 11px; font-weight: 700; color: #1e293b; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch-grp-members { font-size: 9px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60px; }
.sch-grp-edit-icon { border: none; background: none; cursor: pointer; font-size: 12px; padding: 0 2px; flex-shrink: 0; }
.sch-grp-edit-form { width: 100%; display: flex; flex-direction: column; gap: 6px; padding: 6px 4px; background: #f8fafc; border-radius: 8px; border: 1.5px solid #e2e8f0; }
.sch-grp-edit-row { display: flex; gap: 6px; align-items: center; }
.sch-grp-color-inp { width: 32px; height: 28px; border: none; padding: 0; cursor: pointer; border-radius: 5px; flex-shrink: 0; }
.sch-grp-client-list { display: flex; flex-direction: column; gap: 2px; max-height: 110px; overflow-y: auto; }
.sch-grp-client-item { display: flex; align-items: center; gap: 5px; cursor: pointer; padding: 2px 3px; border-radius: 4px; }
.sch-grp-client-item:hover { background: #eff6ff; }
.sch-grp-client-name { font-size: 10px; color: #334155; }
.sch-grp-edit-btns { display: flex; gap: 4px; flex-wrap: wrap; }

/* ===== 견적서 편집 모달 ===== */
.qe-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.qe-panel { background: #fff; border-radius: 16px; width: 100%; max-width: 780px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 24px 80px rgba(0,0,0,.25); overflow: hidden; }
.qe-hdr { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 1.5px solid #f1f5f9; flex-shrink: 0; }
.qe-title { font-size: 17px; font-weight: 900; color: #0f172a; }
.qe-sub { font-size: 12px; color: #64748b; margin-top: 3px; }
.qe-close-x { border: none; background: #f1f5f9; border-radius: 8px; width: 28px; height: 28px; font-size: 13px; cursor: pointer; color: #64748b; flex-shrink: 0; }
.qe-close-x:hover { background: #e2e8f0; }
.qe-body { flex: 1; overflow-y: auto; padding: 16px 24px 0; }
.qe-col-hdr { display: grid; grid-template-columns: 32px 1fr 1fr 110px 70px 100px 28px; gap: 6px; padding: 0 0 6px; border-bottom: 2px solid #e2e8f0; margin-bottom: 4px; }
.qe-col-hdr span { font-size: 10px; font-weight: 800; color: #94a3b8; letter-spacing: .05em; text-transform: uppercase; }
.qe-c-no { text-align: center; }
.qe-c-amt { text-align: right; }
.qe-row { display: grid; grid-template-columns: 32px 1fr 1fr 110px 70px 100px 28px; gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px solid #f8fafc; }
.qe-row:hover { background: #fafbff; }
.qe-c-no { font-size: 11px; color: #94a3b8; text-align: center; }
.qe-inp { border: 1.5px solid #e2e8f0; border-radius: 6px; padding: 5px 8px; font-size: 12px; font-family: inherit; color: #1e293b; width: 100%; background: #fff; }
.qe-inp:focus { outline: none; border-color: #3b63e7; background: #f5f7ff; }
.qe-inp[type="number"] { text-align: right; }
.qe-c-amt { font-size: 12px; font-weight: 700; color: #1e293b; text-align: right; padding-right: 4px; }
.qe-del-row { border: none; background: none; color: #cbd5e1; font-size: 12px; cursor: pointer; border-radius: 4px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.qe-del-row:hover { background: #fee2e2; color: #ef4444; }
.qe-add-row { margin: 8px 0; border: 1.5px dashed #e2e8f0; border-radius: 8px; background: #f8fafc; color: #64748b; font-size: 12px; font-weight: 700; cursor: pointer; padding: 8px; width: 100%; font-family: inherit; }
.qe-add-row:hover { border-color: #3b63e7; color: #3b63e7; background: #f0f4ff; }
.qe-totals { display: flex; flex-direction: column; align-items: flex-end; padding: 12px 24px; border-top: 1.5px solid #e2e8f0; flex-shrink: 0; gap: 4px; }
.qe-total-row { display: flex; gap: 24px; justify-content: flex-end; font-size: 12px; color: #64748b; }
.qe-total-row span:last-child { min-width: 110px; text-align: right; font-weight: 600; color: #1e293b; }
.qe-total-row.final { font-size: 15px; font-weight: 900; color: #0f172a; padding-top: 6px; border-top: 2px solid #1e293b; margin-top: 2px; }
.qe-total-row.final span:last-child { color: #3b63e7; }
.qe-footer { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 24px; border-top: 1.5px solid #f1f5f9; flex-shrink: 0; }
.qe-btn { border: none; border-radius: 8px; padding: 9px 20px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; }
.qe-btn.cancel { background: #f1f5f9; color: #64748b; }
.qe-btn.cancel:hover { background: #e2e8f0; }
.qe-btn.print { background: #1e293b; color: #fff; }
.qe-btn.print:hover { background: #0f172a; }

/* ===== 반응형 ===== */
@media (max-width: 768px) {
  .summary-row { grid-template-columns: 1fr; }
  .ct-head, .ct-row { grid-template-columns: 1fr 1fr 1fr; font-size: 11px; }
  .ct-head > div:nth-child(n+4), .ct-row > div:nth-child(n+4) { display: none; }
  .ct-actions { flex-direction: column; }
  .mkt-sidebar { width: 140px; }
}
