/* =============================================================
   설정 탭 셋 (회사정보 · 본인정보 · 역할 관리).
   거래처 상세와 같은 폼 골격(.pt-field / .pt-actions)을 그대로 쓴다.
   ============================================================= */
.set-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-1); padding: 16px 18px;
}
.set-section + .set-section { margin-top: 22px; }
.set-section-title {
  font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-dim); padding-bottom: 6px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.set-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.set-readonly { padding: 7px 0; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.set-hint { grid-column: 1 / -1; margin: -4px 0 0; color: var(--text-muted); font-size: 11.5px; line-height: 1.7; }

/* 포인트 컬러 — 고급버전은 모달이었다. 모달 안의 모달을 피해 인라인으로 폈다. */
.set-color-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.set-swatch {
  width: 26px; height: 26px; padding: 0; border: 2px solid transparent;
  border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 1px var(--border-strong);
}
.set-swatch.is-selected { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--surface-1); }
.set-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.set-color-native {
  width: 40px; height: 26px; padding: 0; border: 1px solid var(--border-strong);
  border-radius: 4px; background: var(--surface-1); cursor: pointer;
}
.set-color-hex { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* 역할 뱃지.
   ⚠️ 농도로 서열을 그리지 않는다. 역할은 서열이 아니라 담당이다(경리 · 창고).
   진하기로 크고 작음을 암시하면 "경리가 창고보다 높다"는 오해를 화면이 먼저 만든다. */
.mb-table .mb-level {
  display: inline-block; min-width: 24px; padding: 1px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; text-align: center;
  background: var(--accent-bg); color: var(--accent); white-space: nowrap;
}
/* 아직 역할을 안 입은 사람 — 「대기」는 자리가 비어 있다는 뜻이라 강조색을 쓰지 않는다. */
.mb-table .mb-level.is-wait { background: var(--surface-2); color: var(--text-dim); }
.mb-table .mb-note { color: var(--text-dim); font-size: 12px; }
.mb-table .mb-select {
  padding: 3px 6px; border: 1px solid var(--border-strong); border-radius: 4px;
  background: var(--surface-1); color: var(--text); font: inherit; font-size: 12px; cursor: pointer;
}
.mb-table .mb-select:hover { border-color: var(--accent); }
.mb-table .mb-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); }

/* 역할 관리 탭만 표가 둘이다. 둘 다 스스로 스크롤하게 두면 위 표(사람 목록)가
   아래 역할표에 눌려 머리만 남고 줄이 사라진다. 그래서 탭 전체를 한 덩이로 굴린다. */
.op-pane[data-tab="people"] { overflow-y: auto; }
.op-pane[data-tab="people"] .dlv-list-wrap { flex: 0 0 auto; overflow: visible; }
/* ⭐ **역할이 늘면 표가 옆으로 자란다** — 칸을 좁혀 구겨 넣지 않고 **가로로 굴린다.**
   ⛔ `width: 100%` 로 두면 열이 늘 때마다 칸이 좁아져 **글자가 잘린다**(2026-08-07 사장님 지적).
   ⭐ **세로도 이 표만 굴린다** — 권한 줄이 열셋이라 탭째 굴리면 **역할 이름 머리가 위로
   사라져** 어느 열을 고치는지 모른 채 칸을 누르게 된다. 위 구성원 표는 제 높이 그대로다
   (둘 다 굴리면 위 표가 눌려 머리만 남는다 — 그 판정은 그대로 지킨다). */
.op-pane[data-tab="people"] .gt-wrap .dlv-list-wrap { max-height: 48vh; overflow: auto; }

/* 역할표 매트릭스 — 메뉴(행) × 역할(열) × 단계 넷 + 머리의 원가·이익 스위치 */
.gt-wrap { margin-top: 14px; }
.gt-title { display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px; font-size: 12.5px; font-weight: 800; color: var(--text); }
.gt-title small { font-weight: 400; font-size: 11.5px; color: var(--text-muted); }
.gt-table { width: auto; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.gt-table th, .gt-table td {
  padding: 0 8px; height: 32px; border-bottom: 1px solid var(--border);
  white-space: nowrap; text-align: center; font-size: 12px;
}
.gt-table thead th { background: var(--surface-2); color: var(--text-muted); font-weight: 700; }
/* ⭐ **머리와 첫 칸은 굴러가도 붙어 있는다** — 오른쪽 끝 역할을 볼 때 무슨 권한 줄인지,
   아래 줄을 볼 때 어느 역할 열인지 놓치면 표가 숫자밭이 된다. */
.gt-table thead th { position: sticky; top: 0; z-index: 2; }
.gt-table th.gt-res, .gt-table td.gt-res {
  text-align: left; font-weight: 700; color: var(--text);
  min-width: 148px; width: 148px; border-right: 1px solid var(--border);
  position: sticky; left: 0; z-index: 2; background: var(--surface-1);
}
.gt-table thead th.gt-res { z-index: 3; background: var(--surface-2); }
.gt-table tbody tr:hover td.gt-res { background: var(--surface-2); }
.gt-table td.gt-res small { display: block; font-weight: 400; font-size: 11px; color: var(--text-dim); }
.gt-table tbody tr:hover td { background: var(--surface-2); }
.gt-sel {
  width: 100%; max-width: 82px; padding: 2px 4px;
  border: 1px solid var(--border-strong); border-radius: 4px;
  background: var(--surface-1); color: var(--text); font: inherit; font-size: 11.5px;
  text-align: center; cursor: pointer;
}
.gt-sel:hover:not(:disabled) { border-color: var(--accent); }
.gt-sel:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); }
.gt-sel:disabled { opacity: .55; cursor: not-allowed; }
.gt-sel[data-v="0"] { color: var(--text-dim); }
.gt-sel[data-v="3"] { border-color: var(--accent); color: var(--accent); }
.gt-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.gt-foot .grow { flex: 1; }

