/* ── BizFlow dashboard.css ── */

/* ── 대시보드 헤더 ── */
#dash-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding: 10px 16px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
}

/* ── 검색 / 필터바 ── */
#dash-filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
}
.dash-search-wrap {
  position: relative; display: flex; align-items: center;
  flex: 1; min-width: 200px; max-width: 360px;
}
.dash-search-wrap > i {
  position: absolute; left: 10px; color: var(--text2); font-size: 13px; pointer-events: none;
}
.dash-search-input {
  width: 100%; padding: 7px 32px 7px 32px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 13px;
  outline: none; transition: border-color .15s;
}
.dash-search-input:focus { border-color: var(--accent); }
.dash-search-input::placeholder { color: var(--text2); }
.dash-search-clear {
  position: absolute; right: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--text2); font-size: 12px; padding: 4px;
  border-radius: 4px; display: flex; align-items: center;
  transition: color .12s;
}
.dash-search-clear:hover { color: var(--text); }

.dash-filter-btns {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.dash-filter-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600;
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.dash-filter-btn:hover { color: var(--text); border-color: var(--accent); }
.dash-filter-btn.active {
  background: rgba(99,102,241,.18); color: #a5b4fc;
  border-color: rgba(99,102,241,.45);
}
.dash-filter-btn[data-f="active"].active   { background:rgba(16,185,129,.15);  color:#34d399; border-color:rgba(16,185,129,.4); }
.dash-filter-btn[data-f="paused"].active   { background:rgba(245,158,11,.15);  color:#fbbf24; border-color:rgba(245,158,11,.4); }
.dash-filter-btn[data-f="completed"].active{ background:rgba(52,211,153,.15);  color:#6ee7b7; border-color:rgba(52,211,153,.4); }

.dash-filter-result {
  font-size: 11px; color: var(--accent); font-weight: 700;
  background: rgba(99,102,241,.12); border-radius: 20px;
  padding: 3px 10px; white-space: nowrap;
}

@media (max-width: 600px) {
  #dash-filter-bar { gap: 8px; }
  .dash-search-wrap { max-width: 100%; }
  #dash-sort-wrap .sort-label-text { display: none; }
}

/* ── 정렬 드롭다운 (index.css와 동일 구조) ── */
#dash-sort-wrap { position: relative; flex-shrink: 0; }
#dash-sort-wrap .btn-sort {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600;
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border);
  white-space: nowrap; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  font-family: inherit;
}
#dash-sort-wrap .btn-sort:hover {
  background: var(--bg3); color: var(--text); border-color: var(--accent);
}
#dash-sort-wrap .sort-dropdown {
  display: none; position: absolute;
  top: calc(100% + 6px); right: 0; z-index: 600;
  min-width: 170px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.35);
  padding: 4px; flex-direction: column;
}
#dash-sort-wrap .sort-dropdown.open { display: flex; }
#dash-sort-wrap .sort-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 7px;
  font-size: 13px; font-weight: 500;
  color: var(--text2); background: none; border: none;
  cursor: pointer; font-family: inherit;
  text-align: left; width: 100%;
  transition: background .1s, color .1s;
}
#dash-sort-wrap .sort-opt:hover { background: var(--bg3); color: var(--text); }
#dash-sort-wrap .sort-opt.active {
  background: rgba(99,102,241,.15); color: var(--accent); font-weight: 700;
}
#dash-sort-wrap .sort-opt i { width: 14px; text-align: center; font-size: 12px; flex-shrink: 0; }

/* ── 뷰 탭 ── */
#view-tabs {
  display: flex; gap: 4px;
}
.vtab {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-s);
  font-size: 13px; font-weight: 600; color: var(--text2);
  background: var(--bg3); transition: all .15s;
}
.vtab:hover { color: var(--text); }
.vtab.active { background: var(--accent); color: #fff; }

/* ── 대시보드 통계 ── */
#dash-stats {
  display: flex; gap: 16px; flex-wrap: wrap;
}
.ds-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text2);
}
.ds-item strong { color: var(--text); font-size: 14px; }
.ds-item i      { font-size: 13px; }

/* ── main ── */
#main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
}

/* ── 뷰 패널 ── */
.view-panel { animation: fadeIn .2s ease; }
.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ════════════════
   칸반 뷰
════════════════ */
#kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.kanban-col {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 200px;
}
.kanban-col-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 700;
}
.kcol-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.kcol-cnt {
  margin-left: auto;
  background: var(--bg3); color: var(--text2);
  font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 10px;
}
.kanban-cards {
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 100px;
}

