/* ANPAssetDesk 화면 공통 스타일 */
:root {
  --row-gap: 12px;   /* 본문 덩어리 사이(제목 줄 → 띠 → 조작 줄 → 표 → 쪽 넘김, 카드·묶음 사이) */
  --sub-gap: 8px;    /* 소제목 아래 */
  --bar-gap: 8px;    /* 검색·필터·도구 줄과 단추 묶음 안의 칸과 칸 사이(가로) */
  --tree-indent: 18px; /* 트리 목록 한 단계 들여쓰기(부서·위치·AD 부서 트리 모두). 단계 수는 줄의 --depth */
  color-scheme: light;       /* 날짜·숫자 입력칸, 선택 목록, 스크롤 막대를 밝은 모양으로 */
  --brand: #f26e21;          /* 올넷피아 주황 */
  --brand-dark: #b8480f;     /* 주황 글자(링크·선택된 메뉴). 옅은 주황 바탕에서도 대비 4.5:1 이상. 어두운 화면에서는 밝은 주황 */
  --brand-fill: #c24e0e;     /* 흰 글자를 얹는 주황 채움(단추·선택된 칩·메뉴). 흰 글자 대비 4.5:1 이상 */
  --brand-hover: #a3410b;    /* 주황 채움에 마우스를 올렸을 때 */
  --brand-soft: #fef0e5;

  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-input: #808a9c;   /* 입력칸·고르기 칸 테두리. 바탕(흰색·옅은 회색)과 대비 3:1 이상 */

  --text: #0f172a;
  --text-muted: #5f6e82;     /* 흐린 글자. 흰색·옅은 회색 바탕에서 대비 4.5:1 이상 */
  --text-soft: #94a3b8;      /* 꾸밈 아이콘·테두리용. 글자와 조작 요소에는 쓰지 않는다(대비 부족) */

  --topbar: #0f172a;
  --topbar-text: #f1f5f9;
  --topbar-sub: #94a3b8;

  --brand-text: #b8480f;     /* 흰 바탕 위 주황 글자(대비 확보) */

  /* 상태색: 글자·아이콘(--x), 진한 채움(--x-fill, 위 글자는 --on-fill), 옅은 바탕(--x-soft). 글자와 그 바탕은 대비 4.5:1 이상 */
  --on-fill: #ffffff;
  --ok: #15803d;      --ok-fill: #198754;      --ok-soft: #dcfce7;
  --warn: #b45309;    --warn-fill: #b45309;    --warn-soft: #fef3c7;
  --danger: #b91c1c;  --danger-fill: #dc3545;  --danger-soft: #fee2e2;  --danger-faint: #fff5f5;
  --info: #1d4ed8;    --info-fill: #2563eb;    --info-soft: #dbeafe;
  --teal: #0e7490;    --teal-fill: #0e7490;
  --rose: #be185d;    --rose-fill: #be185d;    --rose-soft: #fce7f3;
  --muted-fill: #6c757d;
  --neutral-fill: #4b5563;
  --dark-fill: #212529; --on-dark-fill: #ffffff;
  --highlight: #fffbeb;      /* 고정 글·편집 중인 줄 */
  --toast-bg: #0f172a;
  --success: var(--ok);
  --warning: var(--warn);

  --focus-ring: #b8480f;     /* 초점 링·초점 테두리. 흰색·옅은 회색 바탕에서 대비 3:1 이상 */
  --focus-soft: rgba(242, 110, 33, .25);
  --header-h: 60px;          /* 메뉴가 한 줄인 상단 막대 높이(header min-height, 아래 테두리 포함) */

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .12);
}

/* 다크 모드: 시스템 설정을 따른다 */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;      /* 날짜·숫자 입력칸, 선택 목록, 스크롤 막대를 어두운 모양으로 */
    --bg: #0b1220;
    --surface: #111827;
    --surface-2: #1f2937;
    --border: #334155;
    --border-strong: #475569;
    --border-input: #64748b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-soft: #64748b;
    --topbar: #0b1220;
    --topbar-text: #f1f5f9;
    --topbar-sub: #94a3b8;
    --brand-dark: #fb923c;
    --brand-soft: #3a2010;
    --brand-text: #fb923c;
    --ok: #4ade80;      --ok-fill: #15803d;      --ok-soft: #0f2e1c;
    --warn: #fbbf24;    --warn-fill: #b45309;    --warn-soft: #3a2a0a;
    --danger: #f87171;  --danger-fill: #b91c1c;  --danger-soft: #3b1414;  --danger-faint: #2a1414;
    --info: #60a5fa;    --info-fill: #2563eb;    --info-soft: #172a4a;
    --teal: #22d3ee;    --teal-fill: #0e7490;
    --rose: #f472b6;    --rose-fill: #9d174d;    --rose-soft: #3b1328;
    --muted-fill: #4b5563;
    --neutral-fill: #374151;
    --dark-fill: #d1d5db; --on-dark-fill: #111827;
    --highlight: #2a2410;
    --toast-bg: #334155;
    --focus-ring: #fb923c;
    --focus-soft: rgba(251, 146, 60, .25);
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
  }
}

/* 반응형: 좁은 화면에서는 글자를 줄이고 표는 가로로 스크롤한다 */
@media (max-width: 900px) {
  .pane table { font-size: 0.85em; }
  main { padding: 10px; }
  .toolbar { flex-wrap: wrap; }
}
.pane table { width: 100%; }
.pane { overflow-x: auto; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  /* 한국어는 낱말 중간에서 줄을 바꾸지 않는다(긴 영문·숫자만 칸 끝에서 끊는다) */
  word-break: keep-all;
  overflow-wrap: break-word;
  font-family: "Pretendard Variable", "Pretendard", -apple-system,
    "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.err { color: var(--danger); min-height: 1.1em; margin: 6px 0; font-size: 0.9em; }
.muted { color: var(--text-muted); font-size: 0.9em; }

/* 뱃지 공통(활동 로그 동작·상태) */
.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 999px; font-size: 0.78em; font-weight: 600;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border);
}
td.nowrap { white-space: nowrap; }

/* 활동 로그: 날짜 묶음 제목, 한 줄 = 시각·사람·메뉴·한 일(문장 + 바뀐 값 + 덧붙임)·IP, 누르면 접속 정보가 펼쳐진다 */
.audit-table { width: 100%; }
.audit-table th:nth-child(1) { width: 80px; }
.audit-table th:nth-child(2) { width: 150px; }
.audit-table th:nth-child(3) { width: 100px; }
.audit-table th:nth-child(5) { width: 120px; }
.audit-table td { vertical-align: top; }
.audit-day td { background: var(--surface-2); color: var(--text-muted); font-weight: 700; font-size: 0.85em; padding: 6px 10px; }
.audit-row { cursor: pointer; }
.audit-row:hover td, .audit-row.open td { background: var(--brand-soft); }
.audit-row.failed td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.audit-time { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.audit-row button.audit-toggle, .audit-row button.audit-toggle:hover { min-height: 0; padding: 0; border: 0; border-radius: 2px; background: none; color: inherit; font: inherit; cursor: pointer; }
.audit-menu { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-muted); font-size: 0.85em; font-weight: 600; }
.audit-text { display: flex; align-items: baseline; gap: 6px; line-height: 1.5; }
.audit-text b { color: var(--text); }
.audit-fail { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.audit-changes { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px; font-size: 0.88em; }
.chg { display: inline-flex; align-items: baseline; gap: 5px; }
.chg .icon { font-size: 0.8em; color: var(--text-soft); }
.chg-label { color: var(--text-muted); }
.chg-label::after { content: ":"; }
.chg-old { color: var(--text-muted); text-decoration: line-through; }
.chg-new { font-weight: 600; color: var(--text); }
.audit-notes { margin-top: 2px; font-size: 0.85em; color: var(--text-muted); }
.audit-more { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 0.85em; }
.audit-more dt { color: var(--text-muted); }
.audit-more dd { margin: 0; word-break: break-all; }
.audit-ip { font-size: 0.85em; }
.audit-period { display: flex; align-items: center; gap: 6px; }
.audit-period input { width: 150px; }
select.audit-user { width: auto; max-width: 220px; }

/* 넓은 창(ui/Modal.tsx wide) */
.modal.modal-wide {
  max-width: 1100px; width: 92vw;
}
.asset-modal { width: 100%; }
.asset-tabs {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); padding-bottom: 0; margin-bottom: var(--row-gap);
}
.asset-tabs .atab {
  background: transparent; border: none; padding: 6px 16px;
  color: var(--text-muted); font-weight: 500; cursor: pointer;
  border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px;
}
.asset-tabs .atab.active {
  color: var(--brand-text); border-bottom-color: var(--brand);
}
.asset-tab-actions { margin-left: auto; display: flex; gap: var(--bar-gap); }
.asset-view {
  max-height: 65vh; overflow-y: auto; padding-right: 6px;
}
.asset-loading, .asset-empty {
  padding: 40px; text-align: center; color: var(--text-muted);
}
.asset-meta {
  margin-top: var(--row-gap); font-size: 0.8em; color: var(--text-muted);
  text-align: right;
}

/* 자산 등록·수정·보기 폼 */
.ae-box {
  margin: 0 0 var(--row-gap); min-width: 0; padding: 8px 14px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.ae-box legend { padding: 0 6px; font-size: 0.9em; font-weight: 600; color: var(--text-muted); }
.ae-box-act { display: flex; justify-content: flex-end; gap: var(--bar-gap); margin-top: var(--sub-gap); }
.af-pair { display: flex; gap: 6px; min-width: 0; }
.af-pair > * { flex: 1 1 0; min-width: 0; }
.ae-pc { font-size: 0.9em; line-height: 1.5; min-height: 1.5em; }
.ae-pc-warn { color: var(--warning); font-size: 0.9em; margin-top: 2px; }
.pc-asset-actions { margin-top: var(--row-gap); text-align: right; }
.hist-table td { vertical-align: top; }
.hist-table tr.hist-first td { border-top: 1px solid var(--border-strong); }
.hist-old { color: var(--text-muted); text-decoration: line-through; word-break: break-all; }
.hist-new { font-weight: 500; word-break: break-all; }

/* 드래그로 순서 바꾸기 */
.drag-item { cursor: grab; }
.drag-item.dragging { opacity: .45; background: var(--brand-soft); }
.drag-item input, .drag-item button, .drag-item label { cursor: auto; }
.drag-item button { cursor: pointer; }

/* 목록 페이지 이동 */
.pager {
  display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap;
  gap: 6px; margin-top: var(--row-gap); font-size: 0.9em;
  font-variant-numeric: tabular-nums;
}
.pager button { padding: 3px 10px; min-width: 32px; min-height: 28px; }
.pager button:disabled { opacity: .4; cursor: default; }
.pager .pager-input { width: 64px; height: 28px; padding: 3px 6px; text-align: center; }
.pager .pager-size { width: auto; height: 28px; padding: 3px 6px; }
.pager .pager-range { margin: 0 6px 0 10px; }

/* 부서 트리 */
.assets-layout { display: flex; gap: 16px; align-items: flex-start; }
.assets-main { flex: 1; min-width: 0; overflow-x: auto; }
#assets-table th, #assets-table td { white-space: nowrap; }
/* 부서 경로: 표 칸 안에서 자르지 않고 줄을 바꾼다 */
.dept-path { display: inline-block; min-width: 120px; max-width: 260px; white-space: normal; overflow-wrap: anywhere; }
.dept-side {
  flex: 0 0 200px; position: sticky; top: 0;
  max-height: calc(100vh - 140px); overflow: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.dept-side-head {
  padding: 8px 16px 2px; font-size: 0.75em; font-weight: 700; color: var(--text-muted); letter-spacing: .04em;
  border-top: 1px solid var(--border);
}
@media (max-width: 900px) {
  .assets-layout { flex-direction: column; }
  /* 세로로 쌓이면 본문이 내용 폭만큼 넓어지지 않게 화면 폭에 맞춘다(넓은 표는 본문 안에서 밀린다) */
  .assets-layout > .assets-main { width: 100%; }
  .dept-side { position: static; width: 100%; flex: none; max-height: 240px; }
}
/* 자산 관리 왼쪽 메뉴(부서 트리 위) */
.side-menu { display: flex; flex-direction: column; padding: 6px; border-bottom: 1px solid var(--border); }
.side-menu-group { display: flex; flex-direction: column; }
.side-menu-group + .side-menu-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.side-menu button, .side-menu a { display: flex; align-items: center; gap: 8px; min-height: 32px; border: none; background: none; color: var(--text); text-align: left; text-decoration: none; padding: 6px 10px; border-radius: var(--radius-sm); white-space: nowrap; font-size: 13px; }
.side-menu button .icon, .side-menu a .icon { color: var(--text-soft); font-size: 1.05em; }
.side-menu button:hover, .side-menu a:hover { background: var(--surface-2); }
.side-menu button.active, .side-menu a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.side-menu button.active .icon, .side-menu a.active .icon { color: var(--brand); }
.dept-tree { padding: 4px 0; font-size: 13px; }
.dtree { list-style: none; margin: 0; padding: 0 0 0 var(--tree-indent); }
/* 맨 위 부서는 들여 쓰지 않는다(접기 단추가 위 메뉴 아이콘과 같은 세로줄). '전체'는 접기 칸 없이 아이콘이 위 메뉴 아이콘과 같은 세로줄에 온다 */
.dept-tree > div > .dtree { padding-left: 0; }
.dept-tree .dall { margin-left: 10px; }
.dnode { display: flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 6px 0 0; border-radius: var(--radius-sm); }
.dnode:hover { background: var(--surface-2); }
.dnode.selected > .dname { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
/* 부서·분류·제품명 트리의 접기·펼치기 단추(24×24, WCAG 2.2 2.5.8). 하위가 없는 줄은 같은 크기의 빈칸(.leaf). '.dept-manage .dnode button' 보다 앞서게 .dtree 를 붙인다 */
.dtree .dnode > .dtog { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; min-height: 24px; flex: 0 0 24px; padding: 0; text-align: center; cursor: pointer; color: var(--text-muted); user-select: none; }
.dtree .dnode > .dtog.leaf { cursor: default; }
/* 긴 부서 이름은 자르지 않고 줄을 바꾼다 */
.dname { flex: 1; min-width: 0; padding: 4px 6px; border-radius: var(--radius-sm); cursor: pointer; overflow-wrap: anywhere; }
.dname .icon { margin-right: 5px; font-size: 0.9em; color: var(--text-soft); }
.dnode.selected > .dname .icon { color: var(--brand); }
.dused { font-size: 0.78em; flex: 0 0 auto; }
.dept-manage .dnode button { padding: 2px 8px; font-size: 0.8em; flex: 0 0 auto; }
.dept-manage .dnode button:disabled { opacity: .35; cursor: default; }
.dept-empty { padding: 8px 16px; font-size: 0.85em; }
.dept-hint button { padding: 2px 10px; font-size: 0.9em; }
.dept-hint { padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }

/* 자산 등록창의 부서 선택 */
.dept-pick { position: relative; min-width: 0; }
.dept-pick .af-pair > button { flex: 0 0 auto; padding: 4px 10px; }
.dept-pick #af-dept:not(:disabled) { cursor: pointer; }
.dept-pop {
  position: absolute; z-index: 10; left: 0; top: calc(100% + 4px);
  width: max(100%, 320px); max-width: 80vw;
  max-height: 280px; overflow: auto; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}

/* 위치 고르기(폴더 트리가 열리는 칸) */
.loc-pick { position: relative; min-width: 0; }
.loc-pick-btn { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; min-height: 32px; padding: 4px 8px;
  background: var(--surface); border: 1px solid var(--border-input); border-radius: var(--radius-sm); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.loc-pick-btn.empty .loc-pick-text { color: var(--text-muted); }
.loc-pick-btn[aria-invalid="true"] { border-color: var(--danger); }
.loc-pick-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.loc-pick-btn .icon { color: var(--text-muted); font-size: 0.8em; flex: none; }
/* 위치 고르기 창: 화면 맨 위 층(칸에 잘리지 않음), 위에 검색칸 고정, 아래 목록만 스크롤 */
.loc-pop { position: fixed; z-index: 1000; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); overflow: hidden; }
.loc-pop-search { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--border); color: var(--text-soft); }
.loc-pop-search input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]) { flex: 1; height: 28px; border: none; box-shadow: none; padding: 0; background: transparent; }
.loc-pop-list { flex: 1; min-height: 0; overflow: auto; padding: 4px; }
.loc-hit.active { background: var(--surface-2); }
.loc-hit-path { overflow-wrap: anywhere; }
.loc-opt-row { display: flex; align-items: center; padding-left: calc(4px + var(--tree-indent) * var(--depth, 0)); }
.loc-twisty { width: 24px; flex: 0 0 24px; min-height: 24px; padding: 2px; }
.loc-opt { flex: 1; display: flex; align-items: center; gap: 6px; padding: 4px 6px; border: none; background: none; text-align: left; border-radius: 4px; color: var(--text); font: inherit; cursor: pointer; }
.loc-opt:hover:not(:disabled) { background: var(--surface-2); }
.loc-opt.selected { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.loc-opt:disabled { color: var(--text-muted); cursor: default; }
.loc-opt .bi-folder2, .loc-opt .bi-folder2-open { color: #c9a227; }
.loc-empty { padding: 6px 8px; }

/* AD 부서 선택 창: 위쪽 검색칸 고정, 검색 결과는 이름 + 상위 경로 */
.dept-pop-search { position: sticky; top: 0; z-index: 1; padding: 6px; background: var(--surface); border-bottom: 1px solid var(--border); }
.dept-pop-search input { width: 100%; }
.dept-hits { list-style: none; margin: 0; padding: 4px; }
.dept-hits button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 4px 8px; border: none; background: none; text-align: left; }
.dept-hits button:hover, .dept-hits button.selected { background: var(--brand-soft); }
.dept-hits .muted { font-size: 0.85em; }

/* 자산 일괄 편집: 왼쪽 체크(바꿀 항목), 오른쪽 값. 체크한 줄은 강조 */
.be-grid { display: grid; gap: 6px; }
.be-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; align-items: center; padding: 4px 6px; border-radius: var(--radius-sm); }
.be-row.on { background: var(--brand-soft); }
.be-row select, .be-row input:not([type=checkbox]), .be-row textarea { width: 100%; }
@media (max-width: 600px) { .be-row { grid-template-columns: 1fr; } }

