/* ============================================================
   SG SQUARE UI v2 — Toss-inspired restyle (2026-08-19)
   v1 = style.css. 플래그: 쿠키 fm_ui=v2 (?ui=v2 / ?ui=v1). middleware/uiVersion.js
   설계: docs/superpowers/specs/2026-08-19-ui-v2-toss-restyle-design.md
   규칙: 뷰 인라인 <style>은 .ui-v2 접두 셀렉터로 덮어쓴다 / 스케치 그림자·oklch 금지 /
         v1의 모든 셀렉터 유지(tests/styleV2Parity.test.js)
   ============================================================ */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  /* surfaces */
  --bg: #F2F4F6;
  --surface: #FFFFFF;
  --surface-2: #F9FAFB;
  --surface-3: #F2F4F6;
  --paper: var(--surface);
  --paper-2: var(--surface-2);   /* v1 별칭 — v1은 페이지·카드 둘 다 --paper. 카드=흰색, 페이지 배경만 --bg로 명시 */
  /* ink */
  --ink: #191F28;
  --ink-soft: #4E5968;
  --ink-muted: #8B95A1;
  --ink-faint: #B0B8C1;
  /* lines */
  --line: #E5E8EB;
  --line-soft: #F2F4F6;
  --line-strong: #D1D6DB;
  --navy: #191F28;
  /* accent (Toss blue) */
  --accent: #3182F6;
  --accent-hover: #1B64DA;
  --accent-soft: #E8F3FF;
  --accent-ink: #1B64DA;
  /* semantic */
  --ok: #0BAA5A;
  --ok-soft: #E9F8F0;
  --ok-ink: #0B7A44;
  --warn: #FF9500;
  --warn-soft: #FFF4E5;
  --warn-ink: #B45309;
  --danger: #F04452;
  --danger-soft: #FFEEEE;
  --danger-ink: #D6323F;
  --violet-soft: #F1EAFE;
  --violet-ink: #6B3FD6;
  --pink-soft: #FFEDF3;
  --pink-ink: #C2255C;
  /* type */
  --font-body: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue',
               'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  --font-hand: var(--font-body);
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 28px;
  /* shape */
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.04);
  --shadow-2: 0 4px 12px rgba(0,0,0,.06);
  --shadow-pop: 0 12px 32px rgba(0,0,0,.12);
  /* spacing (v1 유지) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  /* density — 시안 옵션 위젯이 바꾸는 값 */
  --row-h: 44px;
  --cell-py: 12px;
  --cell-px: 14px;
  --list-py: 12px;
}
/* 시안 옵션 (public/js/ui-v2-preview.js 가 <html data-ui-*>로 켠다) */
:root[data-ui-font="system"] { --font-body: -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif; }
:root[data-ui-density="compact"] { --row-h: 36px; --cell-py: 7px; --cell-px: 12px; --list-py: 8px; }
:root[data-ui-radius="small"] { --radius-lg: 10px; --radius: 8px; --radius-sm: 6px; }

/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--fs-base);
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { font-family: var(--font-hand); color: var(--ink); font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); font-weight: 600; }
h4, h5 { font-size: var(--fs-md); font-weight: 600; }
.wf-hand { font-family: var(--font-hand); }
button, input, select, textarea { font-family: inherit; }

/* ===== Login Page ===== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-box { background: var(--surface); border: none; padding: 40px 32px; box-shadow: var(--shadow-2); border-radius: 20px; text-align: center; }
.login-box h1 { font-size: 24px; color: var(--ink); margin-bottom: 4px; font-family: var(--font-hand); }
.login-subtitle { color: var(--ink-muted); margin-bottom: 24px; font-size: 14px; }

/* ===== Alerts ===== */
.alert { padding: 12px 16px; border: none; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; background: var(--surface-3); color: var(--ink-soft); }
.alert-error { background: var(--danger-soft); border-color: transparent; color: var(--danger-ink); }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 14px; background: var(--surface);
  font-family: var(--font-body); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.form-group textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-group input[type="checkbox"], .form-group input[type="radio"] { height: auto; width: auto; accent-color: var(--accent); }
.form-group input[type="file"] { padding: 8px 12px; height: auto; }
.form-group small { display: block; margin-top: 4px; color: var(--ink-muted); font-size: 12px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-container {
  background: var(--surface); padding: 24px;
  border: none; box-shadow: var(--shadow-1); border-radius: var(--radius-lg);
}
.form-actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; }
.checkbox-label { display: flex !important; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.checkbox-label input[type="checkbox"] { width: auto; height: auto; accent-color: var(--accent); }
.radio-row { display: flex; gap: 18px; align-items: center; padding: 4px 0; }
.form-group label.radio-item { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 400; font-size: 14px; color: var(--ink); margin: 0; }
.form-group .radio-item input[type="radio"] { width: auto; margin: 0; accent-color: var(--accent); }
/* 결재 작성 폼 인라인 <style>(.radio-inline*) 덮어쓰기 — 라디오 칩 */
.ui-v2 .radio-inline-group { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; border: none; border-radius: 0; background: transparent; min-height: 0; }
.ui-v2 .radio-inline { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); font-size: 14px; cursor: pointer; }
.ui-v2 .radio-inline:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.ui-v2 .radio-inline input[type="radio"] { width: auto; height: auto; margin: 0; accent-color: var(--accent); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 16px; border: 1px solid var(--line); background: var(--surface);
  color: #333D4B; font-size: 14px; font-family: var(--font-body);
  font-weight: 600; border-radius: var(--radius); cursor: pointer; white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; background: var(--surface-2); box-shadow: none; }
