:root {
  --primary: #2563eb; --primary-d: #1d4ed8; --primary-l: #eff6ff;
  --text: #1f2937; --muted: #6b7280; --line: #e5e7eb; --bg: #f5f6f8; --card: #fff;
  --ok: #16a34a; --ok-l: #dcfce7; --bad: #dc2626; --bad-l: #fee2e2; --warn: #ea580c; --warn-l: #ffedd5;
  --gray-l: #f3f4f6;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Malgun Gothic", "맑은 고딕", -apple-system, "Segoe UI", sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.menu-denied { display: none !important; } /* 관리자가 이 사용자에게 꺼 둔 메뉴 */
/* 식사 신청 */
.meal-info { max-width: 880px; line-height: 1.7; }
.meal-table tr.meal-target td { background: #fffbeb; }
.meal-ask .meal-q { font-size: 18px; margin: 2px 0 6px; }
.meal-ask .meal-btns { display: flex; gap: 10px; margin: 18px 0 10px; }
.meal-ask .meal-btns .btn { flex: 1; justify-content: center; padding: 12px 10px; font-size: 15px; }
.meal-ask .meal-later { text-align: center; }
h2 { font-size: 20px; margin: 0 0 16px; }
h3 { font-size: 15px; margin: 0 0 10px; }
input, select, textarea { font: inherit; color: inherit; padding: 7px 9px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--primary); }
textarea { width: 100%; min-height: 220px; resize: vertical; line-height: 1.6; }
label { display: block; }

/* ---------- 버튼 ---------- */
.btn { display: inline-flex; align-items: center; gap: 4px; padding: 7px 14px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; font: inherit; white-space: nowrap; }
.btn:hover { background: var(--gray-l); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-d); }
.btn.danger { color: var(--bad); border-color: #fca5a5; }
.btn.danger:hover { background: var(--bad-l); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; font: inherit; }
.icon-btn { background: none; border: 0; font-size: 18px; cursor: pointer; position: relative; padding: 6px; }

/* ---------- 로그인 ---------- */
.login-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e3a8a, #2563eb); padding: 16px; }
.login-box { background: #fff; padding: 36px 32px; border-radius: 12px; width: 100%; max-width: 360px; box-shadow: 0 20px 40px rgba(0,0,0,.2); }
.login-box h1 { text-align: center; font-size: 22px; margin: 0 0 24px; }
.login-box label { margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.login-box input { width: 100%; margin-top: 4px; padding: 10px; }
.login-opts { display: flex; justify-content: space-between; gap: 10px; margin: -4px 0 14px; }
.login-opts label { display: inline-flex; align-items: center; gap: 5px; margin: 0; color: var(--text); cursor: pointer; }
.login-opts input { width: auto; margin: 0; padding: 0; }
.error { color: var(--bad); min-height: 20px; margin: 10px 0 0; font-size: 13px; text-align: center; }

/* ---------- 레이아웃 ---------- */
.topbar { height: 52px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 16px; gap: 12px; position: sticky; top: 0; z-index: 20; }
.brand { font-weight: bold; font-size: 17px; color: var(--text); }
.brand:hover { text-decoration: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
/* 위쪽 바로가기 (회사명 오른쪽) */
.brand { white-space: nowrap; flex-shrink: 0; }
.top-tools { display: flex; align-items: center; gap: 2px; margin-left: 18px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.top-tools::-webkit-scrollbar { display: none; }
.tt { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid transparent; border-radius: 7px; background: none;
  color: var(--text); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.tt:hover { background: var(--gray-l); border-color: var(--line); text-decoration: none; }
.tt span { font-size: 14px; line-height: 1; }
.tt em { font-style: normal; }
.tt[hidden] { display: none; }
.tt:disabled { opacity: .35; cursor: default; background: none; border-color: transparent; }
.tt-plus { font-size: 11px; font-weight: bold; color: var(--primary); margin-left: -2px; vertical-align: top; }
.tt-search { display: flex; align-items: center; margin: 0 4px; flex-shrink: 0; }
.tt-search input { width: 190px; padding: 5px 9px; border-radius: 7px 0 0 7px; font-size: 13px; }
.tt-search-btn { padding: 5px 10px; border: 1px solid #d1d5db; border-left: 0; border-radius: 0 7px 7px 0; background: var(--gray-l); cursor: pointer; font-size: 13px; line-height: 1.35; }
.tt-search-btn:hover { background: var(--line); }
.tt-results { position: fixed; z-index: 60; width: 260px; max-height: 60vh; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 4px 0; }
.tt-results a { display: block; padding: 8px 12px; color: var(--text); font-size: 13px; }
.tt-results a:hover, .tt-results a.sel { background: var(--primary-l); text-decoration: none; }.tt-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; flex-shrink: 0; }
@media (max-width: 1400px) { .tt em { display: none; } .tt { padding: 6px 8px; } .tt-search input { width: 150px; } } /* 화면이 좁으면 아이콘만 (마우스를 올리면 이름) */
@media print { .topbar, .sidebar, .bottom-nav, .no-print { display: none !important; } .content { max-width: none; padding: 0; } .card { border: 0; } body { background: #fff; } }
.user-name { color: var(--text); }
.menu-toggle { display: none; }
.layout { display: flex; min-height: calc(100vh - 52px); }
.sidebar { width: 190px; background: #fff; border-right: 1px solid var(--line); padding: 12px 0; flex-shrink: 0; }
.sidebar a, .nav-group { display: flex; align-items: center; gap: 6px; padding: 9px 18px; color: var(--text); }
.sidebar a:hover { background: var(--gray-l); text-decoration: none; }
.sidebar a.active { background: var(--primary-l); color: var(--primary); font-weight: bold; border-right: 3px solid var(--primary); }
.sidebar a.sub { padding-left: 40px; font-size: 13px; }
.nav-group { color: var(--text); }
.content { flex: 1; padding: 24px; min-width: 0; max-width: 1280px; }
.badge { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; text-align: center; font-weight: bold; }
.icon-btn .badge { position: absolute; top: 0; right: -2px; }

/* ---------- 알림 패널 ---------- */
.noti-wrap { position: relative; }
.noti-panel { position: absolute; right: 0; top: 40px; width: 340px; max-height: 440px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.noti-head { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.noti-item { padding: 10px 14px; border-bottom: 1px solid var(--gray-l); cursor: pointer; }
.noti-item:hover { background: var(--gray-l); }
.noti-item.unread { background: var(--primary-l); }
.noti-item .t { font-size: 13px; }
.noti-item .d { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- 카드·표 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid.c3 { grid-template-columns: 2fr 1fr 1fr; }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.stat { font-size: 28px; font-weight: bold; margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.list th { background: #f9fafb; font-weight: normal; color: var(--muted); font-size: 13px; white-space: nowrap; }
table.list tr.clickable { cursor: pointer; }
table.list tr.clickable:hover td { background: #f9fafb; }
table.list td.num, table.list th.num { text-align: center; width: 70px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.table-wrap table.list tr:last-child td { border-bottom: 0; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 16px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { color: var(--primary); border-color: var(--primary); font-weight: bold; }
.pager { display: flex; justify-content: center; gap: 4px; margin-top: 14px; }
.pager button { min-width: 32px; }
.pager button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.list-simple { list-style: none; margin: 0; padding: 0; }
.list-simple li { padding: 7px 0; border-bottom: 1px solid var(--gray-l); display: flex; justify-content: space-between; gap: 8px; }
.list-simple li:last-child { border-bottom: 0; }

/* ---------- 상태 표시 ---------- */
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: var(--gray-l); color: var(--muted); white-space: nowrap; }
.tag.pending { background: var(--primary-l); color: var(--primary); }
.tag.approved { background: var(--ok-l); color: var(--ok); }
.tag.rejected { background: var(--bad-l); color: var(--bad); }
.tag.withdrawn, .tag.skipped, .tag.waiting { background: var(--gray-l); color: var(--muted); }
.tag.late { background: var(--warn-l); color: var(--warn); }

/* ---------- 게시글·문서 보기 ---------- */
.post-head { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 16px; }
.post-head h2 { margin-bottom: 6px; }
.post-body { line-height: 1.8; white-space: pre-wrap; word-break: break-word; min-height: 120px; }
.comments { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.comment { padding: 10px 0; border-bottom: 1px solid var(--gray-l); }
.comment .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.comment .body { white-space: pre-wrap; word-break: break-word; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form input { flex: 1; }
.form-row { display: flex; gap: 12px; margin-bottom: 14px; align-items: flex-start; }
.form-row > .lbl { width: 90px; padding-top: 8px; color: var(--muted); flex-shrink: 0; }
.form-row > .fld { flex: 1; min-width: 0; }
.form-row input[type=text], .form-row input:not([type]), .form-row input[type=tel], .form-row input[type=email], .form-row input[type=url] { width: 100%; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

/* 결재선 칸 */
.sign-line { display: flex; border: 1px solid #9ca3af; width: fit-content; max-width: 100%; overflow-x: auto; margin: 12px 0; }
.sign-cell { width: 110px; border-right: 1px solid #9ca3af; text-align: center; flex-shrink: 0; }
.sign-cell:last-child { border-right: 0; }
.sign-cell .who { background: #f3f4f6; border-bottom: 1px solid #9ca3af; padding: 5px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sign-cell .st { padding: 10px 4px 4px; font-weight: bold; }
.sign-cell .when { font-size: 11px; color: var(--muted); padding-bottom: 6px; min-height: 22px; }
.sign-cell.approved .st { color: var(--ok); }
.sign-cell.rejected .st { color: var(--bad); }
.sign-cell.pending .st { color: var(--primary); }
.line-comments { font-size: 13px; margin: 0 0 12px; padding-left: 18px; }
.leave-box { background: var(--primary-l); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }

/* 결재선 선택 */
.picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.picker .box { border: 1px solid var(--line); border-radius: 8px; height: 280px; overflow-y: auto; padding: 6px; }
.picker .dept { font-weight: bold; padding: 6px 4px 2px; font-size: 13px; }
.picker .person { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 4px 14px; border-radius: 4px; }
.picker .person:hover { background: var(--gray-l); }
.picker .chosen { display: flex; align-items: center; gap: 6px; padding: 6px; border-bottom: 1px solid var(--gray-l); }
.picker .chosen .n { flex: 1; }

/* ---------- 달력 ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: #fff; }
.cal .dow { padding: 6px; text-align: center; font-size: 12px; color: var(--muted); background: #f9fafb; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal .day { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; cursor: pointer; overflow: hidden; }
.cal .day:hover { background: #fafafa; }
.cal .day.other { background: #fafafa; color: #c0c4cc; }
.cal .day .dn { font-size: 12px; margin-bottom: 2px; }
.cal .day.today .dn { background: var(--primary); color: #fff; border-radius: 10px; display: inline-block; padding: 0 6px; }
.cal .sun .dn, .cal .dow.sun { color: var(--bad); }
.cal .sat .dn, .cal .dow.sat { color: var(--primary); }
.ev { font-size: 11px; padding: 1px 5px; border-radius: 3px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ev.personal { background: #dbeafe; color: #1e40af; }
.ev.dept { background: #dcfce7; color: #166534; }
.ev.company { background: #ffedd5; color: #9a3412; }
.ev.leave { background: #e5e7eb; color: #374151; }
.legend { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.legend label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* ---------- 회의실 시간표 ---------- */
.timetable { border-collapse: collapse; background: #fff; min-width: 100%; }
.timetable th, .timetable td { border: 1px solid var(--line); padding: 0; height: 40px; }
.timetable th { font-size: 11px; font-weight: normal; color: var(--muted); min-width: 44px; background: #f9fafb; }
.timetable th.room { min-width: 110px; text-align: left; padding: 0 10px; color: var(--text); font-size: 13px; position: sticky; left: 0; z-index: 1; }
.timetable td.free { cursor: pointer; }
.timetable td.free:hover { background: var(--primary-l); }
.timetable td.past { background: #fafafa; }
.timetable td.busy { background: #dbeafe; color: #1e40af; font-size: 12px; padding: 0 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 0; }
.timetable td.busy.mine { background: #bfdbfe; font-weight: bold; }

/* ---------- 모달·토스트 ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 760px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 20px; }
.modal-body .form-row > .lbl { width: 80px; }
#toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1f2937; color: #fff; padding: 12px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 360px; cursor: pointer; animation: slide .2s ease-out; }
.toast.err { background: var(--bad); }
.toast.info { background: var(--primary); }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } }

/* ---------- 자료실·조직도 ---------- */
.crumbs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 15px; }
.crumbs span.sep { color: var(--muted); }
.progress { height: 6px; background: var(--gray-l); border-radius: 3px; overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; background: var(--primary); width: 0; transition: width .1s; }
.org { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.org .tree a { display: block; padding: 6px 8px; border-radius: 6px; color: var(--text); }
.org .tree a.active { background: var(--primary-l); color: var(--primary); font-weight: bold; }
.org .tree a:hover { text-decoration: none; background: var(--gray-l); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.person-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; gap: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--primary-l); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: bold; flex-shrink: 0; }

/* ---------- 공통 보조 ---------- */
.radio-inline { display: inline-flex; gap: 4px; align-items: center; margin-right: 16px; }
.nowrap { white-space: nowrap; }
.ellipsis { display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.btn.big { padding: 10px 18px; font-size: 15px; }
.btn.active { background: var(--primary-l); border-color: var(--primary); color: var(--primary); }
.btn.icon-only { padding: 7px 10px; }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.grid.c1 { grid-template-columns: 1fr; }
a.stat-card { color: var(--text); display: block; }
a.stat-card:hover { text-decoration: none; border-color: var(--primary); }
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 16px; }
.pbar { height: 8px; background: var(--gray-l); border-radius: 4px; overflow: hidden; margin: 8px 0 6px; min-width: 80px; }
.pbar > div { height: 100%; background: linear-gradient(90deg, var(--primary), #60a5fa); border-radius: 4px; }
.proj-mini li { align-items: center; }
.proj-mini .pm-right { display: flex; align-items: center; gap: 8px; min-width: 190px; }
.proj-mini .pm-right .pbar { flex: 1; margin: 0; }
table.kv { border-collapse: collapse; width: 100%; }
table.kv th, table.kv td { padding: 8px 10px; border-bottom: 1px solid var(--gray-l); text-align: left; vertical-align: top; }
table.kv th { width: 120px; color: var(--muted); font-weight: normal; white-space: nowrap; }
.detail-box { background: #f9fafb; border-radius: 8px; margin-bottom: 14px; }
table.list.sortable th[data-sort] { cursor: pointer; }
table.list.sortable th.sorted { color: var(--primary); font-weight: bold; }
table.list.sortable th[data-sort]:hover { color: var(--text); }
tr.unread-row td { font-weight: bold; }
.tag.rt-0 { background: #ede9fe; color: #6d28d9; }
.tag.rt-1 { background: #e0f2fe; color: #0369a1; }
.tag.rt-2 { background: #fef3c7; color: #b45309; }
.tag.ts-new { background: var(--bad-l); color: var(--bad); }
.tag.ts-accepted { background: var(--primary-l); color: var(--primary); }
.tag.ts-done { background: var(--ok-l); color: var(--ok); }
.tag.ts-rejected { background: var(--gray-l); color: var(--muted); }
.tag.ps-planning { background: #fef3c7; color: #b45309; }
.tag.ps-active { background: var(--primary-l); color: var(--primary); }
.tag.ps-hold { background: var(--gray-l); color: var(--muted); }
.tag.ps-done { background: var(--ok-l); color: var(--ok); }
.respond-box { background: #f9fafb; margin-top: 18px; }

/* ---------- 첨부파일 ---------- */
.att-field { border: 1px dashed #cbd5e1; border-radius: 8px; padding: 8px; background: #fafbfc; }
.att-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--gray-l); }
.att-row:last-child { border-bottom: 0; }
.att-row input[type=file] { flex: 1; min-width: 0; padding: 4px; border: 0; background: none; }
.att-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-tools { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.att-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); vertical-align: middle; background: #fff; }
.att-cell { word-break: break-all; }
.att-section { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.att-toolbar { margin-bottom: 8px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 10px; }
.gallery img { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }

/* ---------- 사람 선택 ---------- */
.pp { border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.pp-chosen { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 26px; }
.pp-search { width: 100%; margin-bottom: 6px; }
.pp-list { max-height: 220px; overflow-y: auto; }
.pp-dept { font-weight: bold; font-size: 13px; padding: 6px 4px 2px; }
.pp-person { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 16px; border-radius: 4px; cursor: pointer; }
.pp-person:hover { background: var(--gray-l); }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-l); color: var(--primary); border-radius: 14px; padding: 3px 4px 3px 10px; font-size: 13px; }
.chip button { background: none; border: 0; cursor: pointer; color: inherit; padding: 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-radio input { display: none; }
.chip-radio span { display: inline-block; padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 16px; cursor: pointer; background: #fff; }
.chip-radio input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 프로젝트 ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.proj-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; color: var(--text); }
.proj-card:hover { text-decoration: none; border-color: var(--primary); box-shadow: 0 4px 14px rgba(37,99,235,.08); }
.proj-name { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-head .pbar { height: 10px; }
.stats .card { padding: 14px; margin-bottom: 0; }
.stats { margin-bottom: 16px; }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; }
.seg .btn:first-child { border-radius: 6px 0 0 6px; }
.seg .btn:last-child { border-radius: 0 6px 6px 0; margin-left: -1px; }
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: start; }
.kcol { background: var(--gray-l); border-radius: 10px; padding: 8px; min-height: 120px; }
.kcol.over { outline: 2px dashed var(--primary); }
.khead { font-weight: bold; padding: 4px 6px 8px; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: pointer; }
.kcard:hover { border-color: var(--primary); }
.ktitle { font-weight: bold; margin-bottom: 6px; word-break: break-word; }
.kmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kmove { margin-top: 8px; padding: 3px 6px; font-size: 12px; width: 100%; }
.task-extra { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
ul.checks { list-style: none; padding: 0; margin: 0 0 6px; }
ul.checks li { display: flex; align-items: center; gap: 8px; padding: 6px 2px; border-bottom: 1px solid var(--gray-l); }
ul.checks li label { flex: 1; display: flex; gap: 8px; align-items: center; cursor: pointer; }
ul.checks li.done label span { text-decoration: line-through; color: var(--muted); }
.gantt { overflow-x: auto; }
.g-row { display: flex; align-items: center; min-width: 640px; border-bottom: 1px solid var(--gray-l); }
.g-label { width: 200px; flex-shrink: 0; padding: 6px 8px 6px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-track { flex: 1; position: relative; height: 34px; }
.g-head .g-track { height: 22px; }
.g-tick { position: absolute; top: 2px; font-size: 11px; color: var(--muted); transform: translateX(-50%); white-space: nowrap; }
.g-bar { position: absolute; top: 9px; height: 16px; border-radius: 8px; opacity: .85; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); opacity: .6; }

/* ---------- 대화방 ---------- */
.chat { padding: 0; display: flex; flex-direction: column; height: calc(100vh - 330px); min-height: 380px; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; background: #f8fafc; border-radius: 10px 10px 0 0; }
#chat-more { display: block; margin: 0 auto 10px; }
.msg { margin-bottom: 10px; max-width: 78%; }
.msg.mine { margin-left: auto; }
.msg-who { font-size: 12px; margin-bottom: 2px; }
.msg-row { display: flex; align-items: flex-end; gap: 6px; }
.msg.mine .msg-row { flex-direction: row-reverse; }
.bubble { background: #fff; border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 8px 12px; word-break: break-word; line-height: 1.5; }
.msg.mine .bubble { background: var(--primary); color: #fff; border-color: var(--primary); border-radius: 14px 4px 14px 14px; }
.msg.mine .bubble a { color: #fff; }
.msg-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.msg-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chat-img { max-width: 220px; max-height: 220px; border-radius: 8px; display: block; }
.chat-file { display: inline-block; background: rgba(0,0,0,.05); border-radius: 6px; padding: 4px 8px; }
.mention { color: #b45309; }
.msg.mine .mention { color: #fde68a; }
.chat-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px; }
.chat-files:not(:empty) { padding: 8px 10px 0; }
.chat-input { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-input textarea { min-height: 38px; height: 38px; resize: none; flex: 1; line-height: 1.4; }

/* ---------- 구매·지출 ---------- */
.stepper { display: flex; gap: 4px; margin-bottom: 16px; }
.step { flex: 1; text-align: center; padding: 8px 4px; background: var(--gray-l); color: var(--muted); font-size: 13px; position: relative; }
.step:first-child { border-radius: 8px 0 0 8px; }
.step:last-child { border-radius: 0 8px 8px 0; }
.step span { display: inline-block; width: 20px; height: 20px; line-height: 20px; border-radius: 50%; background: #fff; margin-right: 4px; font-size: 11px; }
.step.on { background: var(--primary); color: #fff; font-weight: bold; }
.step.on span { color: var(--primary); }
.expense-form { max-width: 640px; }
.ex-step { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; font-size: 15px; }
.ex-step .num { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }

.qr-card { max-width: 520px; margin: 0 auto 16px; text-align: center; padding: 26px 22px; }
.qr-card h3 { font-size: 18px; }
.qr-box { display: inline-block; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; margin: 6px 0 8px; }
.qr-box svg { display: block; width: 260px; height: 260px; max-width: 70vw; max-height: 70vw; }
.qr-url { font-family: Consolas, monospace; font-size: 13px; color: var(--muted); word-break: break-all; margin-bottom: 8px; }
.qr-pick { max-width: 100%; margin-bottom: 8px; }
.qr-steps { text-align: left; margin: 12px auto 6px; padding-left: 22px; line-height: 1.9; max-width: 420px; }
.mail-frame { width: 100%; height: calc(100vh - 230px); min-height: 480px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* ---------- 홈 막대그래프 ---------- */
.grid.c21 { grid-template-columns: 2fr 1fr; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.chart-legend b { color: var(--text); }
.hbars { display: flex; flex-direction: column; gap: 4px; }
.hbar-row { display: flex; align-items: center; gap: 10px; color: var(--text); padding: 4px 6px; margin: 0 -6px; border-radius: 6px; }
.hbar-row:hover { background: var(--gray-l); text-decoration: none; }
.hbar-label { width: 140px; flex-shrink: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-label.short { width: 56px; }
.hbar-track { flex: 1; min-width: 0; height: 20px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-end; }
.hbar-fill { display: flex; gap: 2px; height: 18px; min-width: 6px; }
.hbar-fill .seg { min-width: 18px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: bold; color: #1f2937; overflow: hidden; }
.hbar-fill .seg:first-child { border-radius: 4px 0 0 4px; }
.hbar-fill .seg:last-child { border-radius: 0 4px 4px 0; }
.hbar-fill .seg:only-child { border-radius: 4px; }
.hbar-total { width: 40px; text-align: right; font-size: 12px; color: var(--muted); flex-shrink: 0; }
/* ---------- 홈: 목록 카드 (설정한 줄 수만 보이고 「전체」로 펼침) ---------- */
.card-tools { float: right; display: inline-flex; gap: 12px; align-items: center; font-weight: normal; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; font-weight: bold; }
.link-btn:hover { text-decoration: underline; }
.home-list .more-row { display: none; }
.home-list.expanded .more-row { display: flex; }

/* ---------- 홈: 넓은 화면에서는 오른쪽 빈 공간에 현황 그래프 ---------- */
.content.home-wide { max-width: 1760px; }
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.home-side { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: start; align-content: start; align-self: start; }
.home-side .card { margin-bottom: 0; }
@media (min-width: 1500px) {
  .home-layout { grid-template-columns: minmax(0, 1fr) 400px; }
  .home-side { grid-template-columns: 1fr; }
}
.home-chart h3 { margin-bottom: 14px; }
/* 상태별 합계 칸 */
.stat-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 16px; }
.stat-chip { border: 1px solid var(--line); border-radius: 8px; padding: 8px 4px 6px; text-align: center; background: #fafafa; }
.stat-chip i { display: block; width: 22px; height: 4px; border-radius: 2px; margin: 0 auto 6px; }
.stat-chip span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; }
.stat-chip b { display: block; font-size: 22px; line-height: 1.3; color: var(--text); }
.stat-chip.alert { border-color: #fca5a5; background: var(--bad-l); }
.stat-chip.alert b, .stat-chip.alert span { color: var(--bad); }
/* 프로젝트별 막대 */
.pchart { display: flex; flex-direction: column; }
.pchart-row { display: block; padding: 10px 8px; margin: 0 -8px; border-radius: 8px; color: var(--text); border-top: 1px solid var(--gray-l); }
.pchart-row:first-child { border-top: 0; }
.pchart-row:hover { background: var(--gray-l); text-decoration: none; }
.pchart-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.pchart-head > b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pchart-head > span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pchart-head > span b { color: var(--ok); font-size: 13px; }
.pchart-bar { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; background: var(--gray-l); }
.pchart-bar span { display: flex; align-items: center; justify-content: center; min-width: 22px; font-size: 12px; font-weight: bold; color: #111827; }
.pchart-text { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; color: #374151; }
.pchart-text span { display: inline-flex; align-items: center; gap: 4px; }
.pchart-text span.warn { color: var(--bad); font-weight: bold; }
.pchart-text i, .rchart-label i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
/* 받은 업무요청 상태 */
.rchart { display: flex; flex-direction: column; gap: 2px; }
.rchart-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 8px; color: var(--text); }
.rchart-row:hover { background: var(--gray-l); text-decoration: none; }
.rchart-label { width: 74px; flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: bold; }
.rchart-track { flex: 1; min-width: 0; height: 14px; background: var(--gray-l); border-radius: 7px; overflow: hidden; }
.rchart-track span { display: block; height: 100%; border-radius: 7px; }
.rchart-num { width: 82px; flex-shrink: 0; text-align: right; font-size: 12px; white-space: nowrap; }
.rchart-num b { font-size: 15px; }

/* 사내 메신저 */
.messenger { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  height: calc(100vh - 110px); min-height: 460px; overflow: hidden; }
.ms-rooms { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.ms-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 8px; }
.ms-search { margin: 0 12px 8px; }
.ms-list { flex: 1; overflow-y: auto; }
.ms-item { display: block; padding: 10px 14px; border-top: 1px solid var(--gray-l); color: var(--text); }
.ms-item:hover { background: var(--gray-l); text-decoration: none; }
.ms-item.active { background: var(--primary-l); }
.ms-item.secret { border-left: 3px solid #6b7280; }
.ms-item-top, .ms-item-bottom { display: flex; align-items: center; gap: 6px; }
.ms-item-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-preview { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.ms-item .badge { position: static; }
.ms-room { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ms-empty { margin: auto; text-align: center; line-height: 1.9; }
.ms-room-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ms-room-head.secret { background: #1f2937; color: #fff; }
.ms-room-head.secret .muted { color: #d1d5db; }
.ms-room-title { min-width: 0; }
.ms-room-title b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-back { display: none; }
.ms-log { border-radius: 0; }
.msg-unread { color: #d97706; }
.msg-exp { color: #6b7280; font-size: 10px; }
#tt-chat { text-decoration: none; }
#tt-chat .badge { position: absolute; top: 0; right: -4px; }
@media (max-width: 860px) {
  .messenger { grid-template-columns: 1fr; height: calc(100vh - 140px); }
  .messenger.has-room .ms-rooms { display: none; }
  .messenger:not(.has-room) .ms-room { display: none; }
  .ms-back { display: inline-flex; }
}

/* 설비 고장 처리 이력 */
.eq-log { list-style: none; margin: 0 0 12px; padding: 0; }
.eq-log li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--gray-l); }
.eq-log-icon { width: 24px; text-align: center; flex-shrink: 0; }
.eq-log li.status > div > div:last-child { font-weight: bold; }

/* 회의록 */
.mn-action { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.mn-action input[name=act_content] { flex: 1 1 260px; min-width: 0; }
.mn-action select { width: 130px; }
.minute-kv { width: 100%; margin: 6px 0 4px; border-collapse: collapse; }
.minute-kv th, .minute-kv td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.minute-kv th { background: var(--gray-l); width: 90px; white-space: nowrap; font-weight: bold; }
.minute-h { margin: 22px 0 8px; padding-left: 8px; border-left: 3px solid var(--primary); }
@media (max-width: 860px) { .minute-kv th { width: 70px; } .minute-kv tr { display: grid; grid-template-columns: 70px 1fr; } .minute-kv td[colspan] { grid-column: 2; } }

/* 오늘 부재자 */
.ab-count { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 10px; background: var(--bad-l); color: var(--bad); font-size: 12px; vertical-align: 1px; }
.tag.ab-full { background: #dbeafe; color: #1d4ed8; }
.tag.ab-half { background: #fef3c7; color: #b45309; }
.tag.ab-etc { background: #f3f4f6; color: #4b5563; }
.tag.ab-trip { background: #dcfce7; color: #15803d; }
/* 오른쪽 아래 카드 공통: 상태별 건수 */
.mini-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mini-chips span { padding: 3px 10px; border-radius: 12px; background: var(--gray-l); font-size: 12px; color: #374151; }
.mini-chips span b { font-size: 13px; margin-left: 2px; }
.mini-chips span.hl { background: #dbeafe; color: #1d4ed8; }
.mini-chips span.bad { background: var(--bad-l); color: var(--bad); }
.side-note { margin: -4px 0 6px; }
.side-pick { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; cursor: pointer; line-height: 1.6; }
.side-pick input { margin-top: 5px; }
.side-order { min-width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 11px; font-weight: bold; display: inline-flex; align-items: center; justify-content: center; }
.side-order:empty { background: none; }
.side-pick:has(input:checked) { border-color: var(--primary); background: var(--primary-l); }
.tag.dl-task { background: #ede9fe; color: #6d28d9; }
.tag.dl-recv { background: #fef3c7; color: #b45309; }
.tag.dl-sent { background: #e0f2fe; color: #0369a1; }

.chart-tip { position: fixed; z-index: 300; background: #1f2937; color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; white-space: pre-line; pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,.2); }

/* ---------- 휴대폰 아래 메뉴 ---------- */
.bottom-nav { display: none; }

/* ---------- 휴대폰 화면 ---------- */
@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .sidebar { position: fixed; top: 52px; bottom: 0; left: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 20px rgba(0,0,0,.1); overflow-y: auto; padding-bottom: 80px; }
  .sidebar.open { transform: none; }
  .content { padding: 14px 12px calc(76px + env(safe-area-inset-bottom)); }
  .grid.c3, .grid.c2, .grid.c21, .picker, .org { grid-template-columns: 1fr; }
  .hbar-label { width: 96px; }
  .home-side { grid-template-columns: 1fr; }
  .grid.c4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid.c4 .card { margin-bottom: 0; padding: 12px; }
  .grid.c4 .stat { font-size: 22px; }
  .home-stats { margin-bottom: 14px; }
  .user-name { display: none; }
  .brand { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex-shrink: 1; }
  .top-tools { margin-left: 4px; }
  .tt-search input { width: 110px; font-size: 16px; }
  .top-tools .tt-sep, #tt-back, #tt-fwd, .top-tools a[href="#/"] { display: none; } /* 휴대폰: 아래 메뉴·뒤로 버튼이 있으므로 생략 */
  .noti-panel { position: fixed; left: 8px; right: 8px; width: auto; top: 52px; }
  .cal .day { min-height: 64px; }
  .ev { font-size: 10px; }
  .form-row { flex-direction: column; gap: 4px; }
  .form-row > .lbl { width: auto; padding-top: 0; }
  table.list .hide-m { display: none; }
  input, select, textarea { font-size: 16px; } /* 아이폰 입력 시 화면 확대 방지 */
  .toolbar input[type=search], .toolbar input[style*="width"] { flex: 1 1 140px; width: auto !important; }
  .kanban { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
  .chat { height: calc(100vh - 300px); }
  .chat-img { max-width: 170px; }
  .proj-mini .pm-right { min-width: 120px; }
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal { max-height: 94vh; border-radius: 14px 14px 0 0; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: #fff; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(0,0,0,.05); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 6px 0 7px; font-size: 11px; color: var(--muted); position: relative; }
  .bottom-nav a span { font-size: 19px; line-height: 1.2; }
  .bottom-nav a.active { color: var(--primary); font-weight: bold; }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav .badge { position: absolute; top: 2px; left: 54%; }
  #toast-root { bottom: calc(80px + env(safe-area-inset-bottom)); right: 12px; left: 12px; }
}

/* 그림 안내서 */
.guide-link { display: inline-block; margin: 2px 0 10px; color: #1e3a8a; font-weight: bold; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.guide-link:hover { color: #172554; }
.guide-pop { max-height: 72vh; overflow-y: auto; border-radius: 10px; background: #f3f4f8; }
.guide-pop img { display: block; width: 100%; height: auto; }

/* 업무(ERP) */
.rn { text-align: right; white-space: nowrap; }
input.num { text-align: right; }
.erp-stats { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.erp-stat { flex: 1 1 140px; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
a.erp-stat:hover { text-decoration: none; border-color: var(--primary); }
.erp-stat span { color: var(--muted); font-size: 13px; }
.erp-stat b { font-size: 22px; }
.erp-stat.wide { flex-basis: 260px; }
.erp-stat.bad b { color: var(--bad); }
.erp-stat.warn b { color: var(--warn); }
.erp-late { color: var(--bad); font-weight: bold; }
.erp-ok { color: var(--ok); }
.erp-lines input { width: 100%; min-width: 0; }
.erp-lines td { padding: 4px; }
.erp-total { margin: 12px 0 12px auto; width: 300px; max-width: 100%; }
.erp-total td { text-align: right; }
.erp-doc-title { text-align: center; letter-spacing: 8px; margin: 10px 0 4px; }
.erp-parties { display: flex; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.erp-parties > table { flex: 1 1 280px; }
@media print { .erp-doc { border: 0; padding: 0; } .tabs { display: none; } }
.sub-tabs a { padding: 6px 14px; font-size: 13px; }
.sub-tabs { margin-top: -6px; }

/* 프로젝트: CPM·서류 이력·활동 */
.pred-list { max-height: 140px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; }
.pred-list label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.cpm-scroll { overflow: auto; max-height: 70vh; }
.cpm-svg { display: block; max-width: none; }
tr.cpm-crit td { background: #fef2f2; }
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.activity li { display: flex; gap: 10px; align-items: flex-start; }
.act-ic { width: 26px; height: 26px; border-radius: 50%; background: var(--gray-l); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc-card { margin-bottom: 12px; }
.doc-last { margin: 8px 0 0; }
.doc-hist { margin-top: 8px; }
.doc-hist summary { cursor: pointer; color: var(--primary); font-size: 13px; }
@media print { .cpm-scroll { overflow: visible; max-height: none; } .cpm-svg { width: 100% !important; height: auto !important; } }

/* LOT 추적 · 품질 */
ul.trace, ul.trace ul { list-style: none; margin: 0; padding-left: 18px; border-left: 1px dashed var(--line); }
ul.trace { border-left: 0; padding-left: 0; }
ul.trace li { padding: 3px 0; }
.pareto-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.pareto-row .pn { width: 90px; flex-shrink: 0; font-size: 13px; }
.pbar2 { flex: 1; height: 14px; background: var(--gray-l); border-radius: 7px; overflow: hidden; }
.pbar2 i { display: block; height: 100%; background: #f87171; }
.qi-defects { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.qi-defects label { display: flex; align-items: center; gap: 6px; }
.qi-defects input { width: 70px; }

/* 라벨 인쇄 · 보고서 */
.label-sheet { display: grid; grid-template-columns: repeat(auto-fill, 62mm); gap: 2mm; margin-top: 12px; }
.label { width: 62mm; height: 34mm; border: 1px dashed #cbd5e1; display: flex; gap: 2mm; align-items: center; padding: 2mm; box-sizing: border-box; break-inside: avoid; background: #fff; }
.label .lb-qr svg { width: 26mm; height: 26mm; display: block; }
.label .lb-txt { display: flex; flex-direction: column; gap: 1mm; min-width: 0; font-size: 10pt; line-height: 1.25; }
.label .lb-txt span { font-size: 8pt; color: #374151; word-break: break-all; }
@media print { .label { border: 0; } .label-sheet { margin: 0; } }
.rpt-svg { display: block; max-width: 100%; height: auto; }

/* 도움말 */
.tabs .help-link { margin-left: auto; font-size: 13px; color: var(--muted); }
.help-group { margin: 18px 0 8px; font-size: 15px; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.help-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
.help-card:hover { border-color: var(--primary); text-decoration: none; }
.help-ic { font-size: 22px; line-height: 1.2; }
.help-summary { font-size: 15px; margin: 0 0 8px; color: var(--text); }
.help-body h3 { margin: 18px 0 6px; font-size: 15px; border-left: 4px solid var(--primary); padding-left: 8px; }
.help-body ol, .help-body ul { margin: 6px 0 6px 4px; padding-left: 20px; }
.help-body li { margin: 4px 0; line-height: 1.55; }
.help-body code { background: var(--gray-l); padding: 0 5px; border-radius: 4px; font-size: 12.5px; }
.help-tip, .help-warn { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 10px 0; background: #f9fafb; font-size: 13.5px; line-height: 1.55; }
.help-warn { background: var(--warn-l); border-color: #fdba74; }
.help-diagram { margin: 8px 0 12px; border: 1px solid var(--line); border-radius: 8px; overflow: auto; background: #fff; }
.help-diagram img { display: block; width: 100%; min-width: 760px; height: auto; }
.help-more { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 16px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; align-items: center; }

/* 왼쪽 메뉴: 접을 수 있는 대분류 */
.nav-tools { display: flex; gap: 8px; padding: 0 14px 8px; font-size: 11.5px; white-space: nowrap; }
.nav-tools button { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font: inherit; }
.nav-tools button:hover { color: var(--primary); text-decoration: underline; }
.nav-head { display: flex; align-items: center; gap: 6px; width: 100%; padding: 9px 18px; background: none; border: 0; text-align: left; font: inherit; font-weight: bold; color: var(--text); cursor: pointer; }
.nav-head:hover { background: var(--gray-l); }
.nav-head .chev { margin-left: auto; font-style: normal; font-size: 11px; color: var(--muted); transition: transform .15s; }
.nav-sec.closed .chev { transform: rotate(-90deg); }
.nav-sec.closed .nav-body { display: none; }
.nav-sec.has-active .nav-head { color: var(--primary); }
.nav-sec[hidden], .nav-body a[hidden] { display: none; }
.nav-ver { padding: 14px 18px 4px; font-size: 11px; color: var(--muted); }