/* 자산 관리: 목록(코드) 관리 */
.code-add { display: flex; gap: var(--bar-gap); margin-bottom: var(--row-gap); }
.code-add input { flex: 1; min-width: 0; }
.code-list {
  max-height: 55vh; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
/* 페이지로 열 때는 화면 높이에 맞춰 길게 */
.code-list.page { max-height: calc(100vh - 290px); }
.code-row {
  display: flex; align-items: center; gap: 6px; min-height: 36px;
  padding: 2px 8px; border-bottom: 1px solid var(--border);
}
.code-row:last-child { border-bottom: none; }
.code-empty { padding: 8px 2px; }
/* 빈 목록 안내의 둘째 줄(ui/TableState.tsx EmptyText) */
.empty-hint { display: block; }
.code-row:hover { background: var(--surface-2); }
.code-row .code-name, .code-row .code-edit { flex: 1; min-width: 0; }
.code-row .code-edit { padding: 4px 8px; }
/* 구분선 줄: 가로선 위에 제목(있으면)을 얹는다 */
.code-row.code-header { background: var(--surface-2); }
.code-divider { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 0.85em; font-weight: 700; }
.code-divider::before, .code-divider::after { content: ""; flex: 1; border-top: 2px solid var(--border-strong); }
.code-divider::before { flex: 0 0 16px; }
.code-divider:empty { gap: 0; }
.code-row button { padding: 3px 9px; font-size: 0.85em; }
.code-row button:disabled { opacity: .35; cursor: default; }
.modal label.cc-name {
  display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer;
  color: var(--text); font-size: 0.95em; font-weight: 400;
}
.cc-check { width: 16px; height: 16px; flex: 0 0 auto; margin: 0; accent-color: var(--brand); }
.code-used { min-width: 64px; text-align: right; font-size: 0.8em; }

/* 하드웨어 정보 카드 */
.hw-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .hw-grid { grid-template-columns: 1fr 1fr; } }
.hw-grid .hw-disks, .hw-grid .hw-memory, .hw-grid .hw-pci,
.hw-grid .hw-usb, .hw-grid .hw-monitors { grid-column: 1 / -1; }
.hw-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
}
.hw-card h4 {
  margin: 0 0 var(--sub-gap); font-size: 0.85em; font-weight: 600;
  color: var(--brand-text); letter-spacing: 0.3px; text-transform: uppercase;
}

/* 이름-값 목록(OS/BIOS/보드/네트워크/GPU/TPM) */
dl.kv {
  display: grid; grid-template-columns: 120px 1fr;
  gap: 4px 12px; margin: 0 0 10px; font-size: 0.88em;
}
dl.kv dt { color: var(--text-muted); font-weight: 500; }
dl.kv dd { margin: 0; color: var(--text); word-break: break-all; }
dl.kv + dl.kv { border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 10px; }

/* 카드 안의 작은 표 */
table.mini {
  width: 100%; border-collapse: collapse; font-size: 0.84em;
  background: var(--surface);
}
table.mini th {
  text-align: left; padding: 6px 8px; background: var(--surface-2);
  color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border);
}
table.mini td {
  padding: 6px 8px; border-bottom: 1px solid var(--border);
}
table.mini tr:last-child td { border-bottom: none; }
table.mini td.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.9em; }

.mem-summary {
  background: var(--brand-soft); color: var(--brand-dark);
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-weight: 500; margin-bottom: 10px; font-size: 0.9em;
}
.disk-sub {
  font-size: 0.78em; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 10px 0 4px;
}
.bar {
  width: 80px; height: 6px; background: var(--surface-2);
  border-radius: 3px; overflow: hidden;
}
.bar-fill { height: 100%; background: var(--brand); border-radius: 3px; }

/* 소프트웨어 */
.sw-wrap { display: flex; flex-direction: column; gap: 10px; }
.sw-toolbar { margin: 0; }
.sw-table th:nth-child(1) { width: 50%; }

/* 빈 상태 */
tr.empty td {
  text-align: center; padding: 24px 12px; color: var(--text-muted);
  font-size: 0.95em; background: var(--surface-2);
}
/* 받은 줄 위에 두는 StaleNote 줄: 빈 상태 칸의 여백·가운데 정렬을 쓰지 않는다 */
tr.empty.stale td { text-align: left; padding: 6px; background: transparent; font-size: inherit; }
tr.empty.stale .callout { margin: 0; }

/* 알림(토스트) */
#toast-wrap {
  position: fixed; top: 20px; right: 20px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--toast-bg); color: var(--on-fill); font-size: 0.9em;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateX(100%);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: auto; max-width: 360px;
  display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-error { background: var(--danger-fill); }
.toast-success { background: var(--ok-fill); }
.toast-warning { background: var(--warn-fill); }
.toast-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast button { flex: none; min-height: 24px; padding: 2px 8px; background: transparent; color: inherit; border-color: rgba(255, 255, 255, .45); }
.toast button:hover { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .7); }
.toast .toast-action { font-weight: 700; }
.toast .toast-close { min-width: 24px; padding: 2px 4px; border-color: transparent; }
/* 원격 연결 기다림(직원 동의 대기·연결 중, pages/agents/remoteControl.tsx) */
#rc-wait-wrap {
  position: fixed; bottom: 20px; right: 20px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}

/* 공통 폼 */
input, select {
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
/* 한 줄 입력칸·선택칸은 종류(예: 날짜·선택)와 관계없이 단추와 같은 높이 */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]), select { height: 32px; box-sizing: border-box; }
/* 파일 고르기 칸: 브라우저 기본 단추 대신 화면의 기본 단추 모양 */
input[type="file"] { padding: 3px; }
input[type="file"]::file-selector-button {
  font: inherit; font-size: 13px; margin-right: 8px; padding: 3px 10px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text);
}
input[type="file"]::file-selector-button:hover { border-color: var(--text-soft); }
input:focus, select:focus, textarea:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px var(--focus-soft);
}

/* 단추 */
button {
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  min-height: 32px;
}
button:hover { background: var(--surface-2); border-color: var(--text-soft); }
button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; }

/* 처리 중 단추: 라벨은 그대로, 앞에 작은 회전 표시 */
button.busy { position: relative; cursor: progress; opacity: 1; }
button.busy::before {
  content: ""; display: inline-block; width: 0.9em; height: 0.9em; margin-right: 6px; vertical-align: -0.12em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* 움직임 줄이기 설정: 회전 표시는 느리게, 알림 밀려 들어오기·단추 눌림 이동은 끈다(창 나타나기는 모달 규칙 아래) */
@media (prefers-reduced-motion: reduce) {
  button.busy::before { animation-duration: 2s; }
  .toast { transition: none; transform: none; }
  button:active { transform: none; }
}

/* 키보드 초점 표시(모든 단추·링크·입력칸·초점 가능한 요소에 같은 링) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible, [tabindex]:focus-visible, [contenteditable="true"]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
/* 입력칸은 주황 테두리 + 옅은 띠(input:focus 규칙)가 초점 링이다 */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
.modal:focus, .modal:focus-visible { outline: none; }
header :focus-visible { outline-color: var(--topbar-text); }
/* Windows 고대비(forced-colors)는 box-shadow 를 지우므로, 테두리·띠로 보이던 입력칸 초점을 outline 으로 되살린다 */
@media (forced-colors: active) {
  input:focus-visible, select:focus-visible, textarea:focus-visible, .search-box:focus-within, .bd-editor:focus-within, .bd-color:focus-within { outline: 2px solid Highlight; outline-offset: 1px; }
}

/* 본문으로 건너뛰기(ui/SkipLink.tsx): 키보드 초점이 갈 때만 왼쪽 위에 보인다 */
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 3000; background: var(--surface); color: var(--text); }
.skip-link:focus, .skip-link:focus-visible { top: 8px; }
main:focus { outline: none; }
/* 화면 읽기 프로그램에만 읽히는 글 */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* 넓은 표의 칸 안에서는 제자리(표 오른쪽 끝)에 두면 스크롤 틀 밖 문서를 넓혀 좁은 화면에 가로 스크롤이 생기므로 왼쪽 위에 둔다 */
td .sr-only, th .sr-only { top: 0; left: 0; }

/* 고정폭 숫자(숫자·날짜 비교 칸) */
.tnum { font-variant-numeric: tabular-nums; }

/* 공용 Field: 라벨(필수 * · 도움말 아이콘) + 입력칸 + 오류 */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
/* 라벨 줄: 라벨과 그 옆 도움말 아이콘(아이콘은 라벨 밖에 있어 입력칸 이름에 들어가지 않는다) */
.field-label { display: flex; align-items: center; gap: 4px; min-width: 0; }
.field-label > label, .modal .field-label > label { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 0.85em; font-weight: 600; color: var(--text-muted); }
.field-label > .field-help { font-size: 0.85em; }
.field-label > label .req { margin-left: 1px; }
/* 도움말 아이콘. 말풍선(.help-tip)은 HelpTip 이 body 에 고정 위치로 띄운다 */
.field-help { display: inline-flex; color: var(--text-muted); cursor: help; border-radius: 50%; }
.field-help:hover, .field-help:focus-visible, .field-help.on { color: var(--brand); }
.help-tip {
  position: fixed; left: 0; top: 0; z-index: 2100; visibility: hidden;
  width: max-content; max-width: min(280px, calc(100vw - 16px)); padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--toast-bg); color: var(--on-fill); font-size: 12px; font-weight: 400; line-height: 1.45;
  white-space: normal; overflow-wrap: anywhere; box-shadow: var(--shadow-lg);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field-error { font-size: 0.82em; color: var(--danger); }
.field-hint { font-size: 0.82em; color: var(--text-muted); }
#login-form .field-error { margin-top: 4px; }
#login-form input[aria-invalid="true"] { border-color: var(--danger); }
.req-note { margin: 8px 0 0; font-size: 0.82em; }
/* 창 안 입력칸 묶음 아래의 설명 글 */
.modal-note { margin: var(--row-gap) 0 0; }
/* 비밀번호 칸(ui/PasswordInput.tsx): 칸 오른쪽 안에 '입력한 글자 보기' 단추 */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap > input { width: 100%; padding-right: 36px; }
.pw-wrap > .pw-toggle { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); min-width: 28px; min-height: 28px; padding: 2px 6px; border-color: transparent; background: transparent; color: var(--text-muted); }
.pw-wrap > .pw-toggle:hover { color: var(--text); }

/* 표 상태 줄(불러오는 중·오류·빈 목록) */
.table-state { display: flex; flex-direction: column; align-items: center; gap: 10px; }