.btn:active { background: var(--surface-3); box-shadow: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:hover { box-shadow: none; background: var(--surface); }
.btn-primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary { background: var(--surface-3); color: var(--ink-soft); border-color: transparent; }
.btn-secondary:hover { background: #E5E8EB; }
.btn-danger { background: var(--danger-soft); color: var(--danger-ink); border-color: transparent; }
.btn-danger:hover { background: #FFDBDB; color: var(--danger-ink); }
.btn-warning { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }
.btn-warning:hover { background: #FFE8C7; color: var(--warn-ink); }
.btn-accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.btn-accent:hover { background: #D5E8FF; opacity: 1; color: var(--accent-ink); }
.btn-excel { background: var(--ok-soft); color: var(--ok-ink); border-color: transparent; }
.btn-excel:hover { background: #D3F1E0; color: var(--ok-ink); }
.btn-full { width: 100%; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { height: 48px; padding: 0 20px; font-size: 16px; font-weight: 600; }

/* ===== Layout (top tab bar) ===== */
.app-container { min-height: 100vh; display: flex; flex-direction: column; }
.main-content { flex: 1; padding: 24px 28px 40px; background: var(--bg); }
/* 마우스 기기(PC): 창 폭과 무관하게 레이아웃 고정 — 축소 대신 가로 스크롤. (v1과 동일) */
@media (hover: hover) and (pointer: fine) {
  .app-container { min-width: 1200px; }
}

/* ===== Top Tab Bar ===== */
.topbar-wrap { flex-shrink: 0; position: sticky; top: 0; z-index: 100; background: var(--surface); border-bottom: 1px solid var(--line); }

/* 상단 메타 라인 */
.topbar-meta {
  display: flex; align-items: center; gap: 12px;
  height: 48px; padding: 0 24px; background: var(--surface);
  border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--ink-soft);
}
.topbar-meta .brand-hand { font-family: var(--font-hand); font-weight: 700; font-size: 16px; color: var(--ink); letter-spacing: -0.02em; }
.topbar-meta a { color: var(--ink); }
.topbar-meta a:hover { text-decoration: none; color: var(--accent-ink); }
.topbar-meta .meta-date { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.topbar-meta .meta-spacer { flex: 1; }
.topbar-meta .meta-user { color: var(--ink); font-weight: 600; }
.topbar-meta .meta-dept { color: var(--ink-muted); }
.topbar-meta .btn.btn-sm { height: 32px; }
.topbar-meta #dashAttIn, .topbar-meta #dashAttOut { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
/* 퇴근 버튼(PC #dashBtnOut·모바일 #mDashBtnOut, header.ejs 무수정이라 id 지정): 출근(연파랑 btn-accent)과 짝인 연빨강. id 특이도가 .btn:disabled:hover(surface 복귀)보다 높아 disabled 상태도 연빨강+opacity .45 유지 */
.ui-v2 #dashBtnOut, .ui-v2 #mDashBtnOut { background: var(--danger-soft); color: var(--danger-ink); border-color: transparent; }
.ui-v2 #dashBtnOut:hover:not(:disabled), .ui-v2 #mDashBtnOut:hover:not(:disabled) { background: #FFDBDB; color: var(--danger-ink); }

/* 메인 탭바 */
.tabbar {
  display: flex; align-items: center;
  background: var(--surface);
  border-bottom: none;
  padding: 0 16px; gap: 4px; height: 48px;
}
.tabbar .brand {
  font-family: var(--font-hand); font-weight: 700;
  font-size: 16px; padding: 0 14px 0 4px; margin-right: 6px;
  border-right: none; color: var(--ink);
  letter-spacing: -0.02em;
}
.tabbar .brand a { color: inherit; text-decoration: none; }
.tab {
  position: relative;
  height: 48px; line-height: 48px; padding: 0 14px; font-size: 15px; cursor: pointer;
  border: none; border-radius: 0;
  color: #6B7684; background: transparent;
  font-weight: 600;
  white-space: nowrap; user-select: none;
  transition: color .15s;
}
.tab:hover:not(.active) { background: transparent; color: var(--ink); }
.tab.active { background: transparent; border-color: transparent; color: var(--ink); font-weight: 700; }
.tab.active::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tabbar-spacer { flex: 1; }
.tabbar-extra {
  display: flex; align-items: center; gap: 8px;
  padding-right: 4px; font-size: 13px; color: var(--ink-muted);
}

/* ===== Mega-menu dropdown ===== */
.tab-container { position: relative; }
.mega-menu {
  display: none;
  position: absolute; top: calc(100% + 4px); left: 0; right: auto;
  min-width: 560px; max-width: 760px; padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  z-index: 200;
}
.tab-container:hover .mega-menu,
.tab-container.open .mega-menu { display: block; }
.mega-menu-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px;
}
.mega-group-title {
  font-size: 12px; font-weight: 600; color: var(--ink-muted);
  margin-bottom: 6px; text-transform: none; letter-spacing: 0;
}
.mega-item {
  display: block; padding: 7px 10px; margin: 0 -10px; font-size: 14px; border-radius: var(--radius-sm);
  color: var(--ink-soft); text-decoration: none;
  transition: background-color .15s, color .15s;
}
.mega-item::before { content: none; }
.mega-item:hover { color: var(--ink); background: var(--surface-3); text-decoration: none; }
.mega-item.active { color: var(--accent-ink); background: var(--accent-soft); font-weight: 600; }

/* ===== Page Header ===== */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.page-header h1 { font-size: var(--fs-2xl); font-family: var(--font-hand); color: var(--ink); }
.page-desc { font-size: 14px; color: var(--ink-muted); }

/* ===== KPI / Summary Cards ===== */
.summary-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.card {
  --card-accent: var(--ink-faint);
  background: var(--surface); padding: 20px 24px;
  border: none; box-shadow: var(--shadow-1);
  border-left: none;
  border-radius: var(--radius-lg); position: relative;
}
.card-total { --card-accent: var(--ink-faint); border-left-color: transparent; }
.card-contracting { --card-accent: var(--warn); border-left-color: transparent; }
.card-working { --card-accent: var(--accent); border-left-color: transparent; }
.card-done { --card-accent: var(--ok); border-left-color: transparent; }
.card-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-muted); margin-bottom: 8px; letter-spacing: 0; }
.card-label::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--card-accent); flex-shrink: 0; }
.card-value { font-family: var(--font-hand); font-size: var(--fs-3xl); font-weight: 700; color: var(--ink); line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ===== Tables ===== */
.table-container {
  background: var(--surface); padding: 16px 20px;
  border: none; box-shadow: var(--shadow-1);
  border-radius: var(--radius-lg); margin-bottom: 16px;
}
/* 표를 직접 품은 컨테이너(및 통합일지 그룹·은행 섹션)만 패딩 0 + 모서리 클리핑. 범용 컨테이너(노무대장 '출역 추가' 카드 등)에는
   overflow hidden 금지 — 안의 absolute 드롭다운(#workerDropdown)이 잘린다. */
.table-container:has(> table), .table-container.log-group, .table-container.bank-section { padding: 0; overflow: hidden; }
.table-container h2 { font-size: 16px; margin: 0 0 8px; padding: 0; color: var(--ink); font-family: var(--font-hand); }
.table-container:has(> table) > h2 { margin: 0; padding: 16px 20px 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  background: var(--surface-2); padding: var(--cell-py) var(--cell-px); text-align: left;
  font-size: 13px; color: var(--ink-muted); font-weight: 600;
  border-top: none;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td {
  padding: var(--cell-py) var(--cell-px); border-bottom: 1px solid var(--line-soft);
  font-size: 14px; color: var(--ink); vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
tfoot td {
  padding: var(--cell-py) var(--cell-px); background: var(--surface-2);
  border-top: 1px solid var(--line); font-weight: 700;
  font-size: 14px;
}
.text-right { text-align: right; min-width: 90px; font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.text-center { text-align: center; }
.empty-row { text-align: center; color: var(--ink-muted); padding: 32px !important; }

/* 엑셀형 필터바 → 카드 상단 툴바 */
.filter-bar-excel {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; background: var(--surface);
  border: none; border-bottom: 1px solid var(--line-soft); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-size: 13px;
}
.filter-bar-excel label { font-weight: 600; color: var(--ink-soft); }
.filter-bar-excel input, .filter-bar-excel select {
  height: 36px; padding: 0 10px; border: 1px solid var(--line);
  font-size: 13px; border-radius: var(--radius-sm); background: var(--surface);
  font-family: var(--font-body);
}
.filter-bar-excel .spacer { flex: 1; }

/* ===== Status / Type / Rate Badges (pill) ===== */
.chip, .status-badge, .type-badge, .rate-badge, .toggle, .doc-type-badge, .perm-badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border: none;
  font-size: 12px; font-weight: 600; line-height: 1; border-radius: var(--radius-pill);
  background: var(--surface-3); color: var(--ink-soft);
  white-space: nowrap;
}
.chip-accent, .status-pending, .rate-mid, .doc-type-proposal { background: var(--accent-soft); color: var(--accent-ink); }
.chip-ok, .status-working, .rate-full, .toggle.on, .type-new { background: var(--ok-soft); color: var(--ok-ink); }
.chip-warn, .status-contracting, .type-repair { background: var(--warn-soft); color: var(--warn-ink); }
/* 현장 상태 9종 — v1 스펙트럼(보라→파랑→앰버→녹색, 매각 무채색, 영업중 핑크) 유지 */
.status-sales-init  { background: var(--violet-soft); color: var(--violet-ink); }
.status-design      { background: var(--accent-soft); color: var(--accent-ink); }
.status-estimate    { background: var(--accent-soft); color: var(--accent-ink); }
.status-precontract { background: var(--accent-soft); color: var(--accent-ink); }
.status-prestart    { background: var(--warn-soft);   color: var(--warn-ink); }
.status-done        { background: var(--ok-soft);     color: var(--ok-ink); }
.status-sold        { background: var(--surface-3);   color: var(--ink-soft); }
.status-sales       { background: var(--pink-soft);   color: var(--pink-ink); }
.chip-danger, .status-rejected, .rate-low { background: var(--danger-soft); color: var(--danger-ink); }
.toggle.off { background: var(--surface-3); color: var(--ink-muted); }
.perm-on { background: var(--accent-soft); color: var(--accent-ink); }
.doc-type-expense { background: var(--accent-soft); color: var(--accent-ink); }

/* ===== Approval Stamp ===== */
.stamp {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: 2px solid var(--warn);
  color: var(--warn); font-family: var(--font-hand); font-weight: 700;
  font-size: 11px; transform: rotate(-8deg); border-radius: 50%;
  background: var(--surface);
}
.stamp.ok { border-color: var(--ok); color: var(--ok); }
.stamp.reject { border-color: var(--danger); color: var(--danger); }
.stamp.wait { border-color: var(--ink-muted); color: var(--ink-muted); }

/* ===== Sketch primitives (v2: 헤어라인) ===== */
.sk { border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sk-soft { border: 1px solid var(--line-soft); }
.sk-double { box-shadow: none; }

/* ===== Dashboard (모듈 허브) ===== */
.dash-hero {
  background: var(--navy); color: #fff;
  padding: 20px 24px; border: none; border-radius: var(--radius-lg);
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.dash-hero-title { font-family: var(--font-hand); font-size: 20px; font-weight: 700; }
.dash-hero-sub { font-size: 13px; opacity: 0.8; margin-top: 4px; }
.dash-hero-btns { display: flex; gap: 8px; }
.dash-hero .btn {
  background: rgba(255,255,255,0.1); border-color: transparent;
  color: #fff;
}
.dash-hero .btn:hover { background: rgba(255,255,255,0.18); color: #fff; }

.dash-modules {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px;
  margin-bottom: 20px;
}
.dash-module {
  background: var(--surface); border: 1px solid transparent; border-radius: var(--radius-lg);
  padding: 20px 10px; text-align: center; text-decoration: none;
  color: var(--ink); aspect-ratio: 1.2;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  box-shadow: var(--shadow-1);
}
.dash-module:hover {
  text-decoration: none; transform: translateY(-2px);
  box-shadow: var(--shadow-2); border-color: var(--line);
}
.dash-module-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 20px; filter: none; opacity: 1; }
.dash-module-label { font-weight: 600; font-size: 13px; }

/* 컴팩트 변형 - 바로가기 스트립용 */
.dash-modules-compact { gap: 8px; }
.dash-modules-compact .dash-module {
  padding: 10px 6px; aspect-ratio: auto; gap: 6px;
  box-shadow: var(--shadow-1);
}
.dash-modules-compact .dash-module:hover { box-shadow: var(--shadow-2); }
.dash-modules-compact .dash-module-icon { width: 32px; height: 32px; font-size: 16px; }
.dash-modules-compact .dash-module-label { font-size: 12px; font-weight: 600; }

.dash-bottom {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.dash-bottom-2 { grid-template-columns: 1fr 1fr; }
.dash-bottom-3 { grid-template-columns: 1fr 1fr 1fr; }
.dash-bottom-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.dash-box-fixed { height: 250px; overflow-y: auto; }
.dash-box-empty { padding: 24px 0; color: var(--ink-muted); font-size: 13px; text-align: center; }
.dash-bottom-4 .dash-box-body { min-height: 300px; }
.dash-box {
  background: var(--surface); border: none; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1); overflow: hidden; margin-bottom: 16px;
}
.dash-box-header {
  padding: 16px 20px 8px; background: var(--surface);
  border-bottom: none;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 16px; letter-spacing: -0.02em;
}
.dash-box-header .more { color: var(--accent-ink); font-size: 13px; font-weight: 600; text-decoration: none; }
.dash-box-header .more:hover { text-decoration: underline; }
.dash-box-body { padding: 4px 20px 16px; }
.dash-notice-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: var(--list-py) 0; border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.dash-notice-item:last-child { border-bottom: none; }
.dash-notice-tag { color: var(--accent-ink); font-weight: 600; margin-right: 6px; }
.dash-notice-new { background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; height: 16px; padding: 0 6px; margin-left: 6px; font-weight: 700; border-radius: var(--radius-pill); display: inline-block; vertical-align: middle; }
.dash-notice-date { color: var(--ink-muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.dash-stat-row { display: flex; gap: 8px; margin-bottom: 12px; }
.dash-stat {
  flex: 1; text-align: center; padding: 12px 8px;
  background: var(--surface-2); border: none; border-radius: var(--radius);
}
.dash-stat.active { background: var(--accent-soft); border-color: transparent; }
.dash-stat.active .dash-stat-value { color: var(--accent-ink); }
.dash-stat-label { font-size: 12px; color: var(--ink-muted); }
.dash-stat-value { font-family: var(--font-hand); font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
.dash-queue-item { padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--line-soft); }
.dash-queue-item:last-child { border-bottom: none; }
.dash-queue-item a { color: var(--ink); }

/* ===== Approval (2분할 결재함) ===== */
.approval-workspace {
  display: grid; grid-template-columns: 300px 1fr; gap: 16px;
  min-height: 600px;
  border: none; box-shadow: none;
  background: transparent;
}
.approval-subnav {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap;
  border-bottom: none; background: transparent;
  padding: 0; gap: 6px; margin-bottom: 4px;
}
.approval-subnav a {
  padding: 6px 12px; font-size: 13px; font-weight: 600; color: #6B7684;
  text-decoration: none; border-bottom: none; border-radius: var(--radius-pill);
  margin-bottom: 0; transition: background-color .15s, color .15s;
}
.approval-subnav a:hover { color: var(--ink); background: var(--surface-3); text-decoration: none; }
.approval-subnav a.active {
  color: var(--accent-ink); font-weight: 700;
  border-bottom-color: transparent; background: var(--accent-soft);
}
.approval-subnav a .text-muted { color: inherit; opacity: .7; }
.approval-list {
  border-right: none; background: var(--surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-1);
  overflow-y: auto; max-height: 70vh;
}
.approval-list-header {
  padding: 12px 16px; font-size: 13px; font-weight: 600; color: var(--ink-muted);
  border-bottom: 1px solid var(--line-soft);
}
.approval-list-item {
  padding: 14px 16px; border-bottom: 1px solid var(--line-soft);
  cursor: pointer; border-left: none;
  text-decoration: none; display: block; color: var(--ink);
  background: transparent; transition: background-color .15s;
}
.approval-list-item:hover { background: var(--surface-2); text-decoration: none; }
.approval-list-item.selected { background: #F0F6FF; border-left-color: transparent; box-shadow: inset 3px 0 0 var(--accent); }
.approval-item-head {
  display: flex; justify-content: space-between; align-items: center;
}
.approval-item-num {
  font-family: var(--font-body); font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums;
}
.approval-item-title { font-weight: 600; font-size: 15px; margin: 4px 0 2px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.approval-item-meta { font-size: 13px; color: var(--ink-muted); }

.approval-detail { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }
.approval-detail-header {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 10px;
}
.approval-detail-header-row1 {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 8px; flex-wrap: wrap;
}
.approval-detail-header-row2 {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 12px; flex-wrap: wrap;
}
.approval-detail-title-block { flex: 1; min-width: 0; }
/* 공람자 블록 — 결재란 왼쪽 동일 행: 제목(flex:1)과 결재란(flex-shrink:0) 사이에서 줄어들 수 있게 */
.approval-detail-header-row2 .approval-readers { flex: 0 1 auto; min-width: 0; max-width: 320px; }
.approval-detail-title { font-family: var(--font-hand); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.approval-detail-meta { font-size: 13px; color: var(--ink-muted); margin-top: 4px; }
.approval-detail-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.approval-detail-actions .btn { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--radius-sm); }
.approval-detail-actions-primary { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.approval-detail-body { padding: 20px 24px; overflow-y: auto; }

/* 미니 결재라인 — 상세 헤더 우측 표시 (2단 셀: 이름 / 도장) */
.approval-line {
  display: inline-flex; gap: 6px; padding: 0;
  background: transparent; border: none;
  margin: 0;
  align-items: flex-start;
  flex-shrink: 0;
}
.approval-line-cell {
  display: flex; flex-direction: column; align-items: center;
}
/* 폭 65px = 이름 3자(10px 볼드 30.00) + 간격 2 + (전결)(9px 볼드 24.44) = 56.44 에
   좌우 패딩 4 + 테두리 3 을 더하고 여유 1.5 를 얹은 값. 맑은고딕 실측 기준.
   높이 77px 은 종전 56×66 비율을 유지한 값(오차 0.5%). 모바일 .m-al-box 도 같은 규칙. */
.approval-line-box {
  width: 65px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius-sm);
}
.approval-line-box.ok     { border-color: var(--ok); }
.approval-line-box.reject { border-color: var(--danger); }
.approval-line-box.wait   { border-color: var(--line-strong); }
.approval-line-name {
  font-size: 10px; font-weight: 600; text-align: center;
  padding: 2px 2px; background: var(--surface-2);
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  white-space: nowrap; overflow: hidden;
  max-width: 100%; line-height: 1.2;
  display: flex; align-items: baseline; justify-content: center; gap: 2px;
}
/* 이름만 줄어들게 하는 칸 — min-width:0 이 없으면 flex 항목이 내용폭 밑으로 안 줄어 (전결)을 밀어낸다 */
.approval-line-nm {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink);
}
.approval-line-body {
  height: 57px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-hand); font-size: 13px; font-weight: 700;
  color: var(--ink); padding: 2px;
}
.approval-line-body img {
  max-width: 58px; max-height: 50px; object-fit: contain;
}
.approval-line-box.reject .approval-line-body { color: var(--danger); }
.approval-line-box.wait   .approval-line-body { color: var(--ink-muted); }

/* 진행 중 결재자 추가/삭제 (2026-08-07) */
.approval-line-cell { position: relative; }
.approval-line-remove { position: absolute; top: -7px; right: -7px; z-index: 1; }
.approval-line-remove-btn {
  width: 18px; height: 18px; border-radius: 50%; padding: 0;
  border: 1px solid var(--danger); background: var(--surface); color: var(--danger);
  font-size: 12px; line-height: 1; cursor: pointer;
}
.approval-line-remove-btn:hover { background: var(--danger); color: var(--surface); }
.approval-line-added { font-size: 10px; color: var(--ink-muted); }
.approval-line-add-wrap { margin-top: 8px; }
.approval-line-add-form { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.approval-line-add-form select { width: auto; }
/* 전결 / 생략 (2026-08-13) */
/* 이름 옆 인라인 표기 — 별도 행이 아니므로 flex:none 으로 절대 줄지 않게 둔다 */
.approval-line-jeon {
  flex: 0 0 auto;
  font-size: 9px; font-weight: 700;
  color: var(--accent-ink); line-height: 1.2;
}
.approval-line-jeon.pending { color: var(--ink-muted); font-weight: 600; }
.approval-line-box.skip { border-color: var(--line-strong); }
.approval-line-box.skip .approval-line-name { color: var(--ink-muted); }
.approval-line-box.skip .approval-line-body {
  color: var(--ink-muted);
  background-image: linear-gradient(to bottom right,
    transparent calc(50% - 0.5px), var(--line-strong) calc(50% - 0.5px),
    var(--line-strong) calc(50% + 0.5px), transparent calc(50% + 0.5px));
}
.approval-action-note {
  font-size: 12px; color: var(--danger);
  margin-bottom: 6px; line-height: 1.4;
}
.approval-line-add-jeon {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; white-space: nowrap; margin: 0;
}
.badge-line { background: var(--ink-muted); }

.approval-line-date {
  font-size: 9px; color: var(--ink-muted); margin-top: 3px;
  text-align: center; white-space: nowrap; line-height: 1.2;
}

/* (구) 미니 결재라인 — 호환용. 신 마크업으로 점진 교체 */
.approval-line-step {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--ink-muted);
  font-family: var(--font-hand);
  font-size: 11px; font-weight: 700;
  color: var(--ink-muted);
  cursor: default;
  background: var(--surface);
}
.approval-line-step.ok    { border-color: var(--ok);    color: var(--ok); }
.approval-line-step.reject{ border-color: var(--danger);color: var(--danger); }
.approval-line-step.wait  { border-color: var(--ink-muted); color: var(--ink-muted); }
.approval-line-step .stamp-img {
  width: 24px; height: 24px;
  object-fit: contain;
  display: block;
}

/* 뷰(approvals/list·purchases/list JS 문자열, tax-invoices/detail)의 인라인 style="border-collapse:collapse"가 separate를 덮어써 collapse 모드가 되면, 표 테두리(반은 박스 밖)가 overflow hidden에 잘려 상·하 선이 안 보였다(시안 피드백 3).
   !important로 separate 강제 → 1px 라운드 외곽선 복원. tax-invoices 인라인 border-top(line-soft)도 같은 톤으로 고정 */
.approval-info-table { width: 100%; border-collapse: separate !important; border-spacing: 0; margin-bottom: 16px; font-size: 14px; border: 1px solid var(--line); border-top: 1px solid var(--line) !important; border-radius: var(--radius); overflow: hidden; }
.approval-info-table th { width: 120px; background: var(--surface-2); color: var(--ink-muted); font-size: 13px; font-weight: 600; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.approval-info-table td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.approval-info-table tr:last-child th,
.approval-info-table tr:last-child td { border-bottom: none; }
.approval-info-table td:last-child { }
.num-cell { text-align: right; font-variant-numeric: tabular-nums; }
.approval-opinion { margin-top: 20px; }
.approval-opinion h4 { font-size: 14px; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
.approval-opinion textarea { width: 100%; min-height: 80px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; font-family: var(--font-body); resize: vertical; }
.approval-action-bar { display: flex; gap: 8px; justify-content: flex-end; padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--line-soft); }
.approval-action-bar form { display: inline-flex; gap: 8px; }

/* ===== Filter / Search bar (카드형 툴바) ===== */
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-1); }
.filter-bar select, .filter-bar input { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; background: var(--surface); font-family: var(--font-body); }
.search-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-1); }
.search-bar select, .search-bar input { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; background: var(--surface); font-family: var(--font-body); }
.search-bar input[type="text"]:focus, .filter-bar input:focus, .filter-bar select:focus, .search-bar select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ===== Summary Inline ===== */
/* summary-inline / highlight */
.summary-inline { display: flex; gap: 16px; align-items: center; padding: 12px 16px; margin-bottom: 16px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-1); font-size: 14px; color: var(--ink-soft); }
.highlight { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.highlight-primary { color: var(--accent-ink); }

/* ===== Detail ===== */
/* 상세 페이지 */
.detail-container { max-width: 1000px; }
.detail-card { background: var(--surface); border: none; box-shadow: var(--shadow-1); border-radius: var(--radius-lg); padding: 28px; margin-bottom: 16px; }
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; gap: 12px; }
.detail-header h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.detail-item { background: var(--surface-2); border: none; border-radius: var(--radius); padding: 12px 14px; }
.detail-label { font-size: 12px; font-weight: 500; color: var(--ink-muted); margin-bottom: 4px; }
.detail-value { font-size: 15px; font-weight: 600; color: var(--ink); }
.detail-total { color: var(--accent-ink); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.detail-section { margin-top: 24px; }
.detail-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.detail-section p { font-size: 14px; line-height: 1.6; color: var(--ink-soft); white-space: pre-wrap; }
.detail-actions { display: flex; gap: 8px; margin-top: 20px; }
.file-list { list-style: none; }
.file-list li { padding: 6px 0; font-size: 13px; }
.file-list a { color: var(--accent-ink); }

/* ===== Approval List rows ===== */
.approval-row { cursor: pointer; transition: background 0.12s; }
.approval-row:hover { background: var(--surface-2) !important; }
.approval-row.expanded { background: var(--surface-2); border-left: 3px solid var(--accent); }
.detail-row td { padding: 0 !important; border-bottom: 1px solid var(--line); }
.inline-detail { background: var(--surface-2); }
.inline-detail-inner { padding: 14px 16px; }

.detail-meta-card { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 10px; }
.detail-meta-grid { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; }
.detail-meta-item { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.detail-meta-total { margin-left: auto; }
.meta-label { color: var(--ink-muted); font-size: 11px; }
.meta-value { color: var(--ink); font-weight: 500; }
.meta-value-primary { color: var(--accent-ink); font-size: 14px; font-weight: 700; }

.detail-item-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; background: var(--surface); }
.detail-item-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line-soft); font-size: 14px; font-weight: 600; }
.detail-item-num { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 600; }
.detail-item-company { font-weight: 700; color: var(--ink); font-size: 18px; flex: 1; }
.detail-item-date-head { font-size: 15px; font-weight: 600; color: var(--ink-soft); margin-left: auto; white-space: nowrap; }
.detail-item-date-head .date-label { color: var(--ink-muted); margin-right: 4px; font-size: 13px; }
.detail-item-amount { font-weight: 700; color: var(--ink); font-size: 17px; white-space: nowrap; font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.detail-item-payment-chip {
  background: var(--surface-3);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.detail-item-body { padding: 12px 14px; }
.detail-item-summary {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.5;
  word-break: break-word;
}
.detail-item-note {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  line-height: 1.5;
  word-break: break-word;
}
.detail-item-link {
  font-size: 13px;
  margin-bottom: 6px;
  word-break: break-all;
}
.detail-item-link a { color: var(--accent-ink); }
.detail-item-row { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 7px; }
.detail-item-row:last-child { margin-bottom: 0; }
.detail-item-field { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); }
.detail-item-field-wide { flex: 1; min-width: 200px; }
.field-label { color: var(--ink-muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.field-value { color: var(--ink); font-weight: 500; font-size: 14px; }
.detail-item-exec { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 8px 0 0; margin-top: 8px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--ink); }
.detail-item-exec .field-label { font-size: 11.5px; }

.detail-files-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; padding: 8px 14px; margin-bottom: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; }
.file-link { color: var(--accent-ink); padding: 2px 7px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); font-size: 13px; }
.file-link:hover { background: var(--accent-soft); text-decoration: underline; }

.inline-actions { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; }
.detail-loading { padding: 16px; text-align: center; color: var(--ink-muted); font-size: 13px; }

/* ===== Inner-table (원가투입현황 팝업) ===== */
.inner-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line-soft); margin-bottom: 10px; font-size: 13px; }
.inner-table thead th { background: var(--surface-3); padding: 8px 10px; font-size: 12px; color: var(--ink-soft); border-bottom: 1px solid var(--line-soft); white-space: nowrap; text-align: center; }
.inner-table tbody td { padding: 8px 10px; font-size: 13px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; text-align: center; }
.inner-table tfoot td { padding: 8px 10px; font-size: 13px; background: var(--surface-3); border-top: 1px solid var(--line); text-align: center; }
.inner-table .text-right { text-align: right; min-width: 0; }

/* ===== Item Cards (Approval Form) ===== */
.items-container { border: 1px solid var(--line-soft); padding: 12px; background: var(--surface-2); }
.item-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px 16px; margin-bottom: 10px; box-shadow: none; position: relative; }
.item-card-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); font-size: 14px; font-weight: 600; }
.item-num { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.item-row-line { display: flex; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.item-field { display: flex; flex-direction: column; flex: 1; min-width: 120px; }
.item-field-wide { flex: 2; min-width: 200px; }
.item-field label { font-size: 12px; font-weight: 600; color: var(--ink-muted); margin-bottom: 3px; }
.item-field input, .item-field select { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; background: var(--surface); }
.item-field input:focus, .item-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.item-field input[readonly] { background: var(--surface-2); color: var(--ink); font-weight: 600; }

.btn-remove { background: var(--danger-soft); color: var(--danger-ink); border: none; border-radius: var(--radius-sm); height: 28px; padding: 0 10px; font-size: 12px; cursor: pointer; }
.btn-remove:hover { background: #FFDBDB; color: var(--danger-ink); }

.total-display-input { font-size: 16px !important; font-weight: 700 !important; color: var(--ink) !important; background: var(--surface-2) !important; font-family: ui-monospace, monospace !important; text-align: right !important; font-variant-numeric: tabular-nums !important; }

/* ===== Cost Summary ===== */
.cost-summary { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--ink-soft); }
.cost-summary span { display: flex; align-items: center; gap: 5px; font-weight: 700; color: var(--ink); }

/* ===== Paid Toggle ===== */
.paid-toggle-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.paid-toggle { padding: 0 10px; height: 24px; font-size: 12px; font-weight: 600; border: none; border-radius: var(--radius-pill); cursor: pointer; background: var(--surface); }
.paid-yes { background: var(--ok-soft); color: var(--ok-ink); border-color: var(--ok); }
.paid-yes:hover { opacity: 0.85; }
.paid-no { background: var(--danger-soft); color: var(--danger-ink); border-color: var(--danger); }
.paid-no:hover { opacity: 0.85; }
.paid-date { font-size: 12px; color: var(--ink-muted); white-space: nowrap; }

/* ===== Log Groups (현장별 카드) ===== */
.log-group { margin-bottom: 20px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.log-group-header { display: flex; align-items: center; gap: 10px; margin-bottom: 0; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.log-group-header h2 { font-size: 16px; color: var(--ink); margin: 0; font-family: var(--font-hand); letter-spacing: -0.02em; }
.log-group-count { background: var(--surface-3); color: var(--ink-soft); padding: 0 8px; height: 22px; line-height: 22px; border: none; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; }
.log-group-total { margin-left: auto; font-size: 13px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.log-group-total strong { color: var(--ink); font-size: 15px; font-weight: 700; }
.log-group-sums { margin-left: auto; display: inline-flex; gap: 18px; align-items: center; }
.log-group-sums .log-group-total { margin-left: 0; }
.memo-new-badge { display: inline-block; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 18px; height: 18px; padding: 0 6px; border-radius: var(--radius-pill); margin-right: 4px; vertical-align: 2px; }
.recontract-badge { margin-top: 3px; font-size: 11px; font-weight: 600; color: var(--warn-ink); background: var(--warn-soft); border: none; border-radius: var(--radius-pill); padding: 2px 8px; display: inline-block; white-space: nowrap; }
.log-group table { table-layout: fixed; width: 100%; }
.log-group th:nth-child(1), .log-group td:nth-child(1) { width: 45px; text-align: center; }
.log-group th:nth-child(2), .log-group td:nth-child(2) { width: 120px; }
.log-group th:nth-child(3), .log-group td:nth-child(3) { width: 170px; }
.log-group th:nth-child(4), .log-group td:nth-child(4) { width: 130px; }
.log-group th:nth-child(5), .log-group td:nth-child(5) { width: 110px; text-align: right; }
.log-group th:nth-child(6), .log-group td:nth-child(6) { width: 90px; text-align: center; }
.log-group th:nth-child(7), .log-group td:nth-child(7) { width: 90px; text-align: center; }
.log-group th:nth-child(8), .log-group td:nth-child(8) { width: 65px; text-align: center; }
.log-group th:nth-child(9), .log-group td:nth-child(9) { width: 110px; text-align: center; }
.log-group td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Bank Balance Table (카드) ===== */
.bank-section { margin-bottom: 20px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.bank-section h2 { font-size: 16px; margin: 0; padding: 16px 20px 8px; color: var(--ink); font-family: var(--font-hand); letter-spacing: -0.02em; }
.bank-table thead th { text-align: center; }
.bank-table tbody td { text-align: center; font-variant-numeric: tabular-nums; }
.bank-table .text-right { text-align: right; }
.bank-name-cell { font-weight: 600; text-align: left !important; white-space: nowrap; }
.bank-value { cursor: pointer; padding: 4px 6px; margin: -4px -6px; border-radius: 6px; transition: background-color .15s; }
.bank-value:hover { background: var(--surface-3); }
.bank-value:hover::after { content: ' ✎'; color: var(--ink-muted); font-size: 11px; }
.bank-current { color: var(--ink); font-weight: 700; font-family: var(--font-body); }
.bank-note { font-size: 12px; color: var(--ink-muted); }
.bank-edit-input { width: 120px; height: 32px; padding: 0 8px; border: 1px solid var(--accent); border-radius: var(--radius-sm); font-size: 13px; text-align: right; outline: none; font-family: var(--font-body); box-shadow: 0 0 0 3px var(--accent-soft); }
.bank-edit-input[type="text"] { text-align: left; width: 150px; font-family: var(--font-body); }
.bank-table tfoot td { background: var(--surface-2); border-top: 1px solid var(--line); font-size: 14px; }
.bank-table tfoot strong { color: var(--ink); }

/* ===== Deposit Check ===== */
.deposit-check { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }

/* ===== Permission Checkbox Group ===== */
.perm-check-group { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px; background: var(--surface-2); border: none; border-radius: var(--radius); }
.perm-check-group .checkbox-label { font-size: 13px; min-width: 120px; }

/* ===== Labor Sub-tabs (세그먼트 컨트롤 — 통합일지·노무 화면 공용) ===== */
.labor-tabs { display: inline-flex; gap: 2px; margin-bottom: 16px; padding: 4px; background: var(--surface-3); border-radius: 12px; border-bottom: none; }
.labor-tab { padding: 8px 16px; font-size: 14px; font-weight: 600; color: #6B7684; text-decoration: none; border-bottom: none; border-radius: 9px; margin-bottom: 0; transition: background-color .15s, color .15s, box-shadow .15s; }
.labor-tab:hover { color: var(--ink); text-decoration: none; }
.labor-tab.active { color: var(--ink); border-bottom-color: transparent; background: var(--surface); box-shadow: var(--shadow-1); }

/* ===== Attendance Table ===== */
.attendance-table { border-collapse: collapse; table-layout: fixed; }
.attendance-table th, .attendance-table td { padding: 3px 2px; font-size: 11px; text-align: center; border: 1px solid var(--line-soft); height: 22px; }
.attendance-table th.att-fixed, .attendance-table td.att-fixed { background: var(--surface); white-space: nowrap; text-align: center; padding: 4px 8px; overflow: hidden; text-overflow: ellipsis; }
.attendance-table thead th { background: var(--surface-2); font-weight: 600; color: var(--ink-soft); }
.att-name { font-weight: 600; }
.att-resident { font-size: 10px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; }
.att-bank { font-size: 9.5px; color: var(--ink-muted); }
.att-trade { font-size: 10.5px; }
.att-day { line-height: 1; }
.att-cell { cursor: pointer; transition: background 0.12s; }
.att-cell:hover { background: var(--accent-soft); }
.att-cell span:not(:empty) { font-weight: 600; color: var(--ink); }
.att-day, .att-cell { text-align: center !important; }
.att-sun, th.att-sun { background: var(--danger-soft) !important; color: var(--danger) !important; }
.att-sat, th.att-sat { background: var(--surface-2) !important; color: var(--ink-soft) !important; }
.att-cell.att-gps { box-shadow: inset 0 0 0 2px var(--ok); }
.att-total { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.att-wage { font-size: 11px; text-align: right !important; padding: 4px 8px !important; white-space: nowrap; cursor: pointer; font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.att-wage:hover { background: var(--accent-soft); }
.att-wage-total { font-size: 11px; text-align: right !important; padding: 4px 8px !important; color: var(--ink); white-space: nowrap; font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.att-row-top td { border-bottom: none; }
.att-row-bottom td { border-top: 1px solid var(--line-soft); }
.att-row-top td[rowspan] { border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.att-empty { background: var(--surface-2); }
/* 공제 열(소득세·국민연금·건강보험·주민세·고용보험·요양보험·공제합계): 시안 피드백으로 연빨강→연파랑. 실지급 .att-net(초록)은 뒤 규칙이 이겨 그대로.
   공제합계·실지급액의 데이터 셀(td)은 배경 없음(흰 바탕) — 색 배경이 근로자 사이 구분선을 가려서(2라운드 피드백). 헤더 th 배경은 아래 thead 규칙이 담당 */
.att-deduct { font-size: 10.5px; text-align: right !important; padding: 3px 6px !important; white-space: nowrap; color: var(--accent-ink); font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.att-deduct-sum { font-size: 11px; color: var(--accent-ink); vertical-align: middle; }
.att-net { font-size: 11px; color: var(--ok-ink); vertical-align: middle; }
.attendance-table thead th.att-deduct { background: var(--accent-soft); color: var(--accent-ink); }
.attendance-table thead th.att-net { background: var(--ok-soft); color: var(--ok-ink); }
.wage-input { width: 80px; padding: 2px 4px; font-size: 11px; text-align: right; border: 1px solid var(--accent); border-radius: var(--radius-sm); outline: none; font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.att-report input { cursor: pointer; margin: 0; vertical-align: middle; }
.att-num { color: var(--ink-soft); }
/* 26px 열에 '신고'/'번호' 2글자(기본 11px 폰트)가 말줄임 없이 들어가도록 패딩만 축소 */
.attendance-table th.att-report, .attendance-table th.att-num,
.attendance-table td.att-report, .attendance-table td.att-num { padding: 3px 1px; }
.attendance-table thead th.att-expense-head { background: var(--surface-2); color: var(--ink-soft); }
.att-expense-cell { font-size: 10px; text-align: center !important; padding: 2px 4px !important; white-space: nowrap; font-family: var(--font-body); font-variant-numeric: tabular-nums; vertical-align: middle; }
.btn-expense { display: block; margin: 0 auto; font-size: 10px; padding: 1px 6px; border: 1px solid var(--line-soft); background: var(--surface-2); border-radius: 4px; cursor: pointer; color: var(--ink-soft); }
.btn-expense:hover { background: var(--accent-soft); }

/* ===== Modal ===== */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(25,31,40,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-content { background: var(--surface); border: none; box-shadow: var(--shadow-pop); border-radius: 20px; max-width: 900px; width: 90%; max-height: 80vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line-soft); background: var(--surface); }
.modal-header h3 { font-size: 18px; font-weight: 700; color: var(--ink); font-family: var(--font-hand); }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--ink-muted); width: 32px; height: 32px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.modal-close:hover { color: var(--ink); background: var(--surface-3); }
.modal-body { padding: 20px 24px; }
.company-link { color: var(--accent-ink); cursor: pointer; text-decoration: underline; }
.company-link:hover { color: var(--accent-hover); opacity: 1; }

/* ===== Confirmation Badge ===== */
.confirm-badge { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; cursor: pointer; border: none; transition: all 0.15s; background: var(--surface-3); color: var(--ink-soft); }
.confirm-badge.confirmed { background: var(--ok-soft); color: var(--ok-ink); border-color: var(--ok); }
.confirm-badge.unconfirmed { background: var(--warn-soft); color: var(--warn-ink); border-color: var(--warn); }
.confirm-badge.pending { background: var(--surface-3); color: var(--ink-muted); }
.confirm-badge.req-badge { background: var(--violet-soft); color: var(--violet-ink); border-color: var(--violet-ink); }
.confirm-badge.rejected { background: var(--danger-soft); color: var(--danger-ink); border-color: transparent; }
.confirm-badge:hover { opacity: 0.85; }

/* ===== Mobile Header (PC 폴백용) ===== */
.mobile-header {
  display: none; position: fixed; top: 0; left: 0; right: 0; height: 48px;
  background: var(--navy); color: #fff; z-index: 200;
  align-items: center; padding: 0 12px; gap: 10px;
  border-bottom: none;
}
.hamburger-btn { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; padding: 4px 6px; }
.mobile-title { font-size: 17px; font-weight: 800; font-family: var(--font-body); letter-spacing: -0.01em; }
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(25,31,40,0.5); z-index: 150; }
.sidebar-overlay.open { display: block; }

/* ===== Autocomplete dropdown ===== */
.autocomplete-wrap { position: relative; }
.ac-dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-height: 220px; overflow-y: auto; z-index: 1000; display: none; box-shadow: var(--shadow-2); }
.ac-item { padding: 8px 12px; cursor: pointer; font-size: 14px; }
.ac-item:hover { background: var(--surface-3); }
.ac-no-result { color: var(--ink-muted); cursor: default; }
.ac-no-result:hover { background: transparent; }

/* ===== Execution matrix ===== */
.execution-matrix { font-size: 12px; border-collapse: separate; border-spacing: 0; }
.execution-matrix thead th { background: var(--surface-2); color: var(--ink); padding: 8px 10px; font-size: 11px; font-weight: 600; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.execution-matrix tbody td { white-space: nowrap; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.execution-matrix tbody tr:hover { background: var(--surface-2); }
.execution-matrix tbody td[rowspan] { background: var(--surface-2); font-weight: 600; color: var(--ink); border-right: 1px solid var(--line); vertical-align: middle; }
.subtotal-row { background: var(--surface-2) !important; border-top: 1px solid var(--line); }
.subtotal-row td { color: var(--ink) !important; font-weight: 500; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.grand-total-row { background: var(--navy) !important; }
.grand-total-row td { color: var(--paper) !important; font-weight: 600; padding: 9px 10px; border-bottom: none; }
.text-muted { color: var(--ink-muted); }
.text-soft { color: var(--ink-soft); }
.budget-list-item input[type="number"] { padding: 3px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* ===== 알림 시스템 ===== */
.notification-area { position: relative; padding: 0; }
.notification-btn { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--ink-soft); position: relative; width: 32px; height: 32px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.notification-btn:hover { color: var(--ink); background: var(--surface-3); }
.notif-badge { position: absolute; top: -2px; right: -2px; background: var(--danger); color: #fff; border-radius: var(--radius-pill); min-width: 16px; height: 16px; font-size: 10px; line-height: 16px; text-align: center; padding: 0 4px; font-weight: 700; }
.notif-dropdown { position: absolute; top: calc(100% + 6px); right: 0; width: 340px; max-height: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); z-index: 1000; overflow: hidden; }
.notif-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); background: var(--surface); font-size: 15px; font-weight: 700; }
.notif-read-all { background: none; border: none; color: var(--accent-ink); cursor: pointer; font-size: 13px; font-weight: 600; padding: 4px 6px; border-radius: var(--radius-sm); }
.notif-read-all:hover { background: var(--accent-soft); }
.notif-list { overflow-y: auto; max-height: 360px; }
.notif-item { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); color: var(--ink); transition: background-color .15s; }
.notif-item:hover { background: var(--surface-2); text-decoration: none; }
.notif-item.unread { background: #F0F6FF; }
.notif-title { font-size: 14px; font-weight: 600; }
.notif-msg { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.notif-time { font-size: 12px; color: var(--ink-muted); margin-top: 4px; }
.notif-empty { text-align: center; padding: 24px; color: var(--ink-muted); font-size: 13px; }

/* ===== Comment Timeline ===== */
.comment-timeline { border-left: 2px solid var(--line); padding-left: 16px; margin: 12px 0; }
.comment-item { position: relative; padding: 10px 12px; margin-bottom: 10px; background: var(--surface-2); border: none; border-radius: var(--radius); }
.comment-item::before { content: ''; position: absolute; left: -22px; top: 14px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--surface); background: var(--ink-faint); }
.comment-action-approve::before { background: var(--ok); }
.comment-action-reject::before { background: var(--danger); }
.comment-action-cancel_approve::before { background: var(--warn); }
.comment-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; font-size: 13px; }
.comment-badge { display: inline-block; height: 20px; line-height: 20px; padding: 0 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; color: #fff; }
.badge-approve { background: var(--ok); }
.badge-reject { background: var(--danger); }
.badge-cancel { background: var(--warn); }
.comment-time { color: var(--ink-muted); font-size: 12px; margin-left: auto; }
.comment-text { font-size: 14px; line-height: 1.5; white-space: pre-wrap; }

/* 키보드 이동 시 현재 위치가 보이도록 (:focus-visible) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== Responsive ===== */
/* 터치 기기 전용 폴백 — PC 창 축소로는 발동 안 함(pointer:coarse 조건) */
@media (max-width: 768px) and (pointer: coarse) {
  .mobile-header { display: flex; }
  .topbar-wrap { display: none; }
  .main-content { margin-left: 0; padding: 60px 10px 14px; }
  .summary-cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .summary-cards .card { padding: 10px; }
  .card-value { font-size: 20px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .page-header h1 { font-size: 18px; }
  .form-row { flex-direction: column; gap: 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-container { padding: 14px; }
  .form-actions { flex-wrap: wrap; }
  .table-container, .table-container:has(> table), .table-container.log-group, .table-container.bank-section { padding: 10px; overflow-x: auto; }
  table { min-width: 600px; }
  .search-bar { flex-wrap: wrap; }
  .btn { padding: 6px 12px; font-size: 12px; }
  .detail-container { max-width: 100%; }
  .cost-summary { flex-direction: column; gap: 6px; align-items: flex-start; }
  .summary-inline { padding: 8px 12px; font-size: 12px; }
  .log-group table { min-width: 700px; }
  .detail-meta-grid { gap: 3px 14px; }
  .detail-meta-total { margin-left: 0; }
  .detail-item-row { gap: 3px 10px; }
  .detail-item-field-wide { min-width: 150px; }
  .detail-item-exec { gap: 3px 10px; font-size: 11px; }
  .labor-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .labor-tab { padding: 7px 14px; white-space: nowrap; font-size: 12px; }
  .attendance-table { font-size: 10px; }
  .modal-content { width: 95%; max-height: 90vh; }
  .perm-check-group { gap: 6px; }
  .items-container { padding: 8px; }
  .item-row-line { flex-direction: column; gap: 5px; }
  .item-field { min-width: auto; }
  .item-field-wide { min-width: auto; }
  .dash-modules { grid-template-columns: repeat(2, 1fr); }
  .dash-bottom, .dash-bottom-3, .dash-bottom-4 { grid-template-columns: 1fr; }
  .dash-hero { flex-direction: column; align-items: flex-start; gap: 10px; }
  /* 1fr 트랙은 자동 최소치가 min-content라, 줄바꿈 안 되는 탭 줄(628px)이 트랙을 밀어내
     화면 전체가 가로로 밀린다. minmax(0,1fr)로 최소치를 풀고 탭 줄만 가로 스크롤시킨다. */
  .approval-workspace { grid-template-columns: minmax(0, 1fr); min-height: auto; }
  .approval-subnav { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .approval-subnav a { white-space: nowrap; }
  .approval-list { border-right: none; border-bottom: 1px solid var(--line); max-height: 40vh; }
}

/* === 메일 업그레이드 === */
.mail-unread-badge {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 0 4px;
  font-size: 9px;
  font-weight: bold;
  line-height: 14px;
  margin-left: 5px;
  vertical-align: middle;
  min-width: 14px;
  text-align: center;
}
.drop-zone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface-2);
}
.drop-zone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.drop-zone.drag {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.mail-folder-nav .mail-folder-active {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
}
#mail-body-frame {
  background: #fff;
}

/* 노무대장 미퇴근 셀 + 수정요청 상태 (2026-08-05) */
.att-cell.att-noout { background: var(--warn-soft); }
.att-cell.att-noout span { color: var(--warn-ink); font-weight: 700; }
.req-status { height: 22px; line-height: 22px; padding: 0 8px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; white-space: nowrap; }
.req-pending { background: var(--warn-soft); color: var(--warn-ink); }
.req-applied { background: var(--ok-soft); color: var(--ok-ink); }
.req-rejected { background: var(--danger-soft); color: var(--danger-ink); }

/* 전역 법인 스위처 */
.corp-switcher { height: 32px; padding: 0 28px 0 10px; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; background: var(--surface-3); color: var(--ink-soft); max-width: 200px; margin-right: 4px; cursor: pointer; }

/* ============================================================
   .ui-v2 덮어쓰기 — 뷰 인라인 <style> (뷰 무수정 원칙, 스펙 D4)
   ============================================================ */
/* 통합일지 은행 잔고 (views/logs/list.ejs 인라인) */
.ui-v2 .bank-badge { display: inline-flex; align-items: center; margin-left: 6px; height: 20px; padding: 0 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; background: var(--ok-soft); color: var(--ok-ink); vertical-align: middle; white-space: nowrap; }
.ui-v2 .bank-badge-error { background: var(--danger-soft); color: var(--danger-ink); }
.ui-v2 a.bank-fixed { color: var(--ink); text-decoration: none; border-bottom: 1px dashed var(--line-strong); }
.ui-v2 a.bank-fixed:hover { color: var(--accent-ink); border-bottom-color: var(--accent); }
.ui-v2 .bank-derived { color: var(--ink); }
.ui-v2 .bank-pending { color: var(--ink-soft); }
.ui-v2 #pending-unassigned { font-size: 12px; color: var(--ink-muted); padding: 8px 20px 12px; margin: 0; }

/* 통합일지 거래내역 탭 (views/logs/list.ejs 인라인 .tx-*) */
.ui-v2 .tx-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; padding: 12px 16px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-1); }
.ui-v2 .tx-filter select, .ui-v2 .tx-filter input { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 13px; background: var(--surface); font-family: var(--font-body); }
.ui-v2 .tx-filter select:focus, .ui-v2 .tx-filter input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ui-v2 .tx-filter button { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: #333D4B; font-size: 13px; font-weight: 600; cursor: pointer; }
.ui-v2 .tx-filter button:hover { background: var(--surface-2); }
.ui-v2 .tx-filter a { font-size: 13px; font-weight: 600; color: var(--accent-ink); }
.ui-v2 .tx-summary { display: flex; gap: 24px; align-items: center; margin: 0 0 12px; padding: 12px 16px; background: var(--surface); border-radius: 12px; font-size: 14px; color: var(--ink-soft); }
.ui-v2 .tx-summary strong { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ui-v2 .tx-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.ui-v2 .tx-table th, .ui-v2 .tx-table td { border: none; border-bottom: 1px solid var(--line-soft); padding: var(--cell-py) var(--cell-px); font-size: 14px; }
.ui-v2 .tx-table th { background: var(--surface-2); color: var(--ink-muted); font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--line); }
.ui-v2 .tx-table tbody tr:last-child td { border-bottom: none; }
.ui-v2 .tx-table td.num, .ui-v2 .tx-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ui-v2 .tx-site-cell { min-width: 220px; }
.ui-v2 .tx-site { max-width: 240px; height: 32px; padding: 0 8px; font-size: 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.ui-v2 .tx-site-badge { display: inline-flex; align-items: center; margin-left: 4px; height: 20px; padding: 0 7px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; vertical-align: middle; }
.ui-v2 .tx-site-badge.auto { background: var(--accent-soft); color: var(--accent-ink); }
.ui-v2 .tx-site-badge.manual { background: var(--surface-3); color: var(--ink-soft); }
.ui-v2 .tx-site-note { display: block; font-size: 12px; color: var(--ink-muted); }
.ui-v2 .tx-paging a { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: var(--radius-pill); background: var(--surface-3); color: var(--ink-soft); font-size: 13px; font-weight: 600; text-decoration: none; }
.ui-v2 .tx-paging a:hover { background: var(--line-strong); }
.ui-v2 .tx-paging span { font-size: 13px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* 사용자 관리 목록 (views/users/list.ejs — 셀에 훅이 없어 페이지 헤더의 '+ 사용자 등록' 링크로 식별) :
   접근 권한 뱃지 열(5번째)이 폭을 다 먹어 이름·등록일이 두 줄, 관리 버튼이 상하로 갈라짐 → 이름(2)·등록일(6)·관리(7) 열은 줄바꿈 금지, 남는 폭은 권한 열이 흡수 */
.ui-v2:has(.page-header a[href="/users/new"]) .table-container > table td:nth-child(2),
.ui-v2:has(.page-header a[href="/users/new"]) .table-container > table td:nth-child(6),
.ui-v2:has(.page-header a[href="/users/new"]) .table-container > table td:nth-child(7) { white-space: nowrap; }

/* ===== 시안 옵션 위젯 (admin·v2 전용, views/partials/ui-v2-preview.ejs) ===== */
.uiv2-preview { position: fixed; right: 20px; bottom: 20px; z-index: 900; width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); font-size: 12px; color: var(--ink-soft); overflow: hidden; }
.uiv2-preview-toggle { width: 100%; height: 36px; border: none; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; text-align: left; padding: 0 14px; }
.uiv2-preview-body { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.uiv2-preview[data-collapsed="1"] { width: auto; }
.uiv2-preview[data-collapsed="1"] .uiv2-preview-body { display: none; }
.uiv2-preview-row { display: flex; align-items: center; gap: 10px; }
.uiv2-preview-row label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; color: var(--ink); }
.uiv2-preview-row input[type="radio"] { accent-color: var(--accent); margin: 0; }
.uiv2-preview-label { width: 40px; color: var(--ink-muted); font-weight: 600; }
.uiv2-preview-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 6px; border-top: 1px solid var(--line-soft); }
.uiv2-preview-link { color: var(--accent-ink); font-weight: 600; }
.uiv2-preview-reset { border: none; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 12px; }
.uiv2-preview-reset:hover { color: var(--ink); }