/* 역할 열의 머리 — 이름 · (✎ 🗑) · 원가·이익 스위치 · 몇 명이 쓰나 */
.gt-table th.gt-role { padding: 6px 10px; min-width: 118px; vertical-align: top; }
.gt-role-top { display: flex; align-items: center; justify-content: center; gap: 3px; }
.gt-role-name { font-weight: 800; color: var(--text); font-size: 12px; }
.gt-lock { margin-left: 3px; font-size: 10px; }
.gt-mini {
  border: 0; background: none; padding: 0 2px; cursor: pointer;
  color: var(--text-dim); font-size: 11px; line-height: 1; opacity: 0;
}
.gt-table th.gt-role:hover .gt-mini { opacity: 1; }
.gt-mini:hover, .gt-mini:focus-visible { color: var(--accent); opacity: 1; }
.gt-wear { display: block; font-size: 10.5px; font-weight: 400; color: var(--text-dim); margin-top: 2px; }

/* 돈의 선 — 스위치 하나. 켜짐이 기본 색이고 꺼짐은 조용하다(경고가 아니라 설정이다). */
.gt-sw {
  display: block; width: 100%; margin: 4px 0 0; padding: 2px 6px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface-1); color: var(--text-dim);
  font: inherit; font-size: 10.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.gt-sw.on { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.gt-sw:hover:not(:disabled) { border-color: var(--accent); }
.gt-sw:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-ring); }
.gt-sw:disabled { opacity: .55; cursor: not-allowed; }

/* 스위치가 꺼져 저절로 잠긴 칸 — 고르는 칸이 아니라는 것을 모양이 먼저 말한다. */
.gt-auto { font-size: 11px; color: var(--text-dim); font-style: italic; }
.gt-table td.gt-res .gt-money {
  display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 3px;
  background: var(--surface-2); color: var(--text-dim);
  font-size: 9.5px; font-weight: 700; vertical-align: middle;
}

@media (max-width: 720px) {
  .set-form { grid-template-columns: 1fr; }
}

/* ---- 참여 신청 — 승인·거절 ----
   구성원 표 **위**에 선다: 들어온 신청을 먼저 처리하고 그다음 역할을 지정하는 순서다.
   ⛔ 아래로 내리지 마라 — 역할표가 길어 신청이 화면 밖으로 밀린다. */
.rq-wrap { margin-bottom: 14px; }
.gt-title .grow { flex: 1; }
.gt-title.mb-title { margin-top: 4px; }
.rq-toggle {
  border: 0; background: none; padding: 2px 4px; cursor: pointer;
  color: var(--accent); font: inherit; font-size: 11.5px; font-weight: 700;
}
.rq-toggle:hover { text-decoration: underline; }
.rq-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }

/* 줄은 얕게. 신청은 **훑고 처리하는 목록**이지 읽는 글이 아니다. */
.rq-table td { padding: 4px 10px; font-size: 12.5px; white-space: nowrap; }
.rq-table th { padding: 5px 10px; }
.rq-table .rq-dim { color: var(--text-dim); font-size: 12px; }
/* 사유만 길어질 수 있다 — 넘치면 …로 접고 마우스를 올리면 전문이 뜬다. */
.rq-table .rq-note {
  color: var(--text-muted); font-size: 12px;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}
/* 처리된 줄은 흐려진다 — 남겨 두되 지금 할 일과 눈으로 갈린다. */
.rq-table tr.is-done td { opacity: .6; }
.rq-table .rq-empty { color: var(--text-dim); text-align: center; padding: 12px 0; font-size: 12.5px; }

/* ⛔ **액션 칸에 폭을 고정하지 마라** — 공용 `.act` 는 64px 라 단추 둘이 세로로 접히고
   글자까지 줄바꿈됐다(2026-08-07 사장님 지적). 단추 수는 표마다 다르다. */
.rq-table th.act, .rq-table td.num { width: auto; white-space: nowrap; }
.rq-btn {
  padding: 2px 10px; margin-left: 5px; border-radius: 5px;
  border: 1px solid var(--border-strong); background: var(--surface-1);
  color: var(--text); font: inherit; font-size: 11.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.rq-btn:hover { border-color: var(--text-muted); }
.rq-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-ring); }
/* 승인이 오른쪽 끝에 서고 강조를 받는다 — 흔한 손이 먼 쪽에 있어야 실수가 준다(화면 규칙 §7). */
.rq-btn.is-ok { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.rq-btn.is-ok:hover { background: var(--accent); color: var(--on-accent); }

/* 신청이 쌓여도 이 표가 탭을 다 먹지 않는다 — 아래 구성원·접근 권한이 늘 보여야 한다. */
.op-pane[data-tab="people"] .rq-wrap .dlv-list-wrap { max-height: 30vh; overflow: auto; }

/* 제목 옆 물음표 — 긴 안내 문단을 접어 둔 자리(2026-08-07). 제목과 부제 사이에 선다. */
.gt-title .help { margin: 0 2px 0 0; }
.gt-title { flex-wrap: wrap; }