button.primary {
  background: var(--brand-fill);
  color: var(--on-fill);
  border-color: var(--brand-fill);
}
button.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

button.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
button.ghost:hover { color: var(--text); background: var(--surface-2); }


/* 로그인 페이지 */

#login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr minmax(0, 420px) 1fr;
  align-items: center;
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--brand) 8%, transparent), transparent 55%),
    radial-gradient(circle at 80% 70%, color-mix(in srgb, var(--ok) 8%, transparent), transparent 55%),
    var(--bg);
}

#login-form {
  grid-column: 2;
  background: var(--surface);
  padding: 40px 36px 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

#login-form .brand-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
#login-form .brand-wrap h1 {
  margin: 0;
  font-size: 1.9em;
  font-weight: 700;
  color: var(--brand-text);
  letter-spacing: -0.02em;
}
#login-form .brand-wrap .sub {
  font-size: 0.9em; color: var(--text-muted);
}
/* 회사 로고: 폼 아래에 작고 흐리게 */
#login-form .login-foot {
  margin-top: 24px;
  text-align: center;
  opacity: 0.5;
}
#login-form .login-foot img { height: 18px; width: auto; }

#login-form label {
  display: block;
  margin: 12px 0 5px;
  font-size: 0.85em;
  font-weight: 500;
  color: var(--text-muted);
}

#login-form button {
  margin-top: 20px;
  width: 100%;
  padding: 11px;
  font-size: 1em;
  font-weight: 600;
}
/* 휴대폰 폭: 로그인 상자 바깥 여백과 안쪽 여백을 줄여 화면 안에 들어오게 한다 */
@media (max-width: 600px) {
  #login-page { padding: 16px; }
  #login-form { padding: 28px 20px 24px; }
}


/* 메인 레이아웃 */

#main-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--topbar);
  color: var(--topbar-text);
  padding: 0 24px;
  height: var(--header-h);
  border-bottom: 3px solid var(--brand);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
header .brand .brand-title {
  margin: 0;
  font-size: 1.15em;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--topbar-text);
}
/* 회사 로고: 헤더 오른쪽 끝에 작고 흐리게 */
header .corp-logo {
  height: 15px;
  width: auto;
  opacity: 0.55;
  margin-left: 14px;
}

header nav {
  flex: 1;
  display: flex;
  gap: 4px;
  margin-left: 20px;
}
header nav button, header nav > a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--topbar-sub);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
}
header nav button:hover, header nav > a:hover { background: rgba(255, 255, 255, .07); color: var(--topbar-text); }
header nav button.active, header nav > a.active {
  background: var(--brand-fill);
  color: var(--on-fill);
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--topbar-text);
}
.user-box #me-label {
  font-size: 0.9em;
  color: var(--topbar-sub);
  padding-right: 10px;
  border-right: 1px solid rgba(255, 255, 255, .12);
}
.user-box button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .18);
  color: var(--topbar-sub);
  font-size: 0.85em;
  padding: 6px 11px;
}
.user-box button:hover {
  background: rgba(255, 255, 255, .07);
  color: var(--topbar-text);
  border-color: rgba(255, 255, 255, .3);
}

main {
  padding: 16px 20px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

/* 화면 영역·카드 */
.pane {
  background: var(--surface);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* 도구 막대 */
.toolbar {
  display: flex;
  gap: var(--bar-gap);
  align-items: center;
  margin-bottom: var(--row-gap);
  flex-wrap: wrap;
}
.toolbar input:not([type]) {
  min-width: 300px;
  max-width: 420px;
  flex: 1;
}
.toolbar select { width: auto; max-width: 220px; flex: 0 1 auto; }
/* 자산 목록 도구 막대: 윗줄은 검색·필터(왼쪽)와 컬럼 설정·새로고침·등록(오른쪽), 아랫줄은 고른 자산에 쓰는 단추(왼쪽)와 건수·엑셀(오른쪽) */
.toolbar.asset-toolbar { margin-bottom: var(--row-gap); }
.toolbar.asset-toolbar input:not([type]) { flex: 2 1 320px; min-width: 240px; max-width: 560px; }
.toolbar.asset-toolbar select { max-width: 150px; }
.toolbar.asset-toolbar .loc-pick { width: 190px; }
.toolbar.asset-toolbar button, .toolbar .nowrap { white-space: nowrap; flex: 0 0 auto; }
.toolbar.sel-bar { margin-bottom: var(--row-gap); }
.toolbar-gap { flex: 1 0 0; }
.toolbar.asset-toolbar .search-box { flex: 1 1 360px; max-width: none; }
.toolbar label {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-muted); font-size: 0.9em;
  white-space: nowrap;
  flex: 0 0 auto;
  cursor: pointer;
}
.toolbar label input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}

/* 표 */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}
th, td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.88em;
  letter-spacing: 0;
  white-space: nowrap;
}
tbody tr { transition: background .1s; }
/* 표 머리 고정: 표를 감싼 .table-scroll 안에서 세로로 밀어도 머리줄이 남는다 */
.table-scroll { overflow: auto; max-height: calc(100vh - var(--header-h) - 120px); }
.st-card .table-scroll, .modal .table-scroll { max-height: none; }
.table-scroll thead th, table.inv-table thead th, #assets-table thead th, table.audit-table thead th, table.sortable thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2);
}
td.date, td.time, td.tnum, .inv-table td.num { font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--surface-2); }

.actions { white-space: nowrap; }
.actions button {
  padding: 5px 11px;
  font-size: 0.85em;
  margin: 0 2px;
}

/* 상태 표시 */
.online-dot, .offline-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  vertical-align: middle;
}
.online-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent);
}
.offline-dot {
  background: var(--text-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-soft) 18%, transparent);
}

/* 모달 */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
  display: flex; justify-content: center; align-items: center;
  z-index: 1000;
  animation: fadeIn .14s ease-out;
}
/* 다시 로그인 창: 자리를 비운 PC 에서 아래 화면(예: 장애 내용·연락처)이 비치지 않게 바탕색으로 덮는다 */
.modal-backdrop.opaque { background: var(--bg); backdrop-filter: none; animation: none; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .modal-backdrop { animation: none; } }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  min-width: 460px;
  max-width: 860px;
  max-height: 85vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
/* 좁은 화면에서는 창이 화면 밖으로 나가지 않게 한다. 위 .modal 의 폭 규칙을 덮으려고 그 뒤에 둔다 */
@media (max-width: 900px) { .modal { max-width: 95vw; } }
@media (max-width: 600px) { .modal { min-width: 0; } }
.modal h3 { margin: 0 0 16px; font-size: 1.05em; font-weight: 600; }
/* 창 안 소제목: 위 --row-gap, 아래 --sub-gap(묶음의 첫 소제목은 위 여백 없음). :where 로 낮춰 카드 머리(예: .hw-card h4) 규칙이 이긴다. */
:where(.modal) h4 { margin: var(--row-gap) 0 var(--sub-gap); font-size: 0.95em; }
:where(.modal) h4:first-child { margin-top: 0; }
.modal label { display: block; margin: 10px 0 5px; font-size: 0.85em; color: var(--text-muted); font-weight: 500; }
.modal label.check-row {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px; cursor: pointer;
  color: var(--text); font-size: 0.95em; font-weight: 400;
}
.modal label.check-row input[type="checkbox"] {
  margin: 0; flex: 0 0 auto;
  width: 16px; height: 16px; accent-color: var(--brand);
}
.modal .row {
  display: flex; gap: var(--bar-gap); justify-content: flex-end;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border);
}
.modal .row button.cancel { background: var(--surface-2); }
.confirm-msg { margin: 8px 0 4px; font-size: 0.95em; }

/* 원격 연결 방식 선택 */
.rc-mode { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.rc-mode-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  width: 100%; text-align: left; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); cursor: pointer;
}
.rc-mode-btn:hover { border-color: var(--brand); }
.rc-mode-btn b { font-size: 0.98em; font-weight: 600; }
.rc-mode-btn span { font-size: 0.82em; color: var(--text-muted); }
.rc-mode-btn.danger { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.rc-mode-btn.danger:hover { border-color: var(--danger); }
.rc-mode-btn.danger b { color: var(--danger); }
button.danger {
  background: var(--danger-fill); color: var(--on-fill); border-color: var(--danger-fill);
}
button.danger:hover { filter: brightness(0.92); }

/* 정렬 가능한 헤더 */
table.sortable th.sort-asc::after { content: " ▲"; font-size: 0.7em; color: var(--brand); }
table.sortable th.sort-desc::after { content: " ▼"; font-size: 0.7em; color: var(--brand); }

/* 창 폭이 1400px 이상이면 표 글자를 0.9em 에서 0.92em 으로 키운다 */
@media (min-width: 1400px) {
  table { font-size: 0.92em; }
}

/* 재고 관리 */
/* 왼쪽 메뉴 폭은 모든 화면에서 같다(자산 관리의 부서 트리 옆 메뉴 포함) */
.inv-side {
  flex: 0 0 200px; position: sticky; top: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.inv-side-group { display: flex; flex-direction: column; padding: 6px; border-bottom: 1px solid var(--border); }
.inv-side-group:last-child { border-bottom: none; }
.inv-side-label { padding: 4px 10px 2px; font-size: 0.75em; font-weight: 700; color: var(--text-muted); letter-spacing: .04em; }
.inv-side button, .inv-side a { display: flex; align-items: center; gap: 8px; min-height: 32px; border: none; background: none; color: var(--text); text-align: left; text-decoration: none; padding: 6px 10px; border-radius: var(--radius-sm); font-size: 13px; }
.inv-side button .icon, .inv-side a .icon { color: var(--text-soft); font-size: 1.05em; }
.inv-side button.active .icon, .inv-side a.active .icon { color: var(--brand); }
.inv-side button:hover, .inv-side a:hover { background: var(--surface-2); }
.inv-side button.active, .inv-side a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
@media (max-width: 900px) { .inv-side { position: static; flex-basis: auto; width: 100%; } }
td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.num.over { color: var(--danger); font-weight: 600; }
.inv-lines { width: 100%; margin-bottom: 8px; }
.inv-lines select { width: 100%; min-width: 120px; }
.inv-lines input.qty { width: 90px; }
.bulk-result { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.bulk-result ul { margin: 6px 0 0; padding-left: 18px; max-height: 240px; overflow: auto; color: var(--danger); }
.bulk-result ul.bulk-warn { color: var(--warning); }
.code-row.inactive .code-name { color: var(--text-muted); text-decoration: line-through; }
.code-row select { padding: 3px 6px; font-size: 0.85em; width: auto; max-width: 160px; }
.code-add select { width: auto; flex: 0 0 180px; }
.code-add button { flex: none; white-space: nowrap; }
/* 추가 칸 앞의 칸 이름: 다른 칸 라벨과 같은 모양 */
.code-add-label { flex: none; font-size: 0.85em; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
button.ghost.off { color: var(--warning); text-decoration: line-through; }
.badge.ship-배송중 { background: var(--warn-soft); color: var(--warn); }
.badge.ship-배송완료 { background: var(--ok-soft); color: var(--ok); }
.badge.ship-반송완료 { background: var(--surface-2); color: var(--text-muted); }

i.icon { display: inline-block; line-height: 1; flex: none; }
i.icon::before { vertical-align: -0.125em; }
button .icon { margin-right: 2px; }
.inv-head { display: flex; align-items: center; justify-content: space-between; gap: var(--row-gap); margin: 0 0 var(--row-gap); min-height: 34px; }
.inv-head h2 { margin: 0; font-size: 1.15em; display: flex; align-items: center; gap: 8px; }
.inv-head-actions { display: flex; align-items: center; gap: var(--bar-gap); flex-wrap: wrap; }
.inv-head-actions button { white-space: nowrap; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bar-gap); margin-bottom: var(--row-gap); }
.search-box { flex: 1 1 260px; max-width: 420px; display: flex; align-items: center; gap: 6px; padding: 0 6px 0 10px; border: 1px solid var(--border-input); border-radius: 8px; background: var(--surface); color: var(--text-soft); }
.search-box input { flex: 1; width: auto; height: 30px; border: none; outline: none; box-shadow: none; background: transparent; padding: 0; min-width: 0; color: var(--text); }
.search-box input:focus, .search-box input:focus-visible { outline: none; box-shadow: none; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box:focus-within { border-color: var(--focus-ring); box-shadow: 0 0 0 3px var(--focus-soft); }
.search-box button { padding: 2px 4px; }
.chips { display: inline-flex; flex-wrap: wrap; max-width: 100%; align-items: center; gap: 4px; padding: 2px; min-height: 32px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.chips-label { padding: 0 6px 0 4px; font-size: 0.8em; font-weight: 600; color: var(--text-muted); }
.chips select, .chips input[type=date] { padding: 2px 6px; width: auto; height: 26px; min-height: 0; }
.chips .loc-pick-btn { height: 26px; min-height: 0; padding: 2px 6px; }
/* 묶음 안 글자 입력칸은 이름·도움말과 한 줄에 놓이게 폭을 정한다(100% 면 줄이 바뀌어 쌓인다) */
.chips input:not([type]), .chips input[type=text] { padding: 2px 6px; height: 26px; min-height: 0; width: 200px; max-width: 100%; }
.chips > span { white-space: nowrap; flex: none; }
.chip { border: 1px solid transparent; background: var(--surface-2); color: var(--text-muted); padding: 2px 10px; border-radius: 6px; font-size: 0.85em; font-weight: 600; white-space: nowrap; }
.chip:hover { background: var(--border); color: var(--text); }
.chip.active { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--on-fill); }
/* 칩 안 건수: 흐리게 하되 글자 대비 4.5 이상(투명도로 흐리게 하지 않고 글자색으로) */
.chip .cnt, .item-cell .cnt { margin-left: 6px; font-size: 0.8em; color: var(--text-muted); }
.chip.active .cnt { color: inherit; }
.chip:hover:not(.active) .cnt { color: var(--text); }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: var(--row-gap); background: var(--surface); }
.item-cell { display: flex; align-items: center; justify-content: space-between; border: none; border-radius: 0; box-shadow: inset -1px -1px 0 var(--border); background: var(--surface); padding: 7px 10px; font-size: 0.85em; font-weight: 600; color: var(--text); text-align: left; }
.item-cell:hover { background: var(--brand-soft); color: var(--brand-dark); }
.item-cell.all { background: var(--surface-2); }
.item-cell.empty { color: var(--text-muted); }
.item-cell.active { background: var(--topbar); color: var(--topbar-text); }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: var(--row-gap); font-size: 0.85em; }
.af-chip { min-height: 24px; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); border: 1px solid transparent; font-size: 1em; }
.list-count { font-size: 0.85em; margin: 0 0 var(--row-gap); }
th.num { text-align: right; }
.inv-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 12px 14px; margin-bottom: var(--row-gap); }
.inv-card-head { font-weight: 700; margin-bottom: var(--sub-gap); display: flex; gap: 8px; align-items: baseline; }
.inv-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.inv-field { display: flex; flex-direction: column; gap: 4px; }
.inv-field.wide { grid-column: 1 / -1; }
.inv-field label { font-size: 0.85em; font-weight: 600; color: var(--text-muted); }
.inv-field input, .inv-field select { width: 100%; }
.icon-btn { padding: 3px 6px; }
.add-line { margin-top: 2px; color: var(--brand-dark); }
@media (max-width: 700px) { .inv-fields { grid-template-columns: 1fr; } }
.code-list-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 0.85em; }
.code-list-head select, .code-list-head input { width: auto; padding: 3px 6px; }
.code-list-head input { flex: 1; min-width: 0; }
.danger-text { color: var(--danger); }
.danger-text:hover { background: var(--danger-soft); color: var(--danger); }
.badge.late { background: var(--warn-soft); color: var(--warn); }
td.qty-low b { color: var(--warning); }
td.qty-zero b { color: var(--text-muted); font-weight: 500; }
tr:has(+ tr.same-doc) td { border-bottom-color: transparent; }
.bulk-steps { margin: 0 0 10px; padding-left: 20px; line-height: 1.8; }

