/* =====================================================
   RPC NCP-tone skin overlay — 2026-08-08
   원리: v050.css 뒤에 로드되는 오버라이드 레이어.
   색·보더·타이포·간격만 다룸 (레이아웃·기능 무변).
   문제 시 index.html에서 이 링크 한 줄 제거 = 즉시 원복.
   포인트 컬러 = 레노버 레드 유지 (본부장 확정).
   ===================================================== */
:root {
  --ncp-bg: #f5f6f8;
  --ncp-card: #ffffff;
  --ncp-border: #e5e7eb;
  --ncp-border-soft: #f0f1f3;
  --ncp-text: #111111;
  --ncp-text-sub: #666b73;
  --ncp-hover: #fafbfc;
  --ncp-radius: 8px;
}
body { background: var(--ncp-bg); color: var(--ncp-text); }

/* ---------- 카드 ---------- */
.card {
  background: var(--ncp-card);
  border: 1px solid var(--ncp-border);
  border-radius: var(--ncp-radius);
  box-shadow: none;
}
.card:hover { box-shadow: none; }
.card-title, .card h3 { font-size: 15px; font-weight: 700; color: var(--ncp-text); }
.card-subtitle { font-size: 12px; color: var(--ncp-text-sub); }
.section-title { font-size: 15px; font-weight: 700; color: var(--ncp-text); }

/* ---------- 테이블 통일 (전 업무 화면 공통) ---------- */
table { border-collapse: collapse; }
.table th, .card table th, #view table th, table.list th, thead th {
  background: var(--ncp-card) !important;
  color: var(--ncp-text) !important;
  font-size: 13px !important;   /* v050 fs-caption(작음)·1602 !important 격파 — 헤더 = 본문 동급+굵기 위계 */
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 2px solid var(--ncp-border);
  border-top: none;
  text-align: left;
  white-space: nowrap;
}
.table td, .card table td, #view table td, table.list td, tbody td {
  font-size: 13px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--ncp-border-soft);
  color: var(--ncp-text);
  vertical-align: middle;
}
/* 숫자 컬럼(.num) = 헤더·본문 모두 우측 정렬 (v050 원규칙 복원 — skin의 좌측 광범위 규칙이 th.num을 덮던 병인 수리, 2026-08-08 본부장) */
.table th.num, thead th.num, .card table th.num, #view table th.num,
.table td.num, tbody td.num {
  text-align: right;
}
tbody tr:hover > td { background: var(--ncp-hover); }
tbody tr:last-child > td { border-bottom: 1px solid var(--ncp-border); }

/* ---------- 버튼 ---------- */
.btn {
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}
/* [btn-primary-text 2026-08-14 본부장] 검정 버튼 글씨는 어떤 경우에도 흰색 —
   수수료 정책 '엑셀 업로드' label 형 버튼이 파랗게 보이던 문제의 최종 방어선 */
.btn-primary, label.btn-primary, .btn-primary * { color: #fff !important; }
.btn-outline, .btn-secondary, .btn-ghost {
  background: var(--ncp-card);
  border: 1px solid #d1d5db;
  color: #374151;
}
.btn-outline:hover, .btn-secondary:hover, .btn-ghost:hover {
  background: var(--ncp-hover);
  border-color: #b8bec7;
}
/* 프라이머리 = 레노버 레드 유지 (v050 그대로) */

/* ---------- 배지·상태 ---------- */
.badge { border-radius: 4px; font-size: 11px; font-weight: 600; padding: 2px 7px; }
.hint { color: var(--ncp-text-sub); }

/* ---------- 입력·셀렉트 ---------- */
input[type="text"], input[type="date"], input[type="number"], input[type="email"],
input[type="password"], select, textarea {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
}
input:focus, select:focus, textarea:focus {
  border-color: #8a919b;
  outline: none;
  box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.06);
}