/* ── 칸반 카드 ── */
.kcard {
  background: var(--bg3);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  padding: 12px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  overflow: hidden;
}
.kcard:hover { border-color: var(--border); transform: translateY(-1px); }
.kcard::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
}
.kcard-name {
  font-size: 13px; font-weight: 700; margin-bottom: 6px;
  line-height: 1.4;
}
.kcard-client {
  font-size: 11px; color: var(--text2); margin-bottom: 8px;
}
.kcard-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--text2);
}
.kcard-step {
  display: flex; align-items: center; gap: 4px;
}
.kcard-step i { color: var(--accent); }
.kcard-progress {
  display: flex; align-items: center; gap: 5px;
  margin-top: 8px;
}
.kcard-prog-bar {
  flex: 1; height: 4px; border-radius: 2px;
  background: var(--bg2); overflow: hidden;
}
.kcard-prog-fill {
  height: 100%; border-radius: 2px; transition: width .3s;
}
.kcard-prog-pct {
  font-size: 10px; color: var(--text2); font-weight: 700; width: 28px; text-align: right;
}
/* 최종 작업 정보 (칸반 카드) */
.kcard-last-work {
  display: flex; align-items: center; gap: 4px;
  margin-top: 6px; padding: 4px 6px;
  background: var(--bg); border-radius: var(--radius-s);
  border: 1px solid var(--border);
  font-size: 10px; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
}

/* ════════════════
   진행률 뷰
════════════════ */
#progress-list {
  display: flex; flex-direction: column; gap: 10px;
}
.prog-row {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s;
}
.prog-row:hover { border-color: var(--accent); }
.prog-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.prog-name {
  font-size: 14px; font-weight: 700;
}
.prog-client {
  font-size: 12px; color: var(--text2); margin-left: 8px;
}
.prog-pct {
  font-size: 13px; font-weight: 700; color: var(--accent);
  flex-shrink: 0;
}
.prog-steps {
  display: flex; gap: 3px; flex-wrap: wrap;
}
.pstep {
  width: 18px; height: 18px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff;
  cursor: default; transition: transform .1s;
  position: relative;
}
.pstep:hover { transform: scale(1.2); z-index: 1; }
.pstep.s-pending  { background: var(--bg3); color: var(--text2); }
.pstep.s-active   { background: var(--accent); }
.pstep.s-done     { background: var(--green); }
.pstep.s-skip     { background: var(--bg3); opacity: .5; }
.prog-bar-wrap {
  margin-top: 8px; display: flex; align-items: center; gap: 8px;
}
.prog-bar {
  flex: 1; height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden;
}
.prog-bar-fill {
  height: 100%; border-radius: 3px; transition: width .3s;
}
/* 최종 작업 정보 (진행률 뷰) */
.prog-last-work {
  display: flex; align-items: center; gap: 4px;
  margin-top: 6px; padding: 3px 0;
  font-size: 10px; border-top: 1px dashed var(--border);
}