/* 저장매체 관리 */
.link-btn { border: none; background: none; padding: 0; color: var(--brand-dark); text-decoration: underline; text-underline-offset: 2px; font: inherit; cursor: pointer; }
.link-btn:hover { background: none; color: var(--brand-dark); }
/* 단추 모양 링크: 다른 화면으로 옮겨 가는 동작(Ctrl+누르기로 새 탭) */
a.btn-link { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 5px 12px; box-sizing: border-box; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 13px; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
a.btn-link:hover { background: var(--surface-2); border-color: var(--text-soft); }
td.tags .tag { display: inline-block; margin-right: 3px; padding: 0 6px; border-radius: 4px; font-size: 0.75em; font-weight: 700; background: var(--surface-2); color: var(--text-muted); }
td.tags .tag.defense { background: var(--ok-soft); color: var(--ok); }
td.tags .tag.retired { background: var(--rose-soft); color: var(--rose); }
/* 긴 메모는 자르지 않고 칸 안에서 줄을 바꾼다 */
td.note-cell { min-width: 160px; max-width: 320px; white-space: normal; overflow-wrap: anywhere; }
td.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.9em; }
th.sel, td.sel { width: 32px; text-align: center; }
th.sel input, td.sel input { width: auto; }
.check-row-inline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 38px; }
/* 입력칸 줄에 놓인 체크(라벨 없는 칸): 위 라벨 줄만큼 내려 입력칸과 같은 높이에 둔다 */
.st-grid > .check-row-inline { align-self: end; min-height: 32px; }
.check-chip { display: inline-flex !important; align-items: center; gap: 6px; margin: 0 !important; font-weight: 600; color: var(--text) !important; font-size: 0.95em !important; }
.check-chip input { width: auto; }
.row-actions { display: flex; gap: var(--bar-gap); }

