/* ============================================================
   ws-ui.css — 운영 ERP 디자인 오버레이 (APPROVED_DESIGN.html 시안 기준)
   로드 순서: index-*.css → ws-theme.css → ws-ui.css(본 파일)
   - 번들(index-*.css / index-*.js)은 불변. 본 파일은 스타일 오버라이드만 담당.
   - --ws-accent / --ws-soft / --ws-canvas 는 ws-theme.css 가 직원별로 설정.
     미설정(비로그인) 시를 위한 폴백: 오션 블루 계열.
     (html 단일 선택자라 ws-theme.css 의 html[data-workspace-theme] 규칙이 항상 우선)
   ============================================================ */

/* ── 기본: 폰트 스택 / 본문색 ─────────────────────── */
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: #182230;
}
html { --ws-accent: #1d4ed8; --ws-soft: #eff6ff; }

/* ── 사이드바 · #16243a · 232px ─────────────────────── */
.sidebar { width: 232px; flex-basis: 232px; background: #16243a; }
.sidebar-logo { display: none; } /* ws-ui.js 가 주입하는 .ws-brand 로 시각 대체(노드 자체는 유지·클릭 대행) */

.ws-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  cursor: pointer;
}
.ws-brand-mark {
  flex: none; width: 36px; height: 36px; border-radius: 11px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; letter-spacing: -.4px;
}
.ws-brand-name { font-size: 15px; font-weight: 700; letter-spacing: -.4px; color: #fff; white-space: nowrap; }
.ws-brand-name .ws-sys { color: color-mix(in srgb, var(--ws-accent, #1d4ed8) 55%, #fff); }
.ws-brand-caption { font-size: 9px; color: rgba(255, 255, 255, .45); letter-spacing: .09em; margin-top: 2px; }

.ws-nav-label {
  padding: 14px 12px 6px;
  color: rgba(255, 255, 255, .42);
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
}

.sidebar-menu { padding: 10px 12px; }
.sidebar-item {
  position: relative;
  border-radius: 8px;
  margin: 1px 0;
  padding: 10px 12px;
  font-size: 13px; font-weight: 500;
  color: rgba(255, 255, 255, .66);
  transition: background .15s, color .15s;
}
.sidebar-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar-item.active {
  border-right: 0;
  color: var(--ws-accent, #1d4ed8);
  background: var(--ws-soft, #eff6ff);
  font-weight: 600;
}
.sidebar-item.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 3px; border-radius: 2px;
  background: var(--ws-accent, #1d4ed8);
}
/* ws-theme.css 의 html[data-workspace-theme] .sidebar-item.active::before(top:0/bottom:0) 조정 */
html[data-workspace-theme] .sidebar-item.active::before { top: 9px; bottom: 9px; border-radius: 2px; }

.sidebar-footer { border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12px; color: rgba(255, 255, 255, .62); }
.sidebar-footer .btn { border-radius: 8px; }

/* ── 상단바(ws-ui.js 주입 노드) · 56px ─────────────── */
.ws-topbar {
  position: sticky; top: 0; z-index: 30;
  height: 56px; margin: -24px -32px 18px; padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid #e7ebf0;
  display: flex; align-items: center; justify-content: space-between;
}
.ws-crumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #8a94a3;
  min-width: 0; overflow: hidden; white-space: nowrap;
}
.ws-crumb-sep { color: #c3cad4; }
.ws-crumb-page { color: #182230; font-weight: 600; }
.ws-user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 11px 4px 5px;
  border: 1px solid #e7ebf0; border-radius: 10px;
  background: #f8fafc;
  font-size: 12px; font-weight: 600; color: #182230;
  white-space: nowrap;
}
.ws-chip-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800;
  background: var(--ws-soft, #eff6ff);
  color: var(--ws-accent, #1d4ed8);
}

/* ── 카드 · radius 12 / 그림자 · 패딩 20 ───────────── */
.card {
  border: 1px solid #e7ebf0;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(20, 34, 58, .06);
  padding: 20px;
}
.stat-card {
  border: 1px solid #e7ebf0;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(20, 34, 58, .06);
}
.stat-card .label { color: #697586; }
.stat-card .value { color: #182230; letter-spacing: -.5px; }

/* ── 표 · 헤더 #f7f9fc / 행 hover #f8fafc / 셀 12×14 / 라인 #eef1f5 ── */
.data-table { border: 1px solid #e7ebf0; border-radius: 12px; box-shadow: 0 8px 22px rgba(20, 34, 58, .06); }
.data-table th {
  background: #f7f9fc; color: #697586;
  font-size: 11px; font-weight: 600; letter-spacing: .03em;
  padding: 12px 14px;
  border-bottom: 1px solid #eef1f5;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid #eef1f5; }
.data-table tr:hover { background: #f8fafc; }

/* ── 버튼 · radius 8 / primary = 직원 테마 강조색 ───── */
.btn { border-radius: 8px; }
.btn-primary { background: var(--ws-accent, #1d4ed8); }
.btn-outline { border-color: #d9dfe7; color: #3d4c5f; }

/* ── 페이지 헤더 / 탭 / 페이징 / 폼 / 모달 ─────────── */
.page-title { color: #182230; font-size: 24px; letter-spacing: -.6px; }
.tabs { border-bottom: 1px solid #e7ebf0; }
.tab { color: #8a94a3; }
.tab.active { color: var(--ws-accent, #1d4ed8); border-bottom-color: var(--ws-accent, #1d4ed8); }
.pagination button { border-radius: 8px; border-color: #d9dfe7; color: #3d4c5f; }
.pagination button.active { background: var(--ws-accent, #1d4ed8); border-color: var(--ws-accent, #1d4ed8); }
.form-group label { color: #182230; }
.form-group input, .form-group select, .form-group textarea { border-color: #d9dfe7; border-radius: 8px; color: #182230; }
.form-group input::placeholder, .form-group textarea::placeholder { color: #98a2b3; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: 0; border-color: var(--ws-accent, #1d4ed8); }
.modal { border-radius: 12px; box-shadow: 0 8px 22px rgba(20, 34, 58, .06); }
.modal-title { color: #182230; }

/* ── 포커스 접근성 ─────────────────────────────── */
.btn:focus-visible, .sidebar-item:focus-visible { outline: 2px solid var(--ws-accent, #1d4ed8); outline-offset: 2px; }