/* ── 진행률 뷰 — 담당자 배지 ── */
.prog-owner-row {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.prog-owner-badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 20px; padding: 3px 10px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.prog-owner-badge i { font-size: 10px; flex-shrink: 0; }

/* 계약담당자 — 인디고 */
.prog-owner-contract {
  background: rgba(99,102,241,.13);
  color: #a5b4fc;
  border-color: rgba(99,102,241,.28);
}

/* 현 단계 담당자 — 에메랄드 */
.prog-owner-step {
  background: rgba(16,185,129,.11);
  color: #6ee7b7;
  border-color: rgba(16,185,129,.25);
}

/* 동일인 — 약한 강조만 */
.prog-owner-same {
  background: rgba(16,185,129,.07);
  color: #34d399;
  border-color: rgba(16,185,129,.18);
  opacity: .75;
}

/* 현 단계 이름 레이블 */
.prog-owner-step-name {
  font-size: 10px; font-weight: 400;
  color: var(--text2);
  margin-left: 2px;
}
.prog-owner-step-name::before { content: '('; }
.prog-owner-step-name::after  { content: ')'; }

/* ══════════════════════════════════════════════
   공통 담당자 배지 — kcard / pip / tsch 뷰
   접두사(pfx)만 다르고 색상·구조는 동일
══════════════════════════════════════════════ */

/* ── 칸반(kcard) ── */
.kcard-owner-row {
  display: flex; align-items: center; gap: 5px;
  flex-wrap: wrap; margin: 5px 0 2px;
}
.kcard-owner-badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 20px; padding: 2px 9px;
  font-size: 10px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.kcard-owner-badge i { font-size: 9px; flex-shrink: 0; }
.kcard-owner-contract {
  background: rgba(99,102,241,.13); color: #a5b4fc;
  border-color: rgba(99,102,241,.28);
}
.kcard-owner-step {
  background: rgba(16,185,129,.11); color: #6ee7b7;
  border-color: rgba(16,185,129,.25);
}
.kcard-owner-same {
  background: rgba(16,185,129,.07); color: #34d399;
  border-color: rgba(16,185,129,.18); opacity: .75;
}
.kcard-owner-step-name {
  font-size: 9px; font-weight: 400; color: var(--text2); margin-left: 2px;
}
.kcard-owner-step-name::before { content: '('; }
.kcard-owner-step-name::after  { content: ')'; }

/* ── 파이프라인(pip) ── */
.pip-owner-row {
  display: flex; align-items: center; gap: 4px;
  flex-wrap: wrap; margin: 4px 0 3px;
}
.pip-owner-badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 20px; padding: 2px 8px;
  font-size: 10px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.pip-owner-badge i { font-size: 9px; flex-shrink: 0; }
.pip-owner-contract {
  background: rgba(99,102,241,.13); color: #a5b4fc;
  border-color: rgba(99,102,241,.28);
}
.pip-owner-step {
  background: rgba(16,185,129,.11); color: #6ee7b7;
  border-color: rgba(16,185,129,.25);
}
.pip-owner-same {
  background: rgba(16,185,129,.07); color: #34d399;
  border-color: rgba(16,185,129,.18); opacity: .75;
}
.pip-owner-step-name {
  font-size: 9px; font-weight: 400; color: var(--text2); margin-left: 2px;
}
.pip-owner-step-name::before { content: '('; }
.pip-owner-step-name::after  { content: ')'; }

/* ── 오늘일정(tsch) 헤더 계약담당자 배지 ── */
.tsch-owner-badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 20px; padding: 2px 9px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
  flex-shrink: 0;
}
.tsch-owner-badge i { font-size: 10px; }
.tsch-owner-contract {
  background: rgba(99,102,241,.13); color: #a5b4fc;
  border-color: rgba(99,102,241,.28);
}

/* ════════════════
   매트릭스 뷰
════════════════ */
#matrix-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
#matrix-legend {
  display: flex; gap: 14px; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.ml-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text2);
}
.ml-dot {
  width: 10px; height: 10px; border-radius: 2px;
}
#matrix-scroll {
  overflow-x: auto;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}
#matrix-table {
  border-collapse: collapse;
  min-width: 800px;
  font-size: 11px;
}
#matrix-table th {
  padding: 6px 8px; text-align: left;
  color: var(--text2); font-weight: 600;
  white-space: nowrap; position: sticky; top: 0;
  background: var(--bg2); border-bottom: 1px solid var(--border);
}
#matrix-table th.step-th {
  text-align: center; min-width: 30px; padding: 6px 4px;
}
#matrix-table td {
  padding: 8px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
#matrix-table tr:hover td { background: var(--bg3); }
.mat-proj-name {
  font-weight: 700; font-size: 12px; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mat-proj-client {
  font-size: 10px; color: var(--text2); margin-top: 2px;
}
.mat-cell {
  width: 26px; height: 26px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; font-size: 10px;
}
.mat-cell.s-pending  { background: var(--bg3); }
.mat-cell.s-active   { background: var(--accent); }
.mat-cell.s-done     { background: var(--green); }
.mat-cell.s-skip     { background: var(--bg3); opacity: .4; }
.mat-cell.s-done i   { color: #fff; }
.mat-cell.s-active i { color: #fff; }

/* ════════════════════════
   16단계 현황 파이프라인 뷰
════════════════════════ */
#pipeline-wrap {
  display: flex; flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ── 범례 바 ── */
#pipeline-legend {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.pl-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text2);
}
.pl-dot {
  width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0;
}
.pl-note { font-size: 11px; color: var(--text2); opacity: .7; margin-left: auto; }
.pl-note i { color: var(--accent); }

/* ── 스크롤 래퍼 ── */
#pipeline-scroll {
  overflow-x: auto; overflow-y: auto;
  max-height: calc(100vh - 160px);
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}
#pipeline-board {
  display: flex; flex-direction: column; gap: 20px;
  min-width: fit-content;
}