/* 저장매체 관리대장 */
/* 상태 뱃지 */
.st-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.85em; font-weight: 600; color: var(--on-fill); white-space: nowrap; background: var(--muted-fill); }
.st-badge.big { font-size: 1.45em; padding: 3px 14px; }
.st-badge.s-use { background: var(--info-fill); }
.st-badge.s-bad { background: var(--danger-fill); }
.st-badge.s-keep { background: var(--warn-fill); }
.st-badge.s-return { background: var(--neutral-fill); }
.st-badge.s-disposed { background: var(--dark-fill); color: var(--on-dark-fill); }
/* 방산·퇴사·삭제 표시 */
.defense-badge, .retired-badge, .del-badge { display: inline-block; margin-right: 4px; padding: 0 5px; border-radius: 3px; font-size: 0.72em; font-weight: 600; color: var(--on-fill); vertical-align: 1px; }
.defense-badge { background: var(--ok-fill); }
.retired-badge { background: var(--rose-fill); }
.del-badge { background: var(--danger-fill); }
/* 종류 색 */
.cat-badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 0.82em; font-weight: 600; color: var(--on-fill); white-space: nowrap; }
.cat-badge.c-primary { background: var(--info-fill); } .cat-badge.c-success { background: var(--ok-fill); } .cat-badge.c-warning { background: var(--warn-fill); }
.cat-badge.c-danger { background: var(--danger-fill); } .cat-badge.c-info { background: var(--teal-fill); } .cat-badge.c-secondary { background: var(--muted-fill); } .cat-badge.c-dark { background: var(--dark-fill); color: var(--on-dark-fill); }
.cat-icon.c-primary { color: var(--info); } .cat-icon.c-success { color: var(--ok); } .cat-icon.c-warning { color: var(--warn); }
.cat-icon.c-danger { color: var(--danger); } .cat-icon.c-info { color: var(--teal); } .cat-icon.c-secondary { color: var(--text-muted); } .cat-icon.c-dark { color: var(--text); }
.t-defense { color: var(--ok); } .t-green { color: var(--ok); } .t-retired { color: var(--rose); }
/* 대시보드 */
.st-totals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--row-gap); margin-bottom: var(--row-gap); }
.st-total { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 10px; text-align: center; }
.st-total .n { font-size: 2em; font-weight: 700; line-height: 1.2; }
.st-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: var(--row-gap); overflow: hidden; }
.st-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 14px; min-height: 40px; border-bottom: 1px solid var(--border); font-weight: 700; }
.st-card-head > button { margin-left: auto; }
.st-card-row { display: flex; gap: 10px; padding: 12px 14px; overflow-x: auto; }
.st-card .table-scroll { margin: 0; border: none; border-radius: 0; }
/* 설명·추가 칸·목록을 바로 담는 카드(설정 → 공통 업무 분류): 안쪽 여백을 두고 머리줄만 끝까지 편다. */
.wc-card { padding: 0 14px 14px; }
.wc-card > .st-card-head { margin: 0 -14px 10px; }
.st-tile { flex: 1 0 auto; min-width: 195px; display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); text-align: left; font: inherit; color: inherit; }
button.st-tile.click { cursor: pointer; }
button.st-tile.click:hover { background: var(--surface-2); border-color: var(--brand); }
.st-tile-main { flex: 0 0 78px; text-align: center; }
.st-tile-main .cat-icon { font-size: 1.7em; }
.st-tile-num { font-size: 1.6em; font-weight: 700; line-height: 1.2; }
.st-tile-label { margin-top: 4px; font-size: 0.85em; font-weight: 700; }
.st-tile-pct { margin-top: 2px; font-weight: 700; color: var(--text-muted); }
.st-tile-break { flex: 1; min-width: 0; padding-left: 12px; border-left: 1px solid var(--border); font-size: 0.85em; line-height: 1.65; color: var(--text-muted); }
.st-tile-break div { display: flex; justify-content: space-between; gap: 8px; }
.st-tile-break b { color: var(--text); }
tr.click-row { cursor: pointer; }
.keep-total { margin-bottom: var(--row-gap); font-weight: 700; }
.keep-cat { margin-bottom: var(--row-gap); }
.keep-cat-head { display: flex; align-items: center; gap: 8px; padding-bottom: 4px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.keep-cat-head .muted { margin-left: auto; }
/* 표 */
td.center, th.center { text-align: center; }
tr.inactive td { background: var(--surface-2); }
button.sm-outline { min-height: 24px; min-width: 24px; padding: 1px 7px; font-size: 0.85em; background: transparent; }
.primary-text { color: var(--brand-text); } .success-text { color: var(--ok); }
button.icon-act.primary-text { color: var(--text-muted); }
button.icon-act.primary-text:hover { color: var(--brand-dark); }
button.success { background: var(--ok-fill); border-color: var(--ok-fill); color: var(--on-fill); }
button.success:hover { filter: brightness(0.92); background: var(--ok-fill); }
button.success-outline { color: var(--ok); border-color: var(--ok); background: transparent; }
button.primary-outline { color: var(--brand-text); border-color: var(--brand); background: transparent; }
button.danger-outline { color: var(--danger); border-color: var(--danger); background: transparent; }
.field-badge { display: inline-block; padding: 1px 7px; border-radius: 4px; background: var(--muted-fill); color: var(--on-fill); font-size: 0.82em; font-weight: 600; }
td.hist-old { color: var(--danger); }
td.hist-new { color: var(--success); font-weight: 700; }
.link-btn.bold { font-weight: 700; text-decoration: none; }
.st-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 14px; margin-bottom: var(--row-gap); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.st-summary.deleted { border-color: var(--danger); }
.push-right { margin-left: auto; }
/* 등록·수정 폼 */
.st-form { max-width: 900px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.st-form-body { padding: 16px; }
.st-form label { display: block; margin-bottom: 4px; font-weight: 700; font-size: 0.92em; }
.req { color: var(--danger); }
.opt { color: var(--text-muted); font-weight: 400; font-size: 0.88em; }
.st-no { color: var(--brand-text); }
.st-no.big { font-size: 1.25em; font-weight: 700; }
.st-box { padding: 12px 14px; margin-bottom: var(--row-gap); border: 1px solid var(--border); border-radius: 8px; }
.st-box.gray { background: var(--surface-2); }
.st-box-title { font-weight: 700; margin-bottom: var(--sub-gap); }
.st-no-line { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
/* 관리번호 칸: [코드] [번호] [방산망] [결과] 를 한 줄로. 칸(.field)은 칸 이름·입력칸·안내·오류 네 줄을 바깥 격자의 줄(subgrid)로 써서,
   방산망 스위치와 결과는 칸 이름 줄 높이(도움말 아이콘 포함)와 상관없이 입력칸 줄에 놓이고 세로 가운데가 입력칸과 같다 */
.st-no-fields { display: grid; grid-template-columns: 120px 160px auto 1fr; grid-template-rows: repeat(4, auto); gap: 0 16px; align-items: start; }
.st-no-fields > .field { grid-row: 1 / span 4; display: grid; grid-template-rows: subgrid; }
.st-no-fields > .field > .field-label { margin-bottom: 4px; }
.st-no-fields > .field > .field-hint, .st-no-fields > .field > .field-error { margin-top: 4px; }
.st-no-fields #mf-prefix { font-weight: 700; }
.st-no-flag, .st-no-result { grid-row: 2; align-self: stretch; display: flex; align-items: center; }
@media (max-width: 700px) {
  .st-no-fields { grid-template-columns: 1fr 1fr; grid-template-rows: none; gap: 6px 16px; }
  .st-no-fields > .field { grid-row: auto; display: flex; }
  .st-no-flag, .st-no-result { grid-row: auto; min-height: 32px; }
}
.accent { color: var(--brand-text); }
.switch-row { display: inline-flex !important; align-items: center; gap: 8px; margin: 0 !important; cursor: pointer; font-weight: 400 !important; }
.switch-row input { width: 34px; height: 18px; margin: 0; accent-color: var(--brand); }
.st-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 16px; }
.st-grid label { display: block; margin-bottom: 4px; }
.st-grid .c4 { grid-column: span 4; } .st-grid .c6 { grid-column: span 6; } .st-grid .c12 { grid-column: 1 / -1; }
.st-grid .mt { margin-top: 4px; }
.st-sub { margin-top: 10px; }
.st-sub label { font-weight: 400; font-size: 0.85em; }
.w-date { max-width: 200px; }
.st-form hr { margin: 16px 0; border: none; border-top: 1px solid var(--border); }
@media (max-width: 900px) {
  .st-grid .c4, .st-grid .c6 { grid-column: 1 / -1; }
}
@media print {
  header, .inv-side, .dept-side, .side-menu, #toast-wrap, #rc-wait-wrap, .skip-link, .no-print { display: none !important; }
  .pane { overflow: visible; }
  .assets-layout { display: block; }
  .assets-main { width: 100%; overflow: visible; }
  /* 화면용 스크롤 틀·고정 머리줄을 풀어 표 전체가 종이 폭에 맞게 나온다 */
  .table-scroll { overflow: visible !important; max-height: none !important; }
  .table-scroll thead th { position: static !important; }
  .st-print table.inv-table { width: 100%; border-collapse: collapse; font-size: 9pt; }
  .st-print table.inv-table th, .st-print table.inv-table td { white-space: normal !important; word-break: keep-all; overflow-wrap: anywhere;
    padding: 3px 4px !important; border: 1px solid #888; color: #000; background: #fff !important; vertical-align: middle; }
  .st-print table.inv-table tr { break-inside: avoid; }
}
@page { size: A4 landscape; margin: 10mm; }
.inv-side button, .inv-side a { white-space: nowrap; }
.st-form textarea { width: 100%; }
.switch-row input[role="switch"] { appearance: none; -webkit-appearance: none; position: relative; flex: 0 0 34px; width: 34px; height: 18px; padding: 0; border: 1px solid var(--border-input); border-radius: 999px; background: var(--surface-2); cursor: pointer; transition: background .15s, border-color .15s; }
.switch-row input[role="switch"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-soft); transition: left .15s, background .15s; }
.switch-row input[role="switch"]:checked { background: var(--brand-fill); border-color: var(--brand-fill); }
.switch-row input[role="switch"]:checked::after { left: 18px; background: var(--on-fill); }
.st-table td.hist-old { text-decoration: none; }
.st-table .link-btn { color: var(--brand-text); }
.st-form.in-modal { max-width: none; border: none; background: none; }
.st-form.in-modal .st-form-body { padding: 0; }
/* 저장매체 종류 관리 */
.cat-add { display: grid; grid-template-columns: 1fr 1fr 1.6fr 1fr 1.2fr auto; gap: 10px; align-items: end; padding: 12px 14px 4px; }
.cat-add label, .cat-edit label { display: block; margin-bottom: 3px; font-size: 0.85em; font-weight: 600; }
.icon-pick { display: flex; align-items: center; gap: 8px; }
.icon-pick select { flex: 1; min-width: 0; }
.icon-preview { font-size: 2em; color: var(--text-muted); flex: none; }
.cat-edit code { padding: 0 4px; border-radius: 3px; background: var(--surface); color: var(--rose); font-size: 0.95em; }
.pfx-badge { display: inline-block; margin: 1px 3px 1px 0; padding: 1px 6px; border-radius: 4px; font-size: 0.8em; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); }
.pfx-badge.default { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-text); }
.cat-icon.big { font-size: 1.75em; vertical-align: middle; }
.warning-text { color: var(--warn); }
.cat-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cat-edit .fld { margin-bottom: 12px; }
.cat-edit .w-num { max-width: 100px; }
.pfx-list { min-height: 120px; padding: 8px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.pfx-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.pfx-row code { flex: 1; font-size: 1em; background: none; color: var(--rose); }
.pfx-add { display: flex; gap: var(--bar-gap); }
.pfx-add input { flex: 1; }
.pfx-add button { white-space: nowrap; }
@media (max-width: 900px) { .cat-add, .cat-edit { grid-template-columns: 1fr; } }
.st-tile-break span { white-space: nowrap; }
button.icon-act, a.icon-act { min-height: 28px; min-width: 28px; padding: 4px 9px; margin: 0 1px; }
/* 링크로 된 줄 단추(다른 화면으로 가는 것)도 단추와 같은 누르는 크기를 쓴다 */
a.icon-act { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; vertical-align: middle; }
button.icon-act .icon, a.icon-act .icon { font-size: 1.35em; vertical-align: middle; }
/* 트리 표의 접기·펼치기 단추(하위가 없는 줄은 같은 폭의 빈칸) */
.tree-toggle { display: inline-block; width: 24px; min-width: 24px; height: 24px; min-height: 24px; padding: 0; border: none; background: none; color: var(--text-muted); font-size: 0.85em; line-height: 24px; text-align: center; vertical-align: middle; }
button.tree-toggle { cursor: pointer; }
button.tree-toggle:hover { background: none; color: var(--brand-dark); }
button.tree-toggle:disabled { cursor: default; }
.st-table table.inv-table td { white-space: nowrap; }
.st-table td.note-cell { white-space: nowrap; }
.st-table td.note-cell, .st-card td.note-cell { max-width: none; overflow: visible; }
.st-tile.col { flex-direction: column; align-items: stretch; gap: 6px; }
.st-tile-title { font-weight: 700; font-size: 0.95em; text-align: center; white-space: nowrap; }
.st-tile-body { display: flex; align-items: center; gap: 8px; }
@media (max-width: 900px) { .st-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 긴 창은 내용만 스크롤되고 아래 단추 줄은 늘 보인다.
   scroll-padding-bottom = 단추 줄이 덮는 높이(위 테두리 1px + 위 여백 14px + 단추 32px)에 여백 17px. Tab 으로 옮긴 칸이 단추 줄 위까지 스크롤된다 */
.modal { scroll-padding-bottom: 64px; }
.modal > .row, .modal > .modal-form > .row { position: sticky; bottom: -22px; margin-bottom: -22px; padding-bottom: 22px; background: var(--surface); z-index: 1; }
/* 저장매체 등록·수정 창: 화면 폼과 같은 글자·간격 */
.modal .st-form label { margin: 0 0 4px; color: var(--text); font-size: 0.92em; font-weight: 700; }
.modal .st-form .st-sub label { font-weight: 400; font-size: 0.85em; }
.modal .st-form label.switch-row { margin: 0; font-weight: 400; font-size: 1em; }
.modal .st-box { margin-bottom: var(--row-gap); }
.modal .cat-edit label { margin: 0 0 4px; color: var(--text); font-weight: 600; }
/* 표가 넓어 가로로 밀어도 동작 단추 칸은 오른쪽에 고정 */
.st-table td.actions, .st-table thead th:last-child { position: sticky; right: 0; background: var(--surface); box-shadow: -6px 0 6px -6px rgba(0, 0, 0, .18); }
.st-table thead th:last-child { background: var(--surface-2); z-index: 3; }

/* 업무 관리 */
.st-grid .c3 { grid-column: span 3; }
.wk-form label { display: block; margin: 0 0 4px; color: var(--text); font-size: 0.9em; font-weight: 600; }
.wk-form textarea { width: 100%; }
.wk-period { display: flex; align-items: center; gap: 6px; }
.wk-period select { width: auto; padding: 5px 8px; }
.wk-period-label { min-width: 96px; text-align: center; }
.wk-table td { vertical-align: top; }
.wk-table td.c-content, .wk-table td.c-remark { min-width: 220px; white-space: normal !important; }
.wk-table td.c-line { white-space: nowrap; }
.wk-text { white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
/* 업무일지 표: 현상 칸의 글자를 누르면 수정 창이 열린다 */
.wk-table .wk-open { color: inherit; text-decoration: none; text-align: left; white-space: pre-wrap; word-break: break-word; }
.wk-table .wk-open:hover { color: var(--brand-dark); text-decoration: underline; }
.wk-kind { font-weight: 700; text-align: center; vertical-align: middle !important; }
.wk-kind.doing { color: var(--info); } .wk-kind.plan { color: var(--warn); }
.wk-stats { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(420px, 2fr); gap: var(--row-gap); align-items: start; }
tr.wk-sum td { font-weight: 700; background: var(--surface-2); }
.wk-detail dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 0 0 8px; }
.wk-detail dt { color: var(--text-muted); } .wk-detail dd { margin: 0; }
.wk-edit-rows input, .wk-edit-rows select { width: 100%; padding: 3px 6px; }
.wk-files { list-style: none; margin: 4px 0; padding: 0; }
.wk-files li { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.w-num { width: 90px !important; }
.img-ph { display: inline-block; background: var(--surface-2); }
/* 게시판 */
.bd-list td.bd-title { display: flex; align-items: center; gap: 6px; white-space: normal !important; }
.bd-thumb { width: 40px; height: 28px; object-fit: cover; border-radius: 3px; border: 1px solid var(--border); flex: none; }
.bd-cc { color: var(--brand-text); font-weight: 700; font-size: 0.9em; }
.bd-new { display: inline-block; padding: 0 5px; border-radius: 3px; background: var(--danger-fill); color: var(--on-fill); font-size: 0.72em; font-weight: 700; }
tr.bd-pinned td { background: var(--highlight); }
.bd-meta { display: flex; flex-wrap: wrap; gap: var(--row-gap); margin: 0 0 var(--row-gap); font-size: 0.9em; }
.bd-content { line-height: 1.6; word-break: break-word; }
.bd-content img { max-width: 100%; height: auto; }
.bd-content table { border-collapse: collapse; }
.bd-content td, .bd-content th { border: 1px solid var(--border-strong); padding: 4px 8px; }
.bd-content blockquote { margin: 6px 0; padding: 4px 12px; border-left: 4px solid var(--border-strong); color: var(--text-muted); }
.bd-content pre { padding: 8px 10px; background: var(--surface-2); border-radius: 6px; overflow-x: auto; }
.bd-view { min-height: 160px; padding: 16px; margin-bottom: var(--row-gap); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.bd-attach { padding: 10px 14px; margin-bottom: var(--row-gap); border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.bd-nav { display: grid; gap: 4px; padding: 8px 14px; margin-bottom: var(--row-gap); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.bd-nav .link-btn { text-decoration: none; }
.bd-comments { padding-bottom: 10px; }
.bd-comment { padding: 8px 14px; border-bottom: 1px solid var(--border); }
.bd-comment .muted { display: flex; align-items: center; gap: 6px; font-size: 0.85em; margin-bottom: 2px; }
.bd-comment-add { display: flex; gap: var(--bar-gap); padding: 10px 14px 0; }
.bd-comment-add textarea { flex: 1; }
.note-hint { margin: 4px 0 0; padding: 0 14px; font-size: 0.85em; color: var(--text-muted); }
.bd-editor { border: 1px solid var(--border-input); border-radius: 8px; overflow: hidden; }
.bd-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.bd-toolbar select { width: auto; padding: 3px 6px; font-size: 0.9em; margin-right: 4px; }
.bd-toolbar .icon-btn { padding: 4px 7px; font-size: 1.05em; }
.bd-color { position: relative; display: inline-flex !important; align-items: center; padding: 4px 7px; margin: 0 !important; cursor: pointer; }
.bd-color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
/* 색 고르기 칸은 보이지 않으므로(opacity 0) 초점 링을 감싼 단추 모양에 그린다 */
.bd-color:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
.bd-edit { min-height: 320px; max-height: 55vh; overflow-y: auto; padding: 12px 14px; outline: none; background: var(--surface); }
.bd-edit:focus-visible { outline: none; }
.bd-editor:focus-within { border-color: var(--focus-ring); box-shadow: 0 0 0 3px var(--focus-soft); }
/* 편집기(Tiptap): 켜진 꾸미기 단추, 고른 그림·표 칸, 목록 안 문단 간격 */
.bd-toolbar .icon-btn.on { background: var(--surface); color: var(--brand-text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.bd-edit img.ProseMirror-selectednode { outline: 2px solid var(--brand); }
.bd-edit .selectedCell { background: var(--highlight); }
.bd-content li > p { margin: 0; }
@media (max-width: 900px) {
  .wk-stats { grid-template-columns: 1fr; }
  .st-grid .c3 { grid-column: 1 / -1; }
}
/* 상단 메뉴: 메뉴 이름은 한 줄로 둔다. 좁은 창의 줄바꿈은 아래쪽 상단 메뉴 규칙이 정한다 */
header nav { min-width: 0; }
header nav button, header nav > a, .user-box, .user-box button, .brand { white-space: nowrap; flex: none; }
/* 뱃지·구분 표시는 줄바꿈하지 않는다 */
.badge, .wk-kind, .cat-badge, .st-badge, .field-badge { white-space: nowrap; }
.wk-period button, .toolbar button, .actions button { white-space: nowrap; }

/* 접수 관리 */
.tab-badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--danger-fill); color: var(--on-fill); font-size: 0.75em; font-weight: 700; line-height: 18px; text-align: center; }
.side-count { margin-left: auto; padding: 0 6px; border-radius: 999px; background: var(--danger-fill); color: var(--on-fill); font-size: 0.75em; font-weight: 700; }
.ic-badge { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 0.82em; font-weight: 600; white-space: nowrap; color: var(--on-fill); background: var(--muted-fill); }
.ic-badge.ic-new { background: var(--danger-fill); } .ic-badge.ic-doing { background: var(--info-fill); } .ic-badge.ic-hold { background: var(--warn-fill); }
.ic-badge.ic-done { background: var(--ok-fill); } .ic-badge.ic-cancel { background: var(--muted-fill); }
.ic-badge.ic-urgent { background: var(--danger-fill); } .ic-badge.ic-high { background: var(--warn-fill); } .ic-badge.ic-normal { background: var(--surface-2); color: var(--text-muted); } .ic-badge.ic-low { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.ic-warn { color: var(--warn); font-weight: 700; white-space: nowrap; }
tr.ic-row-new td { background: var(--danger-faint); }
/* 목록: 요청자가 접수 페이지에서 내용을 덧붙였고 아직 상담원이 이어서 남긴 것이 없는 접수 */
.ic-badge.ic-rq-add { margin-left: 6px; background: var(--warn-soft); color: var(--warn); }
.ic-table td.ic-title { min-width: 220px; white-space: normal !important; }
/* 접수 현황 표의 제목 칸: 띄어 쓰지 않은 긴 낱말도 칸 안에서 줄을 바꿔 카드 밖으로 넘치지 않게 하되, 칸이 한 글자 폭까지 줄지는 않게 */
.inv-table td.ic-title { overflow-wrap: anywhere; min-width: 9em; }
.inv-table td.tree-cell { padding-left: calc(12px + var(--tree-indent) * var(--depth, 0)); }
.ic-link { margin-right: 6px; text-decoration: none; }
.ic-view .ic-head { display: flex; align-items: center; gap: 8px; }
.ic-view .ic-head h4 { margin: 0; font-size: 1.05em; flex: 1; }
.ic-meta { display: grid; grid-template-columns: 90px 1fr; gap: 4px 12px; margin: var(--sub-gap) 0 var(--row-gap); font-size: 0.92em; }
.ic-meta dt { color: var(--text-muted); } .ic-meta dd { margin: 0; }
.ic-content { padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.ic-box { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.ic-box-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; }
.ic-public-note { font-size: 0.85em; font-weight: 400; }
.ic-log { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ic-log-text { flex: 1; min-width: 200px; }
.ic-link-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 220px; overflow-y: auto; }
.ic-link-row { display: flex; gap: 10px; text-align: left; padding: 5px 8px; font-size: 0.9em; background: var(--surface-2); }
.ic-actions { display: flex; align-items: flex-end; gap: var(--bar-gap); flex-wrap: wrap; }
.ic-actions label { display: block; margin: 0 0 3px; font-size: 0.85em; color: var(--text-muted); }
.ic-actions select { width: auto; min-width: 140px; }
.ic-timeline { list-style: none; margin: 0 0 8px; padding: 0; }
.ic-timeline li { display: grid; grid-template-columns: 170px 100px 1fr auto; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--border); font-size: 0.9em; }
.ic-note-btns { display: flex; flex-direction: column; gap: 6px; }
.ic-asset { position: relative; }
.ic-asset-list { position: absolute; z-index: 5; left: 0; right: 0; margin: 2px 0 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px; box-shadow: var(--shadow); }
.ic-asset-list li { padding: 4px 8px; border-radius: 4px; cursor: pointer; }
.ic-asset-list li.on { background: var(--brand-soft); }
/* 장애 현황 */
.ic-period { width: auto; padding: 6px 10px; }
.ic-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--row-gap); margin-bottom: var(--row-gap); }
a.ic-total { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.ic-total:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.ic-total-label { font-size: .85em; color: var(--text-muted); margin-top: 2px; }
a.ic-total:hover .ic-total-label { color: var(--text); }
.st-total.t-bad .n { color: var(--danger); } .st-total.t-ok .n { color: var(--ok); } .st-total.t-warn .n { color: var(--warn); }
.ic-status-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
.ic-days { display: flex; align-items: stretch; gap: 3px; height: 170px; padding: 12px 14px 8px; }
.ic-day { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.ic-day-bar { width: 100%; max-width: 26px; min-height: 0; background: var(--brand); border-radius: 4px 4px 0 0; }
.ic-day:hover .ic-day-bar { background: var(--brand-hover); }
.ic-day-n { font-size: 0.72em; color: var(--text-muted); line-height: 1; }
.ic-day-k { font-size: 0.68em; color: var(--text-muted); white-space: nowrap; }
.ic-days.dense { gap: 1px; overflow: hidden; }
.ic-days.dense .ic-day-bar { border-radius: 1px 1px 0 0; }
.ic-days.dense .ic-day-k { min-height: 1.2em; overflow: visible; }
.ic-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--row-gap); }
.ic-grid2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--row-gap); align-items: start; }
/* 카드 묶음 칸: 카드 사이는 칸 간격(gap), 묶음 아래는 덩어리 사이 간격. 카드 자신의 아래 여백은 두지 않는다 */
.ic-grid3, .ic-grid2 { margin-bottom: var(--row-gap); }
.ic-grid3 > .st-card, .ic-grid2 > .st-card { margin-bottom: 0; }
.ic-bars { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; }
.ic-bar-row { display: grid; grid-template-columns: 70px 1fr 36px; align-items: center; gap: 8px; padding: 4px 6px; border: none; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.ic-bar-row:hover { background: var(--surface-2); }
.ic-bar-label { white-space: nowrap; font-size: 0.9em; }
.ic-bar-track { height: 10px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.ic-bar-fill { display: block; height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; }
.ic-bar-n { text-align: right; }
@media (max-width: 1100px) { .ic-grid3, .ic-grid2 { grid-template-columns: 1fr; } }
/* 상단 이름 = 내 계정 바로가기 */
.user-box .me-link { border: none; border-radius: var(--radius-sm); background: transparent; color: var(--topbar-text); font-size: 14px; font-weight: 600; padding: 6px 8px; text-decoration: none; }
.user-box .me-link:hover, .user-box .me-link.active { background: rgba(255, 255, 255, .1); text-decoration: underline; text-underline-offset: 3px; }
.account-card { max-width: 520px; padding: 12px 14px; }
.account-info { grid-template-columns: 110px 1fr; font-size: 1em; }
.account-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 520px; margin: var(--row-gap) 0 var(--sub-gap); }
.account-card-head h3 { margin: 0; font-size: 1.05em; }
.account-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--bar-gap); max-width: 520px; margin-bottom: var(--row-gap); }

/* 2단계 인증: 로그인 코드 단계, 등록 창(QR·직접 입력 키), 복구 코드 */
#login-form .login-help { margin: 0 0 4px; font-size: 0.9em; color: var(--text-muted); line-height: 1.5; }
#login-form .login-alt { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
#login-form .login-alt button { width: auto; margin: 0; padding: 2px 0; font-size: 0.9em; font-weight: 400; }
#login-form .pw-wrap > .pw-toggle { width: auto; margin: 0; padding: 2px 6px; font-size: 1em; font-weight: 400; }
.otp-input { font-family: Consolas, "D2Coding", monospace; font-size: 1.15em; letter-spacing: 0.3em; }
.otp-input.recovery { letter-spacing: 0.08em; }
.totp-setup { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 20px; align-items: start; }
/* QR 은 어두운 화면에서도 흰 바탕에 검은 칸으로 그려야 인증 앱이 읽는다 */
.totp-qr { display: block; width: 196px; height: 196px; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.totp-steps { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; line-height: 1.5; }
.totp-key { font-family: Consolas, "D2Coding", monospace; font-size: 1em; letter-spacing: 0.06em; overflow-wrap: anywhere; user-select: all; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; margin: 10px 0; padding: 12px 18px;
  list-style: none; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  font-family: Consolas, "D2Coding", monospace; font-size: 1.05em; letter-spacing: 0.04em; }
.recovery-actions { display: flex; flex-wrap: wrap; gap: var(--bar-gap); }
@media (max-width: 600px) { .totp-setup { grid-template-columns: minmax(0, 1fr); } .recovery-codes { grid-template-columns: minmax(0, 1fr); } }

/* 접수 페이지(요청자, portal.html) */
.rq-pane { max-width: 1100px; margin: 0 auto; }
.rq-login-help { margin: 10px 0 0; font-size: 0.85em; text-align: center; }
.rq-form { padding: 16px 18px; }
.rq-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.rq-grid > div { display: flex; flex-direction: column; gap: 4px; }
.rq-grid .w3 { grid-column: 1 / -1; }
.rq-grid label { font-size: 0.85em; color: var(--text-muted); font-weight: 600; }
.rq-grid textarea { resize: vertical; min-height: 140px; }
.rq-files { margin-top: var(--row-gap); padding-top: 10px; border-top: 1px dashed var(--border); }
.rq-files-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rq-files-head button { margin-left: auto; }
.rq-paste-hint { margin: 4px 0 0; }
.rq-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.rq-actions button { min-width: 140px; }
@media (max-width: 700px) { .rq-grid { grid-template-columns: 1fr; } }
/* 요청자에게 '접수' 는 받은 상태일 뿐 문제가 아니므로, 접수 뱃지와 탭의 진행 중 건수는 빨강 대신 파랑 계열로 표시한다 */
.rq-portal .ic-badge.ic-new { background: var(--info-soft); color: var(--info); }
.rq-portal .tab-badge { background: var(--info-fill); }
/* 휴대폰 폭(600px 이하) */
@media (max-width: 600px) {
  /* 상단: 이름·단추가 줄을 바꿔 화면 안에 들어오게 하고, 회사 로고는 숨긴다 */
  .rq-portal header { gap: 6px 10px; padding: 6px 12px; }
  .rq-portal header .user-box { flex: 1 1 auto; flex-wrap: wrap; justify-content: flex-end; min-width: 0; white-space: normal; row-gap: 6px; }
  .rq-portal .user-box #me-label { min-width: 0; overflow-wrap: anywhere; }
  .rq-portal header .corp-logo { display: none; }
  /* 내 접수 내역: 분류·긴급도·처리 완료 칸을 숨겨 제목 옆에 상태가 오게 한다 */
  .rq-portal .rq-col-opt { display: none; }
  .rq-portal .ic-table td.ic-title { min-width: 0; }
  /* 처리 이력(접수 페이지·관리 화면 접수 상세 창): 첫 줄에 일시·종류·처리자, 둘째 줄에 내용 */
  .ic-timeline li { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "time kind user" "text text text"; row-gap: 2px; }
  .ic-timeline li > :nth-child(1) { grid-area: time; }
  .ic-timeline li > :nth-child(2) { grid-area: kind; }
  .ic-timeline li > :nth-child(3) { grid-area: text; }
  .ic-timeline li > :nth-child(4) { grid-area: user; }
}

/* 연동 관리 */
.int-dot { margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 0.85em; background: var(--surface-2); color: var(--text-muted); }
.int-dot.on { background: var(--ok-soft); color: var(--ok); }
.int-body { padding: 12px 14px; }
.int-desc { margin: 0 0 10px; }
.int-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.int-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.int-field.wide { grid-column: 1 / -1; }
.int-field > .field-label > label { font-size: 0.85em; color: var(--text-muted); font-weight: 600; }
.int-hint { font-size: 0.8em; }
.int-field textarea { resize: vertical; }
.mono { font-family: Consolas, "D2Coding", monospace; font-size: 0.92em; }
.int-extra { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 6px; }
.int-extra-head { margin-bottom: 2px; font-size: 0.85em; font-weight: 600; color: var(--text-muted); }
.int-actions { display: flex; justify-content: flex-end; gap: var(--bar-gap); margin-bottom: var(--row-gap); }
.int-test { display: flex; align-items: center; gap: var(--bar-gap); padding: 9px 12px; margin: 0 0 var(--row-gap); border-radius: 8px; border: 1px solid; }
/* 성공 결과는 색 없는 기본 띠(.callout 과 같은 바탕·테두리)다. 색 있는 띠는 경고(노랑)·실패(빨강) 둘뿐이다 */
.int-test.ok { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.int-test.bad { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.int-status { padding: 1px 8px; border-radius: 999px; font-size: 0.85em; background: var(--surface-2); }
.int-status.ok { background: var(--ok-soft); color: var(--ok); }
.int-status.error { background: var(--danger-soft); color: var(--danger); }
.int-status.running { background: var(--info-soft); color: var(--info); }
.int-raw td:first-child { width: 260px; color: var(--text-muted); }
@media (max-width: 1100px) { .int-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .int-grid { grid-template-columns: 1fr; } }
/* 모달 밖 체크 한 줄(예: 연동 관리): 체크박스 + 글자 */
.int-body label.check-row, .inv-head label.check-row { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; font-size: 0.95em; color: var(--text); font-weight: 400; min-height: 36px; }
.int-body label.check-row input[type="checkbox"], .inv-head label.check-row input[type="checkbox"] { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; accent-color: var(--brand); }
/* 상단 메뉴가 많아 좁은 화면(1600px 이하)에서는 메뉴 간격을 줄인다 */
@media (max-width: 1600px) { header { gap: 14px; padding: 0 16px; } header nav { margin-left: 6px; gap: 2px; } header nav button, header nav > a { padding: 8px 9px; } }

/* 재고 사용 등록: 한 줄에 요청 부서·요청자·사용일 */
.inv-fields.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .inv-fields.cols-3 { grid-template-columns: 1fr; } }

/* AD 사람 찾기 입력칸 */
.ad-pick { position: relative; }
.ad-pick-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); max-height: 280px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.ad-pick-list li { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.ad-pick-list li.on { background: var(--brand-soft); }
.ad-pick-list .ad-pick-dept { margin-left: auto; color: var(--text-muted); font-size: 0.9em; white-space: normal; text-align: right; }
.ad-pick-list .ad-pick-empty { cursor: default; white-space: normal; }
.ae-ad-note { margin-top: 4px; font-size: 0.82em; }

/* 상단 메뉴: 창이 좁아도 모두 보이게 줄을 바꾼다(가로 스크롤로 숨기지 않는다). 1250px 이하에서는 메뉴가 둘째 줄 전체를 쓴다 */
header { height: auto; min-height: var(--header-h); flex-wrap: wrap; row-gap: 0; }
header nav { flex-wrap: wrap; overflow: visible; min-width: 0; row-gap: 4px; }
header .user-box { margin-left: auto; }
@media (max-width: 1250px) {
  header nav { order: 3; flex: 1 1 100%; margin-left: 0; padding: 0 0 8px; }
}
/* 관리자 탭의 펼침 메뉴 */
.nav-drop { position: relative; }
.nav-caret { font-size: 0.75em; margin-left: 2px; }
.nav-drop-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 150px; z-index: 60; display: flex; flex-direction: column; gap: 2px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
/* 관리자 머리줄의 '점검 필요' 알림: 단추는 어두운 머리줄 위의 밝은 노랑, 목록은 오른쪽 끝에 맞춰 펼쳐 화면 밖으로 넘치지 않게 한다 */
.user-box .ops-warn-btn { color: #fbbf24; }
.user-box .ops-warn-btn:hover, .user-box .ops-warn-btn:focus-visible { color: #fcd34d; }
.ops-warn-menu { color: var(--text); left: auto; right: 0; width: 360px; max-width: calc(100vw - 32px); max-height: 60vh; overflow-y: auto; }
/* 메뉴가 둘째 줄로 내려가는 폭(1250px 이하)에서는 '점검 필요' 단추가 오른쪽 끝에 있지 않으므로, 알림 목록을 머리줄 오른쪽 여백에 맞춰 머리줄 아래로 펼친다 */
@media (max-width: 1250px) {
  header .nav-drop.ops-warn { position: static; }
  header .ops-warn-menu { top: calc(100% + 4px); right: 16px; }
}
/* 좁은 화면(600px 이하)의 머리줄: 계정 줄이 둘째 줄 전체를 쓰고, '점검 필요'·'도움말'은 아이콘(과 건수)만 보인다(글자는 읽기 프로그램용으로 남김).
   이름이 길면 글자를 자르지 않고 줄을 바꾸고, 회사 로고는 숨긴다. 점검 알림 목록은 머리줄 양쪽 여백에 맞춘다 */
@media (max-width: 600px) {
  header { padding-top: 8px; row-gap: 6px; }
  header .user-box { flex: 1 1 100%; min-width: 0; justify-content: flex-end; gap: 8px; flex-wrap: wrap; white-space: normal; row-gap: 6px; }
  .user-box .hdr-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .user-box .help-link { padding: 6px 8px; min-width: 32px; justify-content: center; }
  .user-box #me-label { min-width: 0; overflow-wrap: anywhere; }
  .user-box .ops-warn-btn .tab-badge { margin-left: 4px; }
  header .ops-warn-menu { left: 16px; width: auto; max-width: none; }
  header .corp-logo { display: none; }
}
.ops-warn-list { list-style: none; margin: 0; padding: 0; }
.ops-warn-item { padding: 8px 12px; font-size: 14px; white-space: normal; }
.ops-warn-item + .ops-warn-item { border-top: 1px solid var(--border); }
header nav .nav-drop-menu a { display: block; color: var(--text); background: none; text-align: left; padding: 8px 12px; border-radius: 6px; white-space: nowrap; font-size: 14px; text-decoration: none; }
header nav .nav-drop-menu a:hover { background: var(--surface-2); color: var(--text); }
header nav .nav-drop-menu a.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

/* EOL 표시 */
.eol-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.85em; white-space: nowrap; background: var(--surface-2); color: var(--text-muted); }
.eol-badge.soon { background: var(--warn-soft); color: var(--warn); }
.eol-badge.past { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.ae-eol { display: flex; align-items: center; flex: none; }
.eol-models { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; margin-top: 6px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.modal .eol-models label.eol-model-row { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 10px; border-radius: 6px; cursor: pointer; color: var(--text); font-size: 0.95em; font-weight: 400; }
.modal .eol-models label.eol-model-row > span:nth-of-type(2) { margin-left: auto; }
.modal .eol-models label.eol-model-row input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--brand); }
.modal .eol-models label.eol-model-row:hover { background: var(--surface-2); }
.modal .eol-models label.eol-model-row.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.modal .eol-models label.eol-model-row.all { border-bottom: 1px solid var(--border); border-radius: 0; font-weight: 600; }
.eol-pending { justify-content: flex-start; }
.eol-pending button { margin-left: auto; }

/* 촘촘한 줄 안의 작은 단추: 누를 면적은 24px 이상, 줄 높이는 그대로 */
.chip, .search-box button, .active-filters button.ghost, .code-row button, .code-list-head button, .dept-manage .dnode button, .dept-hint button { min-height: 24px; }
.link-btn { min-height: 0; }
header .nav-drop-menu :focus-visible { outline-color: var(--focus-ring); }

/* 재고·저장매체 표: 정렬 머리줄 칸의 단추(칸 글자처럼 보이게) */
th > button.th-sort { border: none; background: none; padding: 0; min-height: 0; font: inherit; color: inherit; cursor: pointer; text-align: inherit; white-space: nowrap; }
th > button.th-sort:hover { color: var(--brand-dark); background: none; }

/* 자산·계정·EOL 대화창: 위아래로 쌓은 입력 칸 */
.field-stack { display: grid; gap: 12px 16px; }

/* 동시 수정 충돌 알림(수정 창 맨 위): 문장 + 새로 불러오기 단추 */
.conflict-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: var(--row-gap); border-radius: var(--radius-sm); background: var(--danger-soft); font-size: 0.9em; }
/* 필터 줄 안의 빠른 기간 단추 묶음 */
.chips-quick { display: inline-flex; flex-wrap: wrap; gap: 4px; }
/* 접수 페이지 상단 탭 줄 */
.rq-tabs { display: flex; gap: 4px; }
/* PC 관리 → 등록 토큰 창 */
.reg-settings .reg-section { display: grid; gap: var(--sub-gap); }
.reg-settings .reg-section + .reg-section { padding-top: var(--row-gap); border-top: 1px solid var(--border); }
.modal .reg-settings h4 { margin: 0; }
.reg-settings p { margin: 0; line-height: 1.5; }
.reg-token-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.reg-token-box { display: grid; gap: 8px; }
/* PC 상세 창 아래 줄 왼쪽의 PC 키 상태 */
.modal .row .detail-key { order: -1; margin-right: auto; align-self: center; font-size: 0.9em; }

/* 운영 설정(관리자 → 설정): 설정 한 줄 = 왼쪽 이름·설명, 오른쪽 입력칸 */
.set-group-help { font-weight: 400; margin-left: 4px; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 340px); gap: 8px 24px; align-items: start; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: none; }
.set-row.edited { background: var(--warn-soft); }
.set-label { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-weight: 600; }
.set-help { margin: 4px 0 0; color: var(--text-muted); font-size: 0.9em; }
.set-meta { margin-top: 4px; color: var(--text-muted); font-size: 0.85em; }
.set-control { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.set-control > select, .set-control > input, .set-control > textarea { width: 100%; }
.set-control textarea { resize: vertical; }
.set-input { display: inline-flex; align-items: center; gap: 6px; }
.set-input input[type="number"] { width: 120px; }
.set-options { display: flex; flex-direction: column; }
.set-control label.check-row { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; font-weight: 400; }
.set-control label.check-row input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.set-tag { padding: 0 7px; border-radius: 999px; font-size: 0.8em; font-weight: 600; background: var(--surface-2); color: var(--text-muted); white-space: nowrap; }
.set-tag.on { background: var(--info-soft); color: var(--info); }
.set-tag.warn { background: var(--warn-soft); color: var(--warn); }
.set-reset { font-size: 0.85em; }
/* 백업 복사 폴더 고르기 창 */
.bk-pick { display: grid; gap: 10px; }
.bk-pick-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; font-weight: 600; }
.bk-pick-row select { width: 100%; }
.bk-pick-path { overflow-wrap: anywhere; }
.bk-pick-tools, .bk-pick-new { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bar-gap); }
.bk-pick-new input { width: 220px; max-width: 100%; }
.bk-pick-list { list-style: none; margin: 0; padding: 4px; max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.bk-pick-list li > button { display: block; width: 100%; text-align: left; padding: 6px 8px; border: none; background: none; font: inherit; color: inherit; cursor: pointer; border-radius: 4px; overflow-wrap: anywhere; }
.bk-pick-list li > button:hover, .bk-pick-list li > button:focus-visible { background: var(--surface-2); }
.bk-pick-list li.muted { padding: 6px 8px; }
@media (max-width: 900px) { .set-row { grid-template-columns: 1fr; } }
/* 연동 관리 → 메일 방식·보고서: 단추 여러 개 한 줄 */
.int-btns { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bar-gap); }

/* 끈 기능 안내(layout/Shell.tsx ModuleOff), 도움말(pages/help) */
.module-off { max-width: 640px; margin: 48px auto; padding: 24px; text-align: center; }
.module-off h2 { margin: 0 0 8px; font-size: 1.2em; }

/* 접수 관리(pages/incidents: IncidentExtras·HelpdeskPages·IncidentsPage·Dashboard, portal/PortalExtras) */
.ic-grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1400px) { .ic-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .ic-grid4 { grid-template-columns: 1fr; } }
.ic-due { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ic-dday { font-size: 0.82em; font-weight: 600; padding: 0 6px; border-radius: 4px; background: var(--surface-2); color: var(--text-muted); white-space: nowrap; }
.ic-dday.over { background: var(--danger-soft); color: var(--danger); }
.ic-dday.today { background: var(--warn-soft); color: var(--warn); }
.ic-badge.ic-delay { background: var(--danger-soft); color: var(--danger); }
.ic-badge.ic-public { background: var(--info-soft); color: var(--info); }
.ic-badge.ic-internal { background: var(--surface-2); color: var(--text-muted); border: 1px dashed var(--border-strong); }
.ic-badge.ic-shared { background: var(--ok-soft); color: var(--ok); } .ic-badge.ic-own { background: var(--surface-2); color: var(--text-muted); }
.ic-timeline li.ic-ev-public { border-left: 3px solid var(--info); padding-left: 6px; }
.ic-timeline li.ic-ev-internal { border-left: 3px dashed var(--border-strong); padding-left: 6px; }
.ic-note-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 4px; }
.ic-note-kind > label { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; margin: 0; color: var(--text); font-size: 0.9em; white-space: nowrap; }
.ic-note-kind > label input[type="radio"] { width: auto; height: auto; margin: 0; padding: 0; flex: none; accent-color: var(--brand); }
.ic-note-kind > label.on { border-color: var(--border-strong); background: var(--surface-2); font-weight: 600; }
.ic-note-kind > label.on.public { border-color: var(--info); background: var(--info-soft); color: var(--info); }
.ic-note-label { display: block; padding: 6px 14px 0; font-size: 0.9em; font-weight: 600; color: var(--text); }
.bd-comment-add.ic-note-public textarea { border-color: var(--info); }
.ic-canned { position: relative; margin-left: auto; }
.ic-canned-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 280px; max-height: 320px; overflow: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.ic-canned-list li > button { display: block; width: 100%; text-align: left; padding: 6px 8px; border: 0; background: none; color: var(--text); }
.ic-canned-list li > button:hover, .ic-canned-list li > button:focus-visible { background: var(--surface-2); }
.ic-canned-list li.muted { padding: 6px 8px; }
.ic-canned-body { max-width: 640px; }
.ic-due-actions { margin: 6px 0 10px; }
.ic-due-alert { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 12px; margin-bottom: var(--row-gap); border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--text); }
.ic-due-alert.over { background: var(--danger-soft); }
.ic-due-alert a { margin-left: 4px; }
tr.ic-row-over > td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.ic-rq-pri { font-size: 0.85em; }
.chk { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; }
.ic-issue { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bar-gap); margin-top: var(--sub-gap); } .ic-issue input { width: 120px; }
.rq-notices { display: flex; flex-direction: column; gap: var(--row-gap); margin-bottom: var(--row-gap); }
.rq-notice { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--text); }
.rq-notice > .link-btn { flex: 1; text-align: left; }
.rq-privacy-login { margin-top: 12px; text-align: left; } .rq-privacy-login summary { cursor: pointer; color: var(--text-muted); }
.login-policy { display: inline-block; margin-top: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.rq-privacy-login .wk-text, .rq-privacy-text { max-height: 320px; overflow: auto; padding: 8px 10px; margin-top: 6px; background: var(--surface-2); border-radius: var(--radius-sm); }
.rq-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bar-gap); padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.rq-faq-list { list-style: none; margin: 0; padding: 0; } .rq-faq-list li { padding: 8px 4px; border-bottom: 1px solid var(--border); }
.rq-stars { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.rq-star { display: inline-flex; cursor: pointer; font-size: 1.4em; color: var(--text-muted); }
.rq-star.on { color: var(--warn); }
.rq-star input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rq-star:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }
.rq-wait { font-size: 0.85em; }