/* ---------- 모달 ---------- */
.modal, .modal-box, .modal-content {
  border-radius: 10px;
  border: 1px solid var(--ncp-border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* ---------- 페이지네이션·탭 ---------- */
.pagination button, .pager button {
  border: 1px solid var(--ncp-border);
  border-radius: 4px;
  background: var(--ncp-card);
}
.tabs .tab, .tab-btn { font-size: 13px; }

/* ---------- 스크롤바 (미세 마감) ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d3d7dd; border-radius: 6px; border: 2px solid var(--ncp-bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 본문 폭 확장 (2026-08-08 본부장: 테이블 넘침 — 1320 → 1720) ---------- */
.app-content { max-width: 1720px; }

/* ---------- 해상도 최적화 (2026-08-08 본부장: 1920x1080/1200·2944x1840 tab·2560x1080)
   viewport = device-width 전환 + 최소폭 1280 보장(기존 레이아웃 안전판)
   + 본문 상한 2200 (초광폭 가독) ---------- */
body { min-width: 1280px; }
.app-content { max-width: 2200px; }

/* ---------- 대시보드 (2단계 리빌드 2026-08-08) ---------- */
.dash-todo-card { padding: 0; overflow: hidden; }
.dash-todo-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 18px 10px; border-bottom: 1px solid var(--ncp-border);
}
.dash-todo-head .t { font-size: 15px; font-weight: 700; color: var(--ncp-text); }
.dash-todo-head .s { font-size: 12px; color: var(--ncp-text-sub); }
.dash-todo-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 18px; border-bottom: 1px solid var(--ncp-border-soft);
  cursor: pointer; font-size: 13px; color: var(--ncp-text);
}
.dash-todo-row:last-child { border-bottom: none; }
.dash-todo-row:hover { background: var(--ncp-hover); }
.dash-todo-row .cnt { font-size: 16px; font-weight: 700; color: var(--color-lenovo-red, #E2231A); }
.dash-todo-row .cnt small { font-size: 12px; font-weight: 400; color: var(--ncp-text-sub); }
.status-banner.info {
  background: #eef4ff; border: 1px solid #d7e4fb; color: #1b4faa;
  border-radius: var(--ncp-radius);
}

/* 할 일 그룹 그리드 (2026-08-08 본부장: 업무별 3~4분할 — 라벨·건수 근접) */
.dash-todo-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  /* stretch(기본) = 4카드 높이 = 행 내 최대에 통일 — 빈 그룹도 카드 렌더로 4칸 균등 */
}
@media (max-width: 1400px) { .dash-todo-grid { grid-template-columns: repeat(2, 1fr); } }

/* KPI 밴드 (2026-08-08 본부장: 올해 수주현황 디자인 전면 교체 — NCP 지표 문법) */
.dash-kpi-card { padding: 0; overflow: hidden; margin-bottom: 14px; }
.dash-kpi-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 18px 10px; border-bottom: 1px solid var(--ncp-border);
}
.dash-kpi-head .t { font-size: 15px; font-weight: 700; color: var(--ncp-text); }
.dash-kpi-head .s { font-size: 12px; color: var(--ncp-text-sub); }
.dash-kpi-band { display: flex; }
.dash-kpi-item {
  flex: 1; padding: 16px 18px 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.dash-kpi-item + .dash-kpi-item { border-left: 1px solid var(--ncp-border-soft); }
.dash-kpi-item .lb { font-size: 12px; color: var(--ncp-text-sub); }
.dash-kpi-item .v { font-size: 24px; font-weight: 700; color: var(--ncp-text); letter-spacing: -0.3px; }
.dash-kpi-item .v small { font-size: 13px; font-weight: 400; color: var(--ncp-text-sub); }
.dash-kpi-item .v.red { color: var(--color-lenovo-red, #E2231A); }
.dash-kpi-item .sub { font-size: 12px; color: var(--ncp-text-sub); }

/* KPI 기간 탭+품목 소계 (2026-08-08) */
.dash-kpi-head .tabs { display: flex; align-items: center; gap: 6px; }
.dash-kpi-tab {
  font-size: 12px; padding: 3px 10px; border: 1px solid #d1d5db;
  border-radius: 4px; background: var(--ncp-card); color: #374151; cursor: pointer;
}
.dash-kpi-tab.on { background: #111; color: #fff; border-color: #111; }
.dash-kpi-head .tabs .s { margin-left: 6px; }
.dash-kpi-cats {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  padding: 10px 18px 13px; border-top: 1px solid var(--ncp-border-soft);
  font-size: 12.5px; color: var(--ncp-text);
}
.dash-kpi-cats .ci b { font-weight: 700; margin-right: 4px; }
.dash-kpi-cats .ci small { color: var(--ncp-text-sub); }
.dash-kpi-cats .ci em { font-style: normal; color: var(--ncp-text-sub); margin-left: 5px; }

/* 3단계: 화면별 지표 밴드 확장 (2026-08-08 — 생산·미수금·파트너) */
.dash-kpi-item.clickable { cursor: pointer; }
.dash-kpi-item.clickable:hover { background: var(--ncp-hover); }
.dash-kpi-item.on { background: #fdf1f0; }
.dash-kpi-item.on .lb { color: var(--color-lenovo-red, #E2231A); font-weight: 700; }
.dash-kpi-item .v.dim { color: var(--ncp-text-sub); }

/* 툴팁 (2026-08-09 본부장: 괄호 설명 → 마우스오버) */
.tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid #c3c8cf; color: #8a919b; background: #fff;
  font-size: 10px; font-weight: 700; cursor: help;
  vertical-align: middle; margin-left: 4px; position: relative;
}
.tip:hover { border-color: #8a919b; color: #4b5563; }
.tip::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
  background: #111; color: #fff; font-size: 12px; font-weight: 400;
  padding: 7px 11px; border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s;
  z-index: 300; max-width: 340px; white-space: normal; width: max-content;
  line-height: 1.5; text-align: left;
}
.tip::before {
  content: ''; position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #111;
  opacity: 0; transition: opacity .12s; z-index: 300;
}
.tip:hover::after, .tip:hover::before { opacity: 1; }

/* 역할별 할 일: 비admin = 그룹 수 맞춤 (2026-08-09) */
.dash-todo-grid.fit { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* 사이드바 NCP 전환 (2026-08-09 본부장): 활성 = border-left 잔재 제거 → 배경+굵기 */
.sidebar-item { border-left: none !important; }
.sidebar-item.is-active {
  background: #f0f1f3 !important;
  font-weight: 700;
  color: var(--ncp-text) !important;   /* 2026-08-09 본부장: 레드 텍스트 = 눈 아픔 → 검정 */
}
/* 뱃지 = 검정 배경 통일 (레드+흰 숫자 가독 낮음 — 본부장) */
.nav-badge {
  background: #111 !important;
  color: #fff !important;
  font-weight: 700;
}
.sidebar-item:hover { background: var(--ncp-hover); }
.app-sidebar { background: #fff; border-right: 1px solid var(--ncp-border); }

/* 목록 테이블 카드 래핑 (2026-08-09 본부장 승인 — 전역) */
.table-wrap, .table-wrapper {
  background: var(--ncp-card);
  border: 1px solid var(--ncp-border);
  border-radius: var(--ncp-radius);
  padding: 4px 14px 8px;
}
.card .table-wrap, .card .table-wrapper,
.dash-kpi-card .table-wrap, .dash-kpi-card .table-wrapper,
details.status-banner { display: block; }  /* flex 배너를 details로 쓰면 summary/내용이 좌우 분할되는 병인 해소 (2026-08-10) */
.status-banner .table-wrap, .status-banner .table-wrapper {
  background: transparent; border: none; border-radius: 0; padding: 0;
}

/* 필터 칩 활성 = 검정 통일 (2026-08-10 본부장 — v050 1822/1972 레드 !important 격파) */
.chip.is-active {
  background: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
}
.chip.is-active .chip__count { background: rgba(255,255,255,.22) !important; color: #fff !important; }

/* [tip-fix 2026-08-14] 툴팁은 JS 고정 배치(app.js)로 전환 — CSS 절대배치의
   잘림(모달·표·가장자리) 전면 해소. 말풍선 pseudo 는 전부 끈다(아이콘은 유지). */
.tip::after, .tip::before,
th .tip::after, th .tip::before,
.tip.tip-l::after, .tip.tip-l::before { display: none !important; }

/* 테이블 헤더 내 툴팁 = 아래로·우측 기준 (래퍼 overflow 클리핑 회피 — 가용재고 잘림 병인) */
th .tip::after {
  bottom: auto; top: calc(100% + 7px);
  left: auto; right: -6px; transform: none;
}
th .tip::before {
  bottom: auto; top: calc(100% + 2px);
  border-top-color: transparent; border-bottom-color: #111;
}

/* 헤더 유저 드롭다운 (2026-08-10 본부장 — NCP 문법) */
.hdr-user-wrap { position: relative; margin-right: 10px; }
.hdr-user {
  background: none; border: none; color: var(--color-gray-200, #d1d5db);
  font-size: 13px; cursor: pointer; padding: 6px 4px; font-family: inherit;
}
.hdr-user:hover { color: #fff; }
.hdr-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 200px;
  background: #fff; border: 1px solid var(--ncp-border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 6px 0; z-index: 400;
}
.hdr-menu.hidden { display: none; }
.hm-head {
  padding: 10px 16px 9px; border-bottom: 1px solid var(--ncp-border-soft);
  margin-bottom: 5px; display: flex; flex-direction: column; gap: 2px;
}
.hm-head b { font-size: 14px; color: var(--ncp-text); }
.hm-head span { font-size: 12px; color: var(--ncp-text-sub); }
.hm-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 9px 16px; font-size: 13.5px; color: var(--ncp-text);
  cursor: pointer; font-family: inherit;
}
.hm-item:hover { background: var(--ncp-hover); }
.hm-div { height: 1px; background: var(--ncp-border-soft); margin: 5px 0; }
.hdr-bell { display: inline-flex; align-items: center; }
.hdr-bell:hover { color: var(--color-gray-200, #d1d5db); }

/* 벨 드롭다운 (2026-08-10 본부장 — 요약+전체 보기) */
.hdr-bell-wrap { position: relative; margin-right: 12px; }
.hdr-bell-wrap .hdr-bell { margin-right: 0; }
.hdr-bell-menu { min-width: 320px; max-width: 360px; }
.bm-row { padding: 9px 16px; cursor: pointer; border-bottom: 1px solid var(--ncp-border-soft); }
.bm-row:last-child { border-bottom: none; }
.bm-row:hover { background: var(--ncp-hover); }
.bm-row.unread .bm-title { font-weight: 700; }
.bm-row.unread { background: #fafafa; }
.bm-title { font-size: 13px; color: var(--ncp-text); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-body { font-size: 12px; color: var(--ncp-text-sub); line-height: 1.4; margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-time { font-size: 11.5px; color: var(--ncp-text-sub); margin-top: 2px; }

/* 완료·취소 행 회색조 복원 (2026-08-10 본부장 — 스킨 통일 색이 row-dim을 덮은 병인) */
tr.row-dim td,
tr.row-dim td b,
tr.row-dim td a { color: #a3a8b0 !important; }
tr.row-dim td { background: #fafafa !important; }
tr.row-dim .badge { opacity: .65; }

/* 안내 박스 — 화면 상단 통합 설명 (2026-08-10 본부장: 위아래 분산 설명 정리) */
.info-box {
  background: #f8f9fa; border: 1px solid var(--ncp-border);
  border-radius: 6px; padding: 12px 16px; margin-bottom: 14px;
}
.info-box p { margin: 0; font-size: 12.5px; color: var(--ncp-text-sub); line-height: 1.65; }
.info-box p + p { margin-top: 4px; }

/* 수주 등록 압축 — 1컬럼 유지·요소 축소로 1920 한 화면 (2026-08-10 본부장: 2컬럼 기각) */
.pc-compact .form-group input:not([type=checkbox]):not([type=radio]):not([type=file]),
.pc-compact .form-group select { height: 32px; font-size: 13px; }
.pc-compact .form-group .btn { height: 32px; min-height: 32px; font-size: 13px; }
.pc-compact .form-group { margin-bottom: 8px; }
.pc-compact .form-group label { margin-bottom: 2px; }
.pc-compact .section-title { margin: 12px 0 6px; }
.pc-compact .info-box { padding: 8px 12px; margin-bottom: 10px; }
.pc-compact .table td, .pc-compact .table th { padding-top: 5px; padding-bottom: 5px; }