/* ── 페이즈 섹션 ── */
.pip-phase-section {
  display: flex; flex-direction: column; gap: 8px;
}
.pip-phase-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .4px;
  padding: 5px 10px; border-radius: var(--radius-s);
  background: rgba(255,255,255,.04);
}
.pip-phase-header i { font-size: 11px; }

/* ── 단계 컬럼 행 ── */
.pip-phase-cols {
  display: flex; gap: 8px;
  align-items: flex-start;
}

/* ── 단계 컬럼 ── */
.pip-col {
  flex: 1; min-width: 140px; max-width: 200px;
  display: flex; flex-direction: column;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  overflow: hidden;
}

/* ── 컬럼 헤더 ── */
.pip-col-hd {
  display: flex; flex-direction: column; gap: 3px;
  padding: 7px 8px 6px;
  background: rgba(255,255,255,.04);
  border-bottom: 1px solid var(--border);
  min-height: 36px;
}
.pip-col-hd.has-active { background: rgba(99,102,241,.12); }
.pip-col-hd.has-done   { background: rgba(16,185,129,.08); }

/* 헤더 첫째 줄: 번호 + 제목 + 뱃지 */
.pip-col-hd-row1 {
  display: flex; align-items: center; gap: 6px;
}

.pip-step-num {
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 9px; font-weight: 800; color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pip-step-title {
  font-size: 11px; font-weight: 700; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text);
}
.pip-col-hd.has-active .pip-step-title { color: #a5b4fc; }
.pip-col-hd.has-done   .pip-step-title { color: #6ee7b7; }

/* 카운트 뱃지 */
.pip-badge {
  font-size: 9px; font-weight: 800;
  padding: 1px 5px; border-radius: 8px;
  flex-shrink: 0;
}
.pip-badge-active { background: var(--accent); color: #fff; }
.pip-badge-done   { background: var(--green);  color: #fff; }

/* 단계별 계약금액 합산 — 헤더 둘째 줄 */
.pip-step-amount {
  display: block;
  font-size: 10px; font-weight: 700;
  color: #fbbf24;
  letter-spacing: 0.01em;
  padding-left: 26px; /* pip-step-num 너비(20px) + gap(6px) 만큼 들여쓰기 */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pip-col-hd.has-active .pip-step-amount { color: #fde68a; }

/* ── 카드 영역 ── */
.pip-col-cards {
  padding: 6px;
  display: flex; flex-direction: column; gap: 5px;
  min-height: 40px;
}
.pip-col-empty {
  text-align: center; color: var(--text2); opacity: .35;
  font-size: 18px; padding: 10px 0 6px;
}

/* ── 프로젝트 카드 ── */
.pip-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 8px 9px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.pip-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
}
.pip-card-active {
  border-color: rgba(99,102,241,.5);
  background: rgba(99,102,241,.07);
}
.pip-card-active:hover { border-color: var(--accent); }

.pip-card-done {
  opacity: .65;
}
.pip-card-done:hover { opacity: 1; }

.pip-card-name {
  font-size: 12px; font-weight: 700;
  line-height: 1.35; margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pip-card-client {
  font-size: 10px; color: var(--text2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 3px;
}
.pip-card-owner,
.pip-card-date {
  font-size: 10px; color: var(--text2);
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 2px;
}
.pip-card-owner i { color: var(--accent); font-size: 9px; }
.pip-card-date  i { color: var(--yellow); font-size: 9px; }

/* ── 프로젝트 일정 행 (착수일 ~ 완료예정일) ── */
.pip-card-schedule {
  color: var(--text2);
  font-size: 10px;
}
.pip-card-schedule i { color: #38bdf8 !important; }  /* 파란 달력 아이콘 */

/* ── 최종 작업 날짜 행 ── */
.pip-card-last-work {
  display: flex; align-items: center; gap: 3px;
  font-size: 10px; color: var(--text2);
  margin-bottom: 2px;
  border-top: 1px dashed var(--border);
  padding-top: 4px; margin-top: 2px;
}
.pip-card-last-work i { color: var(--accent); font-size: 9px; flex-shrink: 0; }
.pip-date-label {
  font-size: 9px; color: var(--text3);
  background: var(--bg3);
  padding: 0px 4px; border-radius: 3px;
  flex-shrink: 0;
}
.pip-last-step {
  flex: 1; min-width: 0;
  font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 10px;
}
.pip-last-date {
  flex-shrink: 0; color: var(--text3);
  font-size: 10px; white-space: nowrap;
}

/* 진행률 바 */
.pip-card-prog {
  display: flex; align-items: center; gap: 5px;
  margin-top: 5px;
}
.pip-prog-bar {
  flex: 1; height: 3px; border-radius: 2px;
  background: var(--border); overflow: hidden;
}
.pip-prog-fill {
  height: 100%; border-radius: 2px; transition: width .3s;
}
.pip-prog-pct {
  font-size: 9px; font-weight: 800; width: 26px; text-align: right;
}

/* ── 빈 상태 ── */
.pip-empty {
  text-align: center; color: var(--text2);
  padding: 60px 20px;
}
.pip-empty i { font-size: 36px; margin-bottom: 12px; display: block; opacity: .4; }
.pip-empty p { font-size: 13px; }

/* ── 반응형 ── */
@media (max-width: 900px) {
  #kanban-board { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  #dash-header   { padding: 8px 12px; }
  #main          { padding: 10px 8px; }
  .vtab span     { display: none; }
  .vtab          { padding: 7px 10px; }
  .ds-item       { gap: 3px; }
  #dash-stats    { gap: 10px; }
  .pip-col       { min-width: 120px; }
}

/* ════════════════
   통합일정 뷰 (Gantt) — 16단계 행 기준
════════════════ */
#schedule-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ── 툴바 ── */
#schedule-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
  background: var(--bg2);
}
#schedule-legend {
  display: flex; gap: 14px; flex-wrap: wrap;
}
.sl-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text2);
}
.sl-dot {
  width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0;
}
.sl-pulse { animation: pulse-badge 1.8s ease-in-out infinite; }
@keyframes pulse-badge { 0%,100%{opacity:1} 50%{opacity:.4} }
#schedule-zoom {
  display: flex; align-items: center; gap: 8px;
}

/* ── 스크롤 영역 ── */
#schedule-scroll {
  overflow-x: auto; overflow-y: auto;
  max-height: calc(100vh - 160px);
  -webkit-overflow-scrolling: touch;
  position: relative;
}
#schedule-chart { min-width: 600px; font-size: 12px; }

/* ── 고정 헤더 ── */
.sch-header {
  display: flex;
  position: sticky; top: 0; z-index: 15;
  background: var(--bg2);
  border-bottom: 2px solid var(--border);
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.sch-label-col {
  width: 200px; min-width: 200px; flex-shrink: 0;
  background: var(--bg2);
  position: sticky; left: 0; z-index: 16;
  border-right: 1px solid var(--border);
}
.sch-header-right { overflow: hidden; }
.sch-months {
  display: flex; height: 24px;
  border-bottom: 1px solid var(--border);
}
.sch-month {
  text-align: center; font-size: 10px; font-weight: 700;
  color: var(--text2); border-right: 1px solid var(--border);
  line-height: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex-shrink: 0;
}
.sch-days { display: flex; height: 20px; }
.sch-day-th {
  text-align: center; font-size: 9px; color: var(--text2);
  border-right: 1px solid rgba(255,255,255,.04);
  line-height: 20px; flex-shrink: 0; overflow: hidden;
}
.sch-day-th.sch-today    { background: rgba(99,102,241,.35); color:#fff; font-weight:700; }
.sch-day-th.sch-weekstart { border-left: 1px solid var(--border); }

/* ── body ── */
.sch-body { display: flex; flex-direction: column; }

/* ── 프로젝트 그룹 ── */
.sch-proj-group {
  border-bottom: 2px solid var(--border);
}
.sch-proj-group:last-child { border-bottom: none; }

/* ── 공통 행 ── */
.sch-row {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,.04);
  min-height: 36px;
}

/* ── 프로젝트 헤더 행 ── */
.sch-proj-row {
  min-height: 48px;
  background: rgba(255,255,255,.03);
}
.sch-proj-row:hover { background: rgba(255,255,255,.05); }

.sch-row-label {
  width: 200px; min-width: 200px; flex-shrink: 0;
  padding: 6px 10px;
  position: sticky; left: 0; z-index: 5;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: center;
}
.sch-proj-row .sch-row-label {
  background: var(--bg2);
  border-right: 1px solid var(--border);
}
.sch-proj-row:hover .sch-row-label { background: var(--bg3); }

.sch-proj-row-label {
  gap: 2px;
}
.sch-proj-link {
  font-size: 13px; font-weight: 700; color: var(--text);
  text-decoration: none; line-height: 1.4;
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sch-proj-link:hover { color: var(--accent); }
.sch-proj-client {
  font-size: 10px; color: var(--text2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sch-proj-pct {
  font-size: 10px; font-weight: 700; margin-top: 2px;
}

/* ── 단계 행 ── */
.sch-step-row { min-height: 32px; }
.sch-step-row:hover { background: rgba(255,255,255,.025); }
.sch-step-row:hover .sch-row-label { background: var(--bg3); }

/* 단계 라벨 셀 */
.sch-step-row-label {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px 4px 14px;
  background: var(--bg2);
}
.sch-step-ph-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.sch-step-id {
  font-size: 10px; font-weight: 800;
  width: 16px; text-align: center; flex-shrink: 0;
}
.sch-step-title {
  font-size: 11px; color: var(--text2); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 상태에 따른 라벨 색 */
.sch-step-row.s-done   .sch-step-title { color: #6ee7b7; }
.sch-step-row.s-active .sch-step-title { color: #a5b4fc; }
.sch-step-row.s-skip   .sch-step-title { opacity: .45; }

/* 상태 아이콘 */
.sch-si { font-size: 10px; flex-shrink: 0; color: var(--text2); opacity: .5; }
.sch-si-active { color: var(--accent) !important; opacity: 1; animation: pulse-badge 1.6s infinite; }
.sch-si-done   { color: var(--green)  !important; opacity: 1; }
.sch-si-skip   { color: var(--yellow) !important; opacity: .7; }

/* ── 바 영역 ── */
.sch-row-bars {
  position: relative; flex-shrink: 0;
  display: flex; align-items: center;
}

/* ── 오늘 수직선 ── */
.sch-today-line {
  position: absolute; top: 0; bottom: 0;
  width: 2px; background: rgba(99,102,241,.6);
  z-index: 4; pointer-events: none;
}
.sch-today-line::before {
  content: ''; position: absolute; top: 2px; left: -3px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
/* 단계 행의 오늘 선은 더 얇게 */
.sch-today-thin {
  width: 1px;
  background: rgba(99,102,241,.35);
}
.sch-today-thin::before { display: none; }

/* ── 간트 바 공통 ── */
.sch-bar {
  position: absolute;
  border-radius: 4px; overflow: hidden; cursor: default;
  display: flex; align-items: center;
  transition: filter .15s, box-shadow .15s;
}
.sch-bar:hover { filter: brightness(1.3); z-index: 3; }

/* ── 프로젝트 기간 바 (헤더 행용) ── */
.sch-proj-bar {
  top: 10px; height: 18px;
}
.sch-bar-fill {
  position: absolute; left:0; top:0; bottom:0;
  border-radius: 4px 0 0 4px; pointer-events: none;
}
.sch-bar-label {
  position: relative; z-index:1;
  font-size: 10px; font-weight: 700;
  padding: 0 6px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  width: 100%;
}

/* ── 단계 바 (단계 행용) ── */
.sch-step-bar {
  top: 5px; height: 22px;
  justify-content: center;
}
.sch-step-num {
  font-size: 9px; font-weight: 800;
  position: relative; z-index:1;
}
.sch-step-bar.s-done    { }
.sch-step-bar.s-active  { animation: sch-active-pulse 2s ease-in-out infinite; }
.sch-step-bar.s-pending { opacity: .5; }
.sch-step-bar.s-skip    { opacity: .35; }
@keyframes sch-active-pulse {
  0%,100% { box-shadow: 0 0 0 0   rgba(99,102,241,.3); }
  50%     { box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
}

/* ── 날짜 없는 단계 — 상태 칩 표시 ── */
.sch-no-date-chip {
  position: absolute; left: 6px; top: 7px;
  font-size: 9px; padding: 2px 6px;
  border-radius: 4px; color: var(--text2);
  background: var(--bg3); border: 1px solid var(--border);
  pointer-events: none;
}

/* ── 빈 상태 ── */
.sch-empty {
  text-align: center; color: var(--text2); padding: 60px 20px;
}
.sch-empty i { font-size: 36px; margin-bottom: 12px; display: block; }
.sch-empty p { font-size: 13px; }

/* ════════════════════════════════════════════
   오늘 일정 뷰 (renderTodaySchedule)
════════════════════════════════════════════ */
#today-sched-wrap {
  padding: 16px;
}

/* ── 필터 툴바 ── */
#today-sched-toolbar {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 16px;
}
.tsch-filter-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.tsch-quick-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px;
  font-size: 12px; font-weight: 600;
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border);
  cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.tsch-quick-btn:hover { background: var(--bg4,var(--bg3)); color: var(--text); }
.tsch-quick-btn.active {
  background: rgba(99,102,241,.18); color: #a5b4fc;
  border-color: rgba(99,102,241,.45);
}
#tsch-range-inputs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--bg3); border-radius: 10px;
  border: 1px solid var(--border);
}
.tsch-range-label { font-size: 11px; color: var(--text2); font-weight: 600; }
.tsch-date-inp {
  padding: 5px 10px; border-radius: 7px;
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--border);
  font-size: 12px; outline: none;
  color-scheme: dark;
}
.tsch-date-inp:focus { border-color: var(--accent); }
.tsch-apply-btn {
  padding: 5px 14px; border-radius: 7px;
  background: var(--accent); color: #fff;
  border: none; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: opacity .15s;
}
.tsch-apply-btn:hover { opacity: .85; }
#tsch-period-badge { display: flex; align-items: center; }
.tsch-period-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(16,185,129,.12); color: #10b981;
  border: 1px solid rgba(16,185,129,.25);
  border-radius: 20px; padding: 4px 12px;
  font-size: 12px; font-weight: 600;
}

/* ── 프로젝트 카드 ── */
.tsch-results {
  display: flex; flex-direction: column; gap: 14px;
}
.tsch-proj-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  transition: border-color .15s;
}
.tsch-proj-card:hover { border-color: rgba(99,102,241,.4); }
.tsch-proj-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bg3);
}
.tsch-proj-color {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.tsch-proj-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tsch-proj-name {
  font-size: 14px; font-weight: 700; color: var(--text);
  text-decoration: none;
}
.tsch-proj-name:hover { color: var(--accent); text-decoration: underline; }
.tsch-proj-client { font-size: 11px; color: var(--text2); }
.tsch-proj-cnt {
  flex-shrink: 0;
  background: rgba(99,102,241,.12); color: #a5b4fc;
  border-radius: 20px; padding: 2px 8px;
  font-size: 10px; font-weight: 700;
}

/* ── 단계 행 ── */
.tsch-step-list { padding: 6px 0; }
.tsch-step-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 16px; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .12s;
}
.tsch-step-row:last-child { border-bottom: none; }
.tsch-step-row:hover { background: rgba(255,255,255,.03); }
.tsch-step-row.s-done { opacity: .7; }

.tsch-step-left {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
}
.tsch-step-num {
  font-size: 11px; font-weight: 700; font-family: monospace;
  min-width: 18px; text-align: center;
}
.tsch-step-info {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.tsch-step-title {
  font-size: 12px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tsch-step-status { font-size: 10px; font-weight: 600; }

.tsch-step-right {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end;
}
.tsch-step-owner {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(99,102,241,.12); color: #a5b4fc;
  border: 1px solid rgba(99,102,241,.22);
  border-radius: 20px; padding: 2px 9px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.tsch-step-owner i { font-size: 10px; }
.tsch-no-owner {
  background: rgba(71,85,105,.15); color: var(--text3,var(--text2));
  border-color: rgba(71,85,105,.25);
}
.tsch-step-date {
  font-size: 10px; color: var(--text2);
  white-space: nowrap;
}
.tsch-step-date i { font-size: 9px; margin-right: 2px; }

/* ── 빈 결과 ── */
.tsch-empty {
  text-align: center; color: var(--text2);
  padding: 60px 20px;
}
.tsch-empty i { font-size: 40px; margin-bottom: 12px; display: block; color: var(--border); }
.tsch-empty p { font-size: 13px; }

/* ── 오늘일정 — 날짜 유형 배지 ── */
.tsch-date-badges {
  display: flex; flex-direction: column; gap: 3px; align-items: flex-end;
}
.tsch-date-badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 20px; padding: 2px 8px;
  font-size: 10px; font-weight: 700; white-space: nowrap;
  border: 1px solid transparent;
}
.tsch-date-badge i { font-size: 9px; }

/* 완료됨 — 초록 */
.tsch-date-done {
  background: rgba(16,185,129,.12); color: #34d399;
  border-color: rgba(16,185,129,.25);
}
/* 착수 중 — 인디고 */
.tsch-date-working {
  background: rgba(99,102,241,.12); color: #a5b4fc;
  border-color: rgba(99,102,241,.25);
}
/* 완료예정 — 노란/주황 */
.tsch-date-scheduled {
  background: rgba(245,158,11,.12); color: #fbbf24;
  border-color: rgba(245,158,11,.25);
}
/* 다음단계 예정 — 하늘/시안 */
.tsch-date-next {
  background: rgba(14,165,233,.14); color: #38bdf8;
  border-color: rgba(14,165,233,.28);
}

/* ── 행 하이라이트 ── */
.tsch-row-done   { background: rgba(16,185,129,.04); }
.tsch-row-active { background: rgba(99,102,241,.05); }
.tsch-row-next   { background: rgba(14,165,233,.06); border-left: 2px solid rgba(14,165,233,.5); }

/* ── 프로젝트 카드 상단 카운트 뱃지 ── */
.tsch-proj-cnt-wrap {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  flex-shrink: 0;
}
.tsch-cnt-badge {
  display: inline-flex; align-items: center; gap: 3px;
  border-radius: 20px; padding: 2px 8px;
  font-size: 10px; font-weight: 700; white-space: nowrap;
}
.tsch-cnt-done  { background: rgba(16,185,129,.12); color: #34d399; }
.tsch-cnt-sched { background: rgba(245,158,11,.12);  color: #fbbf24; }
.tsch-cnt-next  { background: rgba(14,165,233,.14);  color: #38bdf8; }

/* ── 반응형 ── */
@media (max-width: 600px) {
  .tsch-step-row { flex-wrap: wrap; }
  .tsch-step-right { width: 100%; justify-content: flex-start; padding-left: 36px; }
  .tsch-quick-btn span { display: none; }
  .tsch-date-badges { align-items: flex-start; }
}

/* ── 커스텀(독립) 일정 카드 ── */
.tsch-add-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px;
  font-size: 12px; font-weight: 600;
  background: rgba(249,115,22,.15); color: #f97316;
  border: 1px solid rgba(249,115,22,.35);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.tsch-add-btn:hover { background: rgba(249,115,22,.25); }

.csch-card .tsch-proj-header { background: rgba(249,115,22,.07); }
.csch-memo {
  font-size: 11px; color: var(--text2);
  margin-top: 3px; line-height: 1.5;
}
.csch-action-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text2); font-size: 11px; padding: 3px 6px;
  border-radius: 5px; transition: all .12s;
}
.csch-action-btn:hover { background: var(--bg3); color: var(--text); }
.csch-del-btn:hover { color: #ef4444; }

/* 커스텀 일정 모달 */
#csch-modal {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
  align-items: center; justify-content: center; padding: 16px;
}

/* ══════════════════════════════════════════════
   오늘일정 접기/펼치기 — v117
══════════════════════════════════════════════ */

/* 헤더 — 토글 가능 상태 */
.tsch-proj-toggle {
  user-select: none;
  transition: background .12s;
}
.tsch-proj-toggle:hover {
  background: var(--bg4, rgba(255,255,255,.04)) !important;
}
.tsch-proj-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* 토글 버튼 */
.tsch-toggle-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 8px;
  background: rgba(99,102,241,.12); color: #a5b4fc;
  border: 1px solid rgba(99,102,241,.22);
  font-size: 11px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.tsch-toggle-btn:hover {
  background: rgba(99,102,241,.22); color: #c7d2fe;
}
.tsch-toggle-icon {
  font-size: 10px;
  transition: transform .2s ease;
}
.tsch-toggle-icon--open {
  transform: rotate(180deg);
}

/* 축약 뷰 — 단계 요약 라인 */
.tsch-proj-summary {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px 8px 14px;
  background: var(--bg2);
  border-top: 1px solid rgba(255,255,255,.05);
  flex-wrap: wrap;
}
.tsch-summary-step {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px;
}
.tsch-summary-step-title {
  font-weight: 600;
}
.tsch-summary-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255,255,255,.07);
  font-size: 10px; font-weight: 700; font-family: monospace;
  color: var(--text2);
  flex-shrink: 0;
}
.tsch-summary-more {
  font-size: 11px; color: var(--text3, var(--text2));
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px; padding: 1px 8px;
  flex-shrink: 0;
}

/* 상세 뷰 — 기본 숨김 */
.tsch-step-list--hidden {
  display: none !important;
}

/* 반응형 */
@media (max-width: 600px) {
  .tsch-toggle-label { display: none; }
  .tsch-toggle-btn { padding: 4px 8px; }
  .tsch-proj-summary { gap: 6px; }
}