/* PC 관리: 에이전트 자동 업데이트 화면 */
.upd-actions { display: flex; flex-wrap: wrap; gap: var(--bar-gap); align-items: center; }
.upd-versions td { vertical-align: middle; }
.callout { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; margin: 0 0 var(--row-gap); background: var(--surface-2); }
.callout.warn { border-color: var(--warn); background: var(--warn-soft); color: var(--text); }
.callout ul { margin: 4px 0 0; padding-left: 18px; }
.pre-line { white-space: pre-line; }
.upd-grid { display: grid; gap: var(--row-gap); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.upd-grid > :nth-child(n+3) { grid-column: 1 / -1; }
@media (max-width: 1100px) { .upd-grid { grid-template-columns: minmax(0, 1fr); } }
.upd-bar { display: inline-block; width: 120px; height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; vertical-align: middle; overflow: hidden; }
.upd-bar > span { display: block; height: 100%; background: var(--brand-fill); }
.upd-pct { margin-left: 8px; }
.upd-target { margin-left: 6px; }
.upd-rings { margin: 0 0 var(--row-gap); padding-left: 20px; display: grid; gap: 6px; }
.upd-rings li { color: var(--text-muted); }
.upd-rings li.on { color: var(--text); }
.upd-rings li[aria-current="step"] b { color: var(--brand-dark); }
.upd-ring-n { display: block; font-size: 0.9em; }
.upd-failed { margin-top: var(--row-gap); }
.upd-failed summary { cursor: pointer; }
/* 카드 머리 아래 글·단추·입력 묶음은 카드 테두리에서 띄운다(표는 테두리까지 채운다) */
.agent-updates .st-card > :not(.st-card-head):not(.table-scroll):not(table) { margin: var(--row-gap) 14px; }
.agent-updates .st-card > table { margin: 0; }
/* 올리기 줄: 파일·메모 칸은 라벨 줄을 위에 맞추고, 올리기 단추는 입력칸과 같은 높이에 둔다(메모 도움말이 아래로 늘어나도 어긋나지 않게) */
.upd-upload { display: grid; gap: 10px 14px; grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) auto; align-items: start; }
.upd-upload-act { display: flex; padding-top: calc(0.85em * 1.5 + 4px); }
.upd-upload .field-error { grid-column: 1 / -1; }
@media (max-width: 760px) { .upd-upload { grid-template-columns: minmax(0, 1fr); } .upd-upload-act { padding-top: 0; } }
.upd-ring-edit { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.upd-ring-edit legend { padding: 0 4px; font-weight: 600; }
/* 업무 관리 → 보고서 */
.rp-group-label { font-size: 0.85em; color: var(--text-muted); font-weight: 600; }
.rp-check-list { display: flex; flex-direction: column; max-height: 168px; overflow: auto; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.rp-check-list label.check-row { min-height: 28px; }
.rp-sections { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rp-section { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.rp-section-no { min-width: 1.6em; text-align: center; font-weight: 700; color: var(--text-muted); }
.rp-section-name { display: flex; flex-direction: column; flex: 1 1 260px; min-width: 200px; }
.rp-section-name .muted { font-size: 0.82em; }
.rp-mini { display: flex; flex-direction: column; gap: 2px; font-size: 0.8em; color: var(--text-muted); font-weight: 600; }
.rp-mini input, .rp-mini select { font-weight: 400; }
.rp-mini input[type="number"] { width: 90px; }
.rp-section-btns { display: flex; gap: 4px; margin-left: auto; }
.rp-preview-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--bar-gap); margin-bottom: var(--row-gap); }
.rp-frame { width: 100%; height: 640px; border: 1px solid var(--border); border-radius: 8px; background: #ffffff; }
.rp-error { font-size: 0.85em; margin-top: 2px; }
.rp-recipients { max-width: 360px; overflow-wrap: anywhere; }

/* 계정: 비밀번호 규칙 목록(pages/account/passwordRules.tsx), 권한 검토(pages/users/AccessReviews.tsx), 감사자 띠(layout/Shell.tsx) */
.pw-rules { list-style: none; margin: -4px 0 4px; padding: 0; font-size: 0.88em; color: var(--text-muted); }
.pw-rules li { display: flex; gap: 6px; align-items: baseline; padding: 1px 0; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.bad { color: var(--danger); }
.section-title { margin: var(--row-gap) 0 var(--sub-gap); font-size: 1.05em; }
.auditor-banner { background: var(--surface-2); color: var(--text); text-align: center; padding: 4px 12px; font-size: 0.9em; border-bottom: 1px solid var(--border); }
/* 감사자(조회만): 화면·창의 쓰기 단추(예: 등록·저장·수정·삭제·복원·엑셀 업로드)를 숨긴다. 쓰기 요청은 서버가 막고, 남겨 둘 단추(예: 본인 계정·내려받기)는 data-read 를 붙인다 */
body.read-only :is(main, .modal) button:is(.primary, .danger, .danger-outline, .danger-text, .primary-text, .success-text, .success-outline, .warning-text):not([data-read]),
body.read-only .modal-form button[type="submit"]:not([data-read]) { display: none; }
.rp-add select { width: auto; min-width: 220px; }
.rp-preview-hint { margin: 0 0 var(--row-gap); font-size: 0.85em; }
.user-box .help-link { display: inline-flex; align-items: center; gap: 4px; border-radius: var(--radius-sm); color: var(--topbar-text); font-size: 13px; padding: 6px 8px; text-decoration: none; white-space: nowrap; }
.user-box .help-link:hover, .user-box .help-link.active { background: rgba(255, 255, 255, .1); text-decoration: underline; text-underline-offset: 3px; }
.help-body { max-width: 820px; line-height: 1.6; }
/* 도움말 본문: 덩어리 사이 --row-gap, 소제목 아래 --sub-gap */
.help-body h3 { margin: var(--row-gap) 0 var(--sub-gap); font-size: 1.05em; }
.help-body h3:first-child { margin-top: 0; }
.help-body h4 { margin: var(--row-gap) 0 var(--sub-gap); font-size: 1em; }
.help-body .help-task > h4:first-child { margin-top: 0; }
.help-body p { margin: 0 0 var(--row-gap); }
.help-body ol, .help-body ul { margin: 0 0 var(--row-gap); padding-left: 22px; }
.help-faq { margin: 0 0 var(--row-gap); }
.help-faq dt { font-weight: 600; margin-top: 8px; }
.help-faq > div:first-child dt { margin-top: 0; }
.help-faq dd { margin: 2px 0 0; color: var(--text); }
.masked-note { margin: 0 0 var(--row-gap); }

/* 활동 로그 무결성 확인(pages/audit/IntegrityDialog.tsx) */
.integrity-status { margin: var(--row-gap) 0; }
.integrity-hash { word-break: break-all; font-size: 0.82em; }

/* 자산 관리: 자산 위치 목록(pages/assets/LocationManager.tsx). 상위 경로는 흐린 글자로 이름 앞에 붙인다 */
.site-list .site-row { gap: 6px; }
.code-row.site-row { padding-left: calc(6px + var(--tree-indent) * var(--depth, 0)); }
.site-row.selected { background: var(--info-soft); }
.site-row .site-twisty { padding: 2px 4px; }
.site-row .site-name { text-align: left; display: inline-flex; align-items: center; gap: 6px; }
.site-row .site-name .icon { color: var(--warning, #c9a227); }
.site-row .site-name .bi-geo-alt { color: var(--text-soft); }
.site-row.inactive .site-name { color: var(--text-muted); }
.site-row .site-twisty { width: 24px; }
.muted-badge { background: var(--surface-2); color: var(--text-muted); font-weight: 400; }
.site-flag { display: inline-flex; align-items: center; gap: 3px; font-size: 0.82em; color: var(--text-muted); white-space: nowrap; }
.code-row .site-flag input { margin: 0; }
/* 좁은 화면: 이름은 한 줄을 다 쓰고 표시·단추는 다음 줄로 */
@media (max-width: 700px) { .site-list .site-row { flex-wrap: wrap; } .site-row .site-name { flex: 1 1 calc(100% - 40px); } }
/* 자산 대시보드(pages/assets/AssetDashboard.tsx) */
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--row-gap); margin-bottom: var(--row-gap); }
.dash-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
a.dash-tile:hover { background: var(--surface-2); }
.dash-tile-n { font-size: 1.5em; font-weight: 700; }
.dash-tile-l { color: var(--text-muted); font-size: 0.88em; }
.dash-tile.warn .dash-tile-n { color: var(--warn); }
.dash-tile.bad .dash-tile-n { color: var(--danger); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--row-gap); }
.dash-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dash-bars li { position: relative; }
.dash-bar-row { display: flex; justify-content: space-between; gap: 8px; color: var(--text); text-decoration: none; position: relative; z-index: 1; padding: 2px 6px; }
a.dash-bar-row:hover { text-decoration: underline; }
.dash-bar-name { overflow-wrap: anywhere; }
.dash-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--info-soft); border-radius: 4px; }
/* 소프트웨어 */
.sw-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--row-gap); }
@media (min-width: 1400px) { .sw-layout:has(.sw-detail) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.sw-detail .inv-card-head { justify-content: space-between; }
.sw-versions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 10px; }
.sw-versions .chip.active .muted { color: var(--on-fill); }
.sw-names { max-height: 200px; overflow: auto; margin: 6px 0; }
tr.selected td { background: var(--info-soft); }
.wrap-anywhere { overflow-wrap: anywhere; }
.st-site { font-size: 0.85em; color: var(--text-muted); }
button.link { color: var(--info); padding: 0; text-align: left; }

