/* 「사업부·팀 매출」 — 색은 tokens.css 변수만 쓴다 */
.screen-sales-org .so-main .panel-actions { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.screen-sales-org .so-all {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--r-btn); padding: 5px 12px; font: inherit; font-size: var(--fs-13); cursor: pointer;
}
.screen-sales-org .so-all:hover { border-color: var(--muted); }

/* 한 줄 판정 */
.screen-sales-org .so-verdict {
  font-size: var(--fs-14); line-height: 1.6; color: var(--ink);
  padding: 10px 14px; background: var(--paper); border-left: 3px solid var(--filament); border-radius: 0 6px 6px 0;
}
.screen-sales-org .so-verdict b { font-weight: 600; }
.screen-sales-org .so-unit { margin-top: -4px; }

/* 표 — 이름 칸 */
/* vertical-align:top — 글자 없는 삼각형이 기준선을 끌어내려 사업부 줄만 높아지던 것을 막는다 */
.screen-sales-org .so-name { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; vertical-align: top; }
/* 접기 표시 — 글꼴에 따라 ▸ 가 점처럼 작아져서 테두리 삼각형으로 그린다 */
.screen-sales-org .so-caret { display: inline-block; width: 12px; height: 12px; position: relative; font-size: 0; flex: 0 0 auto; }
.screen-sales-org .so-caret::before {
  content: ''; position: absolute; left: 3px; top: 2px;
  border-style: solid; border-width: 4px 0 4px 6px; border-color: transparent transparent transparent var(--muted);
  transition: transform .15s;
}
.screen-sales-org tr.open .so-caret::before { transform: rotate(90deg); }
.screen-sales-org .so-count { font-size: var(--fs-12); color: var(--muted); font-weight: 400; }
.screen-sales-org .so-team { padding-left: 18px; }
.screen-sales-org .tbl tr.so-row-total td,
.screen-sales-org .tbl tr.so-row-total th { font-weight: 700; border-bottom: 1px solid var(--line-strong, var(--line)); }
.screen-sales-org .tbl tr.so-row-div th,
.screen-sales-org .tbl tr.so-row-div td { font-weight: 600; background: var(--paper); }
.screen-sales-org .tbl tr.so-row-div:hover th,
.screen-sales-org .tbl tr.so-row-div:hover td { background: var(--line); }
.screen-sales-org .tbl tr.so-row-team td,
.screen-sales-org .tbl tr.so-row-team th { font-weight: 400; }
.screen-sales-org .tbl tr.selected th { background: var(--filament-soft); box-shadow: inset 3px 0 0 var(--filament), inset -1px 0 0 var(--line); }
.screen-sales-org .tbl tbody tr:focus-visible { outline: 2px solid var(--filament); outline-offset: -2px; }

/* 열 머리 정렬 단추 — 사업부 안에서 팀끼리만 정렬(코어 정렬은 계층을 흩뜨려서 화면이 직접 한다) */
.screen-sales-org .so-sort {
  border: 0; background: none; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 2px; white-space: nowrap;
}
.screen-sales-org .so-sort:hover { color: var(--ink); }
.screen-sales-org .so-sort-ind { display: inline-block; width: 10px; color: var(--filament-ink); font-size: 10px; }
.screen-sales-org .tbl thead th.sorted { color: var(--ink); box-shadow: inset 0 -2px 0 var(--filament); }
/* 표 부품은 열의 className 을 본문 칸에도 붙인다 — 밑줄은 머리에만 */
.screen-sales-org .tbl tbody .sorted, .screen-sales-org .tbl tfoot .sorted { box-shadow: none; }
.screen-sales-org .tbl tbody .sticky-col.sorted { box-shadow: inset -1px 0 0 var(--line); }
.screen-sales-org .tbl tbody tr.selected th.sticky-col { box-shadow: inset 3px 0 0 var(--filament), inset -1px 0 0 var(--line); }
.screen-sales-org .so-dup { color: var(--ink); }

/* 윗줄 카드 보조 줄은 제 줄로 */
.screen-sales-org .kpi-delta > span:has(> .so-kpi-sub) { flex-basis: 100%; }

/* 달성 칸 — 필라멘트(sm) */
.screen-sales-org .so-ach { min-width: 116px; }
.screen-sales-org .so-ach .fil { flex-direction: row; align-items: center; gap: 8px; }
.screen-sales-org .so-ach .fil-track { order: 1; flex: 1 1 auto; min-width: 56px; }
.screen-sales-org .so-ach .fil-head { order: 2; flex: 0 0 40px; justify-content: flex-end; font-size: var(--fs-13); }
.screen-sales-org .so-ach .fil-head > span:first-child { display: none; }
/* 1024~1279 — 달성 칸을 줄여 표 가로 스크롤을 없앤다 */
@media (min-width: 768px) and (max-width: 1279px) {
  .screen-sales-org .so-ach { min-width: 80px; }
  .screen-sales-org .so-ach .fil-track { min-width: 28px; }
  .screen-sales-org .so-table .tbl th, .screen-sales-org .so-table .tbl td { padding-left: 7px; padding-right: 7px; }
  .screen-sales-org .so-table .tbl thead tr:first-child th:first-child { width: 168px !important; min-width: 168px !important; }
}

/* 오른쪽 상세 — sidePanel 은 body 에 붙으므로 .so-side 로 가둔다 */
.so-side { display: flex; flex-direction: column; gap: var(--sp-5); }
.so-side .so-side-sec { display: flex; flex-direction: column; gap: var(--sp-2, 8px); }
.so-side .so-h3 { font-size: var(--fs-14); font-weight: 600; color: var(--ink); }
.so-side .so-h3-sub { font-size: var(--fs-12); font-weight: 400; color: var(--muted); }
/* 월별 납품 꺾은선 — 부모 폭에 맞춘다. 진행 중인 달은 점선 + 속 빈 점 */
.so-side .so-ml { width: 100%; min-height: 128px; }
.so-side .so-ml svg { display: block; overflow: visible; }
.so-side .so-ml-line { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.so-side .so-ml-cur { stroke-dasharray: 3 3; stroke: var(--muted); }
.so-side .so-ml-dot { fill: var(--ink); }
.so-side .so-ml-dot.cur { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.so-side .so-ml-ax { font-size: 11px; fill: var(--muted); }
.so-side .so-ml-val { font-size: 11px; fill: var(--ink-2, var(--ink)); font-variant-numeric: tabular-nums; }
.so-side .so-side-foot { display: flex; justify-content: flex-end; padding-top: 4px; }
.so-side .kpi-value { font-size: var(--fs-20); }
.so-side .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }

/* 폰(<768): 이름 칸은 줄을 바꿔 좁게 — 달성 칸이 첫 화면에 오게 */
@media (max-width: 767px) {
  .screen-sales-org .so-name { white-space: normal; word-break: keep-all; }
  .screen-sales-org .so-ach { width: 84px; min-width: 0; }
}
