/* perf-channel.css — 퍼포먼스 채널 전용 스타일.
   common.css에서 분리(2026-06-22 Stage0, barybody-perfchannel 핸드오버 대상).
   ⚠ common.css보다 뒤에 로드해 캐스케이드 동일 유지. */

/* ── 퍼포먼스 매출 목표 카드(.pt-*) ── */
    .pt-head {
      display: flex; align-items: center; justify-content: space-between;
      gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
    }
    .pt-head .section-title { margin: 0; }
    /* 월 전환 세그먼트 [6월 5월 4월] — 기존 unit-toggle 톤과 통일 */
    .pt-months {
      display: inline-flex; gap: 2px; padding: 3px;
      background: var(--surface-2); border-radius: var(--radius-pill);
      border: 1px solid var(--line);
    }
    .pt-mbtn {
      appearance: none; border: 0; background: transparent; cursor: pointer;
      font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted);
      padding: 6px 14px; border-radius: var(--radius-pill); line-height: 1;
      transition: background .15s ease, color .15s ease; white-space: nowrap;
    }
    .pt-mbtn:hover { color: var(--brand); }
    .pt-mbtn.is-active { background: var(--surface); color: var(--brand); box-shadow: 0 1px 2px rgba(46,51,47,.10); }
    .pt-mbtn .pt-mtag { font-size: 10.5px; font-weight: 600; color: var(--muted); margin-left: 5px; }
    .pt-mbtn.is-active .pt-mtag { color: var(--sage); }

    /* 레이아웃: 합계 큰 카드(좌) + 채널 카드 그리드(우). 데스크탑 가로, 모바일 세로 스택. */
    .pt-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.15fr) minmax(0, 2fr);
      gap: 14px; align-items: stretch;
    }
    .pt-card {
      background: var(--surface); border: none; border-radius: var(--radius-lg);
      box-shadow: var(--shadow-card); padding: 20px 22px; min-width: 0;
      display: flex; flex-direction: column;
      transition: box-shadow .18s ease, transform .18s ease;
    }
    .pt-card:hover { box-shadow: var(--shadow-pop); transform: translateY(-2px); }

    /* 합계(핵심) 카드 */
    .pt-total { gap: 12px; }
    .pt-total-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
    .pt-total-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
    .pt-total-label .pt-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: 0 0 auto; }
    /* 핵심 히어로: 실제 달성률% 달성 / 예상 달성률% 예상 — 둘 다 메인 위계로 크게, 슬래시 구분.
       실제: 100%↑ 진세이지·미달 중립 차콜. 예상: 100% 초과 레드·이하 중립. (진행중월만 예상 표기) */
    /* 한 줄 고정(wrap 금지) + 자식 전부 em → 폭 초과 시 JS(fitPtHeroes)가 컨테이너 font-size만 비율 축소.
       gap·캡·슬래시도 em이라 축소가 선형으로 정확히 맞는다(위계·색 규칙은 그대로, 크기만 유동). */
    .pt-hero { display: flex; align-items: baseline; gap: .2em .25em; flex-wrap: nowrap; white-space: nowrap; min-width: 0; font-size: 39.6px; }
    .pt-hero-item { display: inline-flex; align-items: baseline; gap: .15em; }
    .pt-hero-rate {
      font-size: 1em; font-weight: 800; line-height: 1; letter-spacing: -.03em;
      color: var(--charcoal); font-variant-numeric: tabular-nums;
    }
    .pt-hero-rate.is-hit { color: var(--brand); }
    /* 예상 달성률(합계) — 실제와 동급 크기. 100% 초과 레드 강조. */
    .pt-hero-exp {
      font-size: 1em; font-weight: 800; line-height: 1; letter-spacing: -.03em;
      color: var(--charcoal); font-variant-numeric: tabular-nums;
    }
    .pt-hero-exp.is-over { color: var(--neg-strong); }
    .pt-hero-cap { font-size: .316em; font-weight: 600; color: var(--muted); }
    .pt-hero-sep { font-size: .682em; font-weight: 300; line-height: 1; color: var(--line-strong); align-self: center; }
    /* 보조: 실매출/목표 금액(달성률보다 작게) */
    .pt-figs { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
    .pt-actual { font-size: 16px; font-weight: 700; letter-spacing: -.01em; color: var(--text-2); line-height: 1.1; font-variant-numeric: tabular-nums; }
    .pt-actual .pt-u { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 1px; }
    .pt-of { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
    .pt-of b { color: var(--text-2); font-weight: 600; }

    /* 진행률 게이지(공통: 합계=큰, 채널=미니) */
    .pt-gauge { position: relative; height: 12px; border-radius: var(--radius-pill); background: var(--sage-tint); overflow: hidden; }
    .pt-gauge.mini { height: 8px; }
    .pt-gauge-fill {
      position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--radius-pill);
      background: var(--sage); transition: width .5s cubic-bezier(.2,.7,.2,1); min-width: 2px;
    }
    .pt-gauge-fill.is-hit { background: linear-gradient(90deg, var(--grad-from), var(--brand)); }
    .pt-gauge-wrap { position: relative; }
    /* 예상 달성률 점선 마커 — 게이지 위 진행중월에만(마감월 생략). 게이지(overflow:hidden) 밖 wrap에 얹어
       위아래로 또렷이 튀어나오게. 직전보다 더 굵고(3px)·진하게(불투명·진세이지). 100% 초과 시 레드 일관. */
    .pt-gauge-wrap.has-mark { padding: 5px 0; }
    .pt-gauge-mark {
      position: absolute; top: 0; bottom: 0; width: 0; z-index: 2;
      border-left: 3px dashed var(--brand); opacity: 1;
      transform: translateX(-1.5px);
      transition: left .5s cubic-bezier(.2,.7,.2,1);
    }
    .pt-gauge-mark.is-over { border-left-color: var(--neg-strong); }
    /* 마커 머리 캡 — 점선 상단에 작은 삼각/점으로 위치를 더 또렷하게 */
    .pt-gauge-mark::before {
      content: ""; position: absolute; left: 50%; top: -3px; width: 6px; height: 6px;
      border-radius: 50%; background: var(--brand); transform: translateX(-50%);
    }
    .pt-gauge-mark.is-over::before { background: var(--neg-strong); }

    /* 델타(전월대비) 칩 — 기존 kpi-delta 톤 재사용 */
    .pt-delta {
      display: inline-flex; align-items: center; gap: 3px;
      font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap;
      padding: 3px 8px; border-radius: var(--radius-pill);
      color: var(--muted); background: var(--surface-2);
    }
    .pt-delta.up { color: var(--pos); background: var(--pos-bg); }
    .pt-delta.down { color: var(--neg); background: var(--neg-bg); }
    .pt-delta .arr { font-size: 8px; }

    /* 채널 미니 카드 그리드 (2×2 데스크탑) */
    .pt-channels { padding: 6px; gap: 0; display: grid; grid-template-columns: 1fr 1fr; }
    .pt-ch {
      padding: 14px 16px; border-radius: var(--radius-md); min-width: 0;
      display: flex; flex-direction: column; gap: 9px;
      transition: background .15s ease;
    }
    .pt-ch:hover { background: var(--surface-3); }
    .pt-ch-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .pt-ch-name { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
    /* 핵심: 채널 달성률% 달성 / 예상% 예상 — 둘 다 크게, 슬래시 구분. 실제 100%↑ 세이지·미달 중립, 예상 100% 초과 레드. */
    /* 한 줄 고정 + em 기반 — 합계 히어로와 동일하게 JS(fitPtHeroes)가 폭 초과 시 비율 축소 */
    .pt-ch-hero-row { display: flex; align-items: baseline; gap: .167em .25em; flex-wrap: nowrap; white-space: nowrap; min-width: 0; font-size: 24px; }
    .pt-ch-hero-item { display: inline-flex; align-items: baseline; gap: .167em; }
    .pt-ch-hero {
      font-size: 1em; font-weight: 800; line-height: 1; letter-spacing: -.02em;
      color: var(--charcoal); font-variant-numeric: tabular-nums;
    }
    .pt-ch-hero.is-hit { color: var(--brand); }
    .pt-ch-hero.muted { color: var(--muted); }
    /* 예상 달성률(채널) — 실제와 동급 크기. 100% 초과 레드. */
    .pt-ch-exp-rate {
      font-size: 1em; font-weight: 800; line-height: 1; letter-spacing: -.02em;
      color: var(--charcoal); font-variant-numeric: tabular-nums;
    }
    .pt-ch-exp-rate.is-over { color: var(--neg-strong); }
    .pt-ch-herocap { font-size: .4375em; font-weight: 600; color: var(--muted); }
    .pt-ch-sep { font-size: .708em; font-weight: 300; line-height: 1; color: var(--line-strong); align-self: center; }
    .pt-ch-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    /* 보조: 실매출/목표 금액(달성률보다 작게) */
    .pt-ch-amt { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 0; }
    .pt-ch-amt b { color: var(--text-2); font-weight: 700; }
    /* 쿠팡(목표0) 등 비활성 채널 — 자연스럽게 흐리게 */
    .pt-ch.is-empty .pt-ch-hero, .pt-ch.is-empty .pt-ch-amt b { color: var(--muted); }
    .pt-ch.is-empty .pt-gauge-fill { background: var(--line-2); }

    .pt-empty { color: var(--muted); font-size: 13px; padding: 18px 0; }

/* ── 데일리표 열 리사이즈 핸들 ── */
    .col-resize-handle { position: absolute; top: 0; bottom: 0; left: calc(var(--col-daily-label) - 3px); width: 7px; z-index: 35; cursor: col-resize; }
    .col-resize-handle::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 1px; background: transparent; transition: background .12s ease; }
    .col-resize-handle:hover::after, .col-resize-handle.is-dragging::after { background: var(--sage); width: 2px; }
    .col-resize-handle:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* ── 반응형(폰 ≤639) 퍼포먼스 목표 ── */
@media (max-width: 639px) {
      /* 퍼포먼스 목표: 폰에서 합계→채널 세로 스택, 채널은 1열, 월 세그먼트 풀폭 터치 */
      .pt-grid { grid-template-columns: 1fr; gap: 12px; }
      .pt-channels { grid-template-columns: 1fr; }
      .pt-head { gap: 10px; }
      .pt-months { width: 100%; justify-content: space-between; }
      .pt-mbtn { flex: 1 1 0; min-height: 40px; padding: 8px 8px; text-align: center; }
      .pt-card { padding: 16px 16px; }
      /* 달성률 히어로는 폰에서도 핵심 — 컨테이너 font-size만 줄이면 자식(em)이 비율로 따라온다.
         그래도 넘치면 JS(fitPtHeroes)가 추가 축소해 한 줄 유지. */
      .pt-hero { font-size: 30.6px; }
      .pt-actual { font-size: 15px; }
      .pt-ch-hero-row { font-size: 20px; }
}