/* 접수 관리 화면 */
/* 입력칸 하나에 묶이지 않는 칸 이름(접수 등록의 참고 파일): 다른 칸 라벨과 같은 모양 */
.field-label > .ic-field-label { font-size: 0.85em; font-weight: 600; color: var(--text-muted); }
/* 현황 카드 안이 비었을 때(표의 빈 줄과 같은 모양) */
.ic-card-empty { text-align: center; padding: 32px; color: var(--text-muted); font-size: 0.95em; background: var(--surface-2); }
/* 자산·PC·재고 화면 */
/* 머리 칸 줄바꿈 막기와 내용만큼만 차지하는 칸(예: 번호·수량·날짜) */
th.nowrap { white-space: nowrap; }
th.col-fit, td.col-fit { width: 1%; }
/* 오른쪽으로 붙는 숫자 칸 바로 뒤의 칸은 띄워 열 제목이 붙어 보이지 않게 한다 */
th.num + th, td.num + td { padding-left: 18px; }
/* 재고 등록의 제품 줄: 숫자 칸 머리도 값처럼 오른쪽에 맞춘다 */
.inv-lines th.num { text-align: right; }
/* 두 칸을 차지하는 입력칸(세 칸 격자) */
.inv-field.span-2 { grid-column: span 2; }
@media (max-width: 900px) { .inv-field.span-2 { grid-column: auto; } }
/* 추가 칸 창의 체크(필수·사용): 체크와 이름을 한 줄에, 왼쪽부터 나란히 */
.modal .fd-checks { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 20px; }
.modal .fd-checks label.check-row { margin: 0; }
/* 목록 관리의 추가 줄: 입력칸·추가·도움말을 한 줄 가운데에 맞춘다 */
.code-add { align-items: center; }
.code-add > .field-help { flex: none; }
/* 자산 대시보드: 숫자 칸 5개씩, 분포 카드 4칸(Windows 버전은 두 칸) */
.dash-tiles.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dash-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-grid .dash-card { margin-bottom: 0; }
.dash-grid .dash-card.span-2 { grid-column: span 2; }
@media (max-width: 1400px) { .dash-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .dash-tiles.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .dash-grid.cols-4 { grid-template-columns: minmax(0, 1fr); } .dash-grid .dash-card.span-2 { grid-column: auto; } }

