/* login.css — 로그인 화면(조직도 2단 트리) 전용.
   ktc_mng css/auth/login.css 와 같은 역할: 카드/공통 컴포넌트 색은 새로 만들지 않고
   common.css 토큰(--navy/--primary/--border …)과 content.css 의 .login-* 를 그대로 쓰고,
   이 파일은 "조직 트리 2단"에 필요한 것만 덧댄다.
   ★ 반드시 content.css 뒤에 로드한다(layout.html link 순서) — 같은 특이도에서 이쪽이 이긴다. */

/* 트리 칸을 조금 넓힌다 — 회사명 + 유형/레벨 두 줄이 들어간다 */
.login-main { grid-template-columns: 288px 1fr; }
.tree-pane { display: flex; flex-direction: column; padding: 10px 0 0; max-height: 460px; }
.tree-root { display: flex; align-items: center; gap: 6px; }
.tree-root-cnt { font-size: 11px; font-weight: 600; color: var(--text3); }

/* ── 검색 ── */
.lg-search { padding: 0 12px 8px; }
.lg-search input {
  width: 100%; font-family: inherit; font-size: 12.5px; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text);
}
.lg-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-weak); }

#lg-treelist { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 10px; }

/* ── 노드 ── */
.tree-org-wrap { border-bottom: 1px solid #edf1f6; }
.tree-org-wrap:last-child { border-bottom: 0; }
.tree-node { align-items: flex-start; }
.tree-node.tree-org { padding: 9px 12px; }
.tree-node.tree-org.in { background: #f3f7ff; }
.tree-node.tree-org.on { background: var(--primary-weak); }
.tree-caret { flex-shrink: 0; width: 12px; height: 20px; position: relative; font-size: 0; cursor: pointer; }
.tree-caret.c-open::before, .tree-caret.c-closed::before {
  content: ''; position: absolute; left: 1px; top: 6px; width: 6px; height: 6px;
  border-right: 1.6px solid var(--text3); border-bottom: 1.6px solid var(--text3);
  transform: rotate(45deg);   /* 펼침 = 아래 방향 */
}
.tree-caret.c-closed::before { transform: rotate(-45deg); }  /* 접힘 = 오른쪽 방향 */
.tree-ico {
  flex-shrink: 0; width: 8px; height: 8px; margin-top: 6px; border-radius: 2px;
}
.tree-ico.i-prov { background: var(--navy); }
.tree-ico.i-osc { background: var(--success); }
.tree-main { display: block; flex: 1; min-width: 0; }
.tree-main .tree-name {
  display: block; flex: none; font-size: 13px; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tree-sub {
  display: block; font-size: 11px; color: var(--text3); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400;
}
.tree-kind {
  display: inline-block; border-radius: 99px; padding: 0 6px; font-weight: 700; font-size: 10.5px;
  margin-right: 3px;
}
.tree-kind.k-prov { background: #E8EEF9; color: var(--navy); }
.tree-kind.k-osc { background: #E6F6EC; color: var(--success); }
.tree-cnt { flex-shrink: 0; line-height: 18px; }

/* 2단(권한그룹) */
.tree-kids { padding-bottom: 4px; }
.tree-kids.closed { display: none; }
.tree-node.tree-grp { padding: 5px 12px 5px 30px; font-size: 12.5px; }
.tree-node.tree-grp .tree-name { font-size: 12.5px; color: var(--text2); }
.tree-node.tree-grp.on .tree-name { color: var(--primary); font-weight: 700; }
.tree-node.tree-grp .tag { font-size: 10px; padding: 0 6px; flex-shrink: 0; }
.tree-node:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

/* ── 인원 목록 ── */
.login-list-hd b { color: var(--navy); }
.login-list-hd .lg-sub { color: var(--text3); font-weight: 400; }
.login-list-scroll { max-height: 214px; }
.lg-row .lg-id { font-size: 12.5px; color: var(--text2); white-space: nowrap; }
.lg-row .lg-last { margin-left: 5px; font-size: 10px; padding: 0 6px; }
.lg-row .lg-ao { margin-left: 5px; font-size: 10.5px; }
.lg-row .lg-org { font-size: 11.5px; }

/* ── 상세 ── */
.lg-d-who { min-width: 0; }
.lg-d-org { font-size: 12px; color: var(--text2); margin-top: 5px; line-height: 1.5; }
.lg-d-org b { color: var(--navy); }
.lg-d-org .tag { margin-left: 4px; font-size: 10.5px; }
.lg-tops { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 4px; }
.lg-top {
  display: inline-block; padding: 2px 9px; border-radius: 4px; font-size: 11px; font-weight: 700;
  color: #fff; background: var(--navy);
}
.lg-leaves { font-size: 11.5px; color: var(--text3); line-height: 1.6; }
.lg-sum2 { margin-top: 5px; font-size: 11.5px; color: var(--text3); }

/* ── 반응형 ── */
@media (max-width: 1100px) { .login-main { grid-template-columns: 260px 1fr; } }
@media (max-width: 860px) {
  .login-main { grid-template-columns: 1fr; }
  .tree-pane { border-right: 0; border-bottom: 1px solid var(--border); max-height: 250px; }
  .login-list-scroll { max-height: 180px; }
}
@media (max-width: 520px) {
  .tree-pane { max-height: 220px; }
  .tree-node.tree-org { padding: 8px 10px; }
  .tree-node.tree-grp { padding-left: 26px; }
  .login-list-scroll { max-height: 156px; }
  .lg-row .lg-ao { display: none; }
}