/* 저장매체·업무 화면 */
/* 대시보드 분류별 현황: 카드가 넘치면 다음 줄로 */
.st-card-row.wrap { flex-wrap: wrap; overflow-x: visible; }
/* 종류 관리 새 종류 추가: 색상·필수 안내도 다른 칸과 같은 안쪽 여백 */
.cat-add-foot { padding: 4px 14px 12px; }
.cat-add-label { font-size: 0.85em; font-weight: 600; }
/* 카드 제목 옆 보조 글 */
.st-card-head .st-card-sub { font-weight: 400; font-size: 0.85em; color: var(--text-muted); }
/* 12칸 격자의 9칸 너비 */
.st-grid .c9 { grid-column: span 9; }
@media (max-width: 900px) { .st-grid .c9 { grid-column: 1 / -1; } }
/* 기간 고르기 단추는 선택칸과 같은 높이 */
.wk-period > button { min-height: 32px; }
/* 프로젝트 창: 마지막 칸과 아래 단추 사이 여백 */
.modal .pj-form { padding-bottom: 12px; }
/* 업무공유 글 목록: 번호는 좁게, 제목이 남는 너비를 쓴다 */
.bd-list th.c-no, .bd-list td.c-no { width: 64px; }
.bd-list .bd-title-cell { width: 100%; white-space: normal !important; }
.bd-list .bd-title { display: flex; align-items: center; gap: 6px; }
/* 업체별 공장: 한 칸에 공장 하나 */
.wk-factory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 12px; margin: 0 0 var(--row-gap); }
.wk-factory-item { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 6px 8px; border-radius: 6px; cursor: pointer; word-break: break-word; }
.wk-factory-item:hover { background: var(--surface-2); }
.wk-factory-item input { width: auto; margin: 3px 0 0; flex: none; }

/* 계정·연동·설정 화면 */
/* 알림 띠: 노란 띠(.callout.warn)는 아직 정하지 않은 것·주의, 빨간 띠(.callout.bad)는 실제로 실패한 것 */
.callout.bad { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
table.inv-table th.nowrap { white-space: nowrap; }
/* 여러 줄 입력칸(연동 관리·설정·검토 기록·앱 바뀐 점): 한 줄 입력칸과 같은 테두리·안쪽 여백 */
.int-body textarea, .set-control textarea, textarea.set-textarea {
  box-sizing: border-box; width: 100%; padding: 6px 10px; border: 1px solid var(--border-input); border-radius: var(--radius-sm);
  background: var(--surface); color: inherit; font-size: 13px; line-height: 1.5; resize: vertical;
}
.int-body textarea:not(.mono), .set-control textarea, textarea.set-textarea { font-family: inherit; }
.int-body textarea.int-list { min-height: 32px; }
/* 직원 계정 창: 체크 줄도 다른 칸과 같은 간격 */
.modal .acct-form > label.check-row { margin: 0; }
/* 켜고 끄는 줄: "○○ 사용" 체크 하나와 옆의 흐린 도움말 */
.int-field.int-onoff { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 12px; }
.int-onoff label.check-row span { font-weight: 600; }
/* 보낼 알림: 영역별 묶음을 2~3 칸으로 */
.int-check-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 20px; }
.int-check-group { display: flex; flex-direction: column; min-width: 0; }
.int-check-title { font-size: 0.85em; font-weight: 600; color: var(--text-muted); margin-bottom: 2px; }
.int-check-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 20px; }
/* 감시 지표: 단추는 기본 크기로 한 줄, 새 토큰 칸은 복사 단추와 한 줄 */
.int-field.int-btns { flex-direction: row; }
.int-token { display: flex; gap: var(--bar-gap); }
.int-token input { flex: 1; min-width: 0; }
/* 동기화 칸의 '사용 안 함'은 숫자보다 작게, 흐린 띠로 */
.int-tile-off { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); font-size: 0.45em; font-weight: 600; letter-spacing: 0; vertical-align: middle; }
/* 거르기 줄의 체크 상자 */
.filter-bar label.check-row { display: inline-flex; align-items: center; gap: 6px; margin: 0; cursor: pointer; font-size: 0.95em; font-weight: 400; color: var(--text); }
.filter-bar label.check-row input[type="checkbox"] { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--brand); }
/* 단추가 함께 있는 안내 띠(EOL 등록 안 된 모델, 접수 기한 넘김), 등록 창의 모델 안내 줄, 비고 칸 폭 */
.callout.eol-pending, .callout.has-act { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bar-gap); }
.eol-help { margin: 6px 0 0; overflow-wrap: anywhere; }
table.inv-table th.eol-note-col { width: 35%; }
/* 활동 로그: 모든 줄에 같은 폭의 펼침 표시, 닫힌 줄은 칸을 가운데로 */
.audit-table th:nth-child(1) { width: 104px; }
.audit-chevron { display: inline-block; width: 14px; margin-right: 4px; font-size: 0.8em; color: var(--text-soft); }
.audit-row:not(.open) > td { vertical-align: middle; }
/* 내 계정: 계정 정보·2단계 인증 카드를 넓으면 두 칸, 좁으면 한 칸으로 */
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--row-gap); margin-bottom: var(--row-gap); }
.account-grid .st-card { margin-bottom: 0; }
.account-grid .st-card-head h3 { margin: 0; font-size: 1em; }
.account-body { padding: 12px 14px; }
.account-body .account-actions { justify-content: flex-start; max-width: none; margin: 0; }
.account-page .account-card, .account-page .account-card-head { max-width: none; }
/* 좁은 화면: 화면 제목은 한 줄을 다 쓰고 단추는 그 아래 줄에 놓는다 */
@media (max-width: 700px) {
  .inv-head { flex-wrap: wrap; }
  .inv-head h2 { flex: 1 0 100%; }
  .inv-head-actions { justify-content: flex-start; }
}
/* 재고 제품명 트리: 제품명 줄의 품명·단위 고르기는 좁게, 좁은 화면에서는 이름 아래 줄로 내린다 */
.inv-prod-tree .dnode select { width: auto; max-width: 140px; min-width: 0; padding: 2px 6px; font-size: 0.85em; flex: 0 1 auto; }
.inv-prod-tree .dnode .code-edit { flex: 1; min-width: 0; padding: 2px 6px; }
@media (max-width: 640px) {
  .inv-prod-tree .dnode { flex-wrap: wrap; }
  .inv-prod-tree .dname { flex-basis: calc(100% - 28px); }
}

/* 화면 여백 기준: 제목 아래 설명 문단, 연동 설명은 줄 간격과 같은 아래 여백만 둔다(위 여백 없음) */
.inv-head ~ p.muted, .filter-bar + p.muted, .int-desc { margin: 0 0 var(--row-gap); }
/* 본문의 표·카드·목록 상자 바로 아래 안내 글도 덩어리 사이 간격(--row-gap)만큼 띄운다 */
:is(.assets-main, .pane, [role=tabpanel]) > * + p.muted { margin-top: var(--row-gap); }
/* 소제목 바로 아래 안내 글은 소제목 아래 간격(--sub-gap)만 둔다 */
:is(.account-card-head, .section-title) + p.muted { margin-top: 0; }
.st-card-head > button, .st-card-head > a.btn-link { min-height: 24px; padding: 2px 8px; }
/* 전역 입력칸 높이(32px) 규칙보다 우선: 검색칸 안 입력(테두리 포함 32px)과 필터 상자 안 칸(26px) */
.search-box input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]) { height: 30px; }
.chips input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]) { height: 26px; min-height: 0; }
/* 표 맨 앞의 번호 칸(오른쪽 맞춤 숫자)은 내용 폭만큼만 차지한다(남는 폭이 번호 왼쪽 빈칸으로 생기지 않게) */
th.num:first-child, td.num:first-child { width: 1%; white-space: nowrap; }

/* 목록 상자(끌어 옮기는 목록·트리) 안: 위 추가 줄이 상자 테두리에 붙지 않게, 위아래 줄도 테두리에서 띄운다 */
.code-list.page > .code-add { margin: 4px 8px var(--row-gap); }
/* 쪽 넘김의 쪽 번호 칸: 옆 단추(28px)와 같은 높이(전역 입력칸 32px 규칙보다 우선) */
.pager input.pager-input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]) { height: 28px; }
/* 저장매체 관리번호 줄의 방산망 스위치: 입력칸과 같은 세로 가운데 */
.st-no-flag .switch-row { height: 32px; }
/* 재고 등록의 제품 줄 표: 좁은 화면에서는 이 표만 옆으로 밀린다(화면 전체가 밀리지 않게) */
.inv-lines-scroll { margin: 0; border: none; }
.code-list.page { padding: 6px 0; }
.code-list.page > .dept-tree { padding-left: 6px; padding-right: 6px; }
.item-cell.active .cnt { color: inherit; }
/* 숫자 칸(오른쪽 맞춤)은 내용 폭만큼만 차지하고, 남는 폭은 글자 칸이 쓴다 */
table.inv-table th.num, table.inv-table td.num { width: 1%; }
.inv-lines th.num, .inv-lines td.num { width: 1%; }
/* 누를 수 있는 배지(예: 업무일지의 접수 연결): 누르는 면적 24px 이상 */
a.cat-badge, button.cat-badge { display: inline-flex; align-items: center; min-height: 24px; }
