/*
 * 화면 규칙 — 네이버를 기준으로 삼는다.
 *   · 배경은 옅은 회색, 내용은 흰 상자. 상자마다 굵은 제목줄.
 *   · 표 중심, 본문 13~14px. 숫자는 오른쪽 정렬 + 고정폭 숫자.
 *   · 빨강은 '눌러야 할 것'과 '경고'에만.
 */
:root {
  --bg: #f5f6f7; --box: #fff; --line: #e5e5e5; --line2: #d5d5d5; --soft: #f7f8fa; --hover: #fafbfc;
  --txt: #1a1a1a; --sub: #555; --mute: #888; --faint: #aaa;
  --red: #c00000; --red-bg: #fff2f2; --blue: #1f5fd6; --blue-bg: #eef4ff; --green: #0a8a4a; --green-bg: #eaf7ef;
  --orange: #c26a00; --orange-bg: #fff5e6; --purple: #6b3fc4; --purple-bg: #f3eefe; --gray-bg: #f0f1f3;
  --radius: 4px; --wide: 1200px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--txt);
  font: 14px/1.5 "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 16px; }
.hide { display: none !important; }
.mute { color: var(--mute); } .sub { color: var(--sub); } .red { color: var(--red); } .blue { color: var(--blue); } .green { color: var(--green); }
.small { font-size: 12px; } .bold { font-weight: 700; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrapr { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* ── 머리 ── */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { display: flex; align-items: baseline; gap: 6px; font-weight: 900; font-size: 21px; letter-spacing: -0.5px; white-space: nowrap; }
.logo b { color: var(--red); }
.logo span { font-size: 13px; font-weight: 600; color: var(--sub); letter-spacing: 0; }
.logo:hover { text-decoration: none; }
.search { flex: 1; max-width: 460px; display: flex; border: 2px solid var(--red); border-radius: 22px; overflow: hidden; height: 40px; background: #fff; }
.search input { flex: 1; border: 0; outline: 0; padding: 0 16px; font-size: 14px; min-width: 0; }
.search button { border: 0; background: none; padding: 0 14px; cursor: pointer; color: var(--red); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn { position: relative; border: 0; background: none; cursor: pointer; padding: 8px; border-radius: 50%; display: inline-flex; color: #333; }
.icon-btn:hover { background: var(--soft); }
.dot { position: absolute; top: 3px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }
.me-btn { display: flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; padding: 4px 6px; border-radius: 20px; }
.me-btn:hover { background: var(--soft); }

/* ── 메뉴 ── */
.gnb { background: #fff; border-bottom: 1px solid var(--line); }
.gnb .wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.gnb .wrap::-webkit-scrollbar { display: none; }
.gnb a { position: relative; padding: 13px 14px 12px; font-size: 15px; font-weight: 600; color: #333; white-space: nowrap; }
.gnb a:hover { text-decoration: none; color: var(--txt); }
.gnb a.on { color: var(--txt); }
.gnb a.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; background: var(--red); border-radius: 2px 2px 0 0; }
.gnb .cnt { display: inline-block; margin-left: 4px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; vertical-align: 2px; }

main { padding: 20px 0 60px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0; letter-spacing: -0.5px; }

/* ── 상자 ── */
.panel { background: var(--box); border: 1px solid var(--line); border-radius: var(--radius); }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 48px; }
.panel-title { font-size: 15px; font-weight: 700; }
.panel-head .more { margin-left: auto; font-size: 12px; color: var(--mute); }
.panel-body { padding: 14px 16px; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; } /* 안의 표·버튼이 칸을 밀어 화면 밖으로 넘치지 않게 */
.g-home { grid-template-columns: 300px 1fr 1fr; }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-side { grid-template-columns: 220px 1fr; align-items: start; }
.stack > * + * { margin-top: 16px; }

/* ── 표 ── */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { background: var(--soft); color: var(--sub); font-weight: 400; text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.tbl tbody tr:hover { background: var(--hover); }
.tbl tr.click { cursor: pointer; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .c { text-align: center; }
.tbl tr.pin td { background: #fffaf3; }
.tbl tr.unread td .t { font-weight: 700; }
.tbl-wrap { overflow-x: auto; }
.empty { text-align: center; color: var(--faint); padding: 36px 10px; font-size: 13px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f2f2f2; font-size: 13.5px; }
.list li:last-child { border-bottom: 0; }
.list .date { margin-left: auto; color: var(--mute); font-size: 12px; white-space: nowrap; }

/* ── 입력 ── */
.inp, .sel, .txt { width: 100%; border: 1px solid var(--line2); border-radius: var(--radius); background: #fff; font-size: 14px; outline: 0; }
.inp, .sel { height: 36px; padding: 0 10px; }
.txt { padding: 9px 10px; min-height: 120px; resize: vertical; line-height: 1.6; }
.inp:focus, .sel:focus, .txt:focus { border-color: var(--txt); }
.sel { appearance: none; padding-right: 28px; background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23666' d='M0 0h10L5 6z'/%3E%3C/svg%3E") no-repeat right 10px center; }
.inp.w-auto, .sel.w-auto { width: auto; }
.form { display: grid; grid-template-columns: 110px 1fr; border-top: 2px solid var(--txt); }
.form > label, .form > .lb { background: var(--soft); padding: 10px 12px; font-size: 13px; color: var(--sub); border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.form > .fd { padding: 7px 10px; border-bottom: 1px solid var(--line); min-width: 0; }
.check { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--red); margin: 0; }

/* ── 단추 ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 36px; padding: 0 14px; border: 1px solid var(--line2); border-radius: var(--radius); background: #fff; cursor: pointer; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--soft); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.pri { background: var(--red); border-color: var(--red); color: #fff; }
.btn.pri:hover { background: #a80000; }
.btn.dark { background: #333; border-color: #333; color: #fff; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { color: var(--red); }

/* ── 꼬리표 ── */
.tag { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 11.5px; font-weight: 600; line-height: 18px; white-space: nowrap; background: var(--gray-bg); color: var(--sub); }
.tag.red { background: var(--red-bg); color: var(--red); }
.tag.blue { background: var(--blue-bg); color: var(--blue); }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.orange { background: var(--orange-bg); color: var(--orange); }
.tag.purple { background: var(--purple-bg); color: var(--purple); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line2); background: #fff; border-radius: 16px; height: 30px; padding: 0 12px; font-size: 13px; cursor: pointer; }
.chip.on { border-color: var(--txt); background: var(--txt); color: #fff; font-weight: 600; }

/* ── 사람 ── */
.av { --c: #8a94a6; width: 34px; height: 34px; border-radius: 50%; background: var(--c); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; position: relative; letter-spacing: -0.5px; }
.av.sm { width: 26px; height: 26px; font-size: 11px; }
.av.lg { width: 56px; height: 56px; font-size: 19px; }
.av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.av .on { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #1ec800; border: 2px solid #fff; }
.person { display: inline-flex; align-items: center; gap: 6px; }
.status { font-size: 11.5px; padding: 0 6px; border-radius: 3px; line-height: 18px; }
.st-in { background: var(--green-bg); color: var(--green); }
.st-out { background: var(--gray-bg); color: var(--mute); }
.st-leave { background: var(--purple-bg); color: var(--purple); }
.st-away { background: var(--orange-bg); color: var(--orange); }
.st-none { background: #fff; color: var(--faint); border: 1px solid var(--line); }

/* ── 사이드 메뉴 ── */
.side { padding: 8px 0; }
.side a, .side button.sidelink { display: flex; align-items: center; width: 100%; padding: 9px 16px; font-size: 14px; border: 0; background: none; cursor: pointer; text-align: left; }
.side a:hover, .side button.sidelink:hover { background: var(--soft); text-decoration: none; }
.side a.on { font-weight: 700; color: var(--red); background: var(--red-bg); }
.side .n { margin-left: auto; font-size: 12px; color: var(--mute); }
.side .n.hot { color: var(--red); font-weight: 700; }
.side-head { padding: 14px 16px 6px; font-size: 12px; color: var(--mute); }
.side .act { padding: 12px 16px 6px; }

/* ── 홈 ── */
.punch { text-align: center; }
.punch .clock { font-size: 32px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.punch .date { color: var(--mute); font-size: 13px; }
.punch .btns { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 14px 0 10px; }
.punch .btns .btn { height: 48px; font-size: 15px; }
.punch .times { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); }
.punch .times div { padding: 8px; font-size: 12px; color: var(--mute); }
.punch .times div + div { border-left: 1px solid var(--line); }
.punch .times b { display: block; font-size: 16px; color: var(--txt); font-variant-numeric: tabular-nums; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.stat-row a { padding: 12px 6px; text-align: center; font-size: 12px; color: var(--sub); }
.stat-row a + a { border-left: 1px solid var(--line); }
.stat-row a b { display: block; font-size: 20px; color: var(--txt); font-variant-numeric: tabular-nums; }
.stat-row a b.hot { color: var(--red); }
.stat-row a:hover { background: var(--soft); text-decoration: none; }
.alert-bar { background: var(--red-bg); border: 1px solid #f3c4c4; color: var(--red); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; font-size: 13.5px; }
.alert-bar a { font-weight: 700; text-decoration: underline; }
.faces { display: flex; flex-wrap: wrap; gap: 10px 6px; }
.face { width: 58px; text-align: center; font-size: 11.5px; cursor: pointer; }
.face .av { margin: 0 auto 3px; }
.face.off { opacity: .45; }

/* ── 메신저 ── */
.msgr { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 160px); height: calc(100dvh - 160px); min-height: 480px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.msgr-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.msgr-tabs { display: flex; border-bottom: 1px solid var(--line); }
.msgr-tabs button { flex: 1; border: 0; background: none; padding: 12px; font-weight: 600; cursor: pointer; color: var(--mute); border-bottom: 2px solid transparent; }
.msgr-tabs button.on { color: var(--txt); border-bottom-color: var(--txt); }
.msgr-scroll { overflow-y: auto; flex: 1; }
.room { display: flex; gap: 10px; align-items: center; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f4f4f4; }
.room:hover { background: var(--hover); }
.room.on { background: #f1f3f6; }
.room .nm { font-weight: 700; font-size: 14px; }
.room .last { color: var(--mute); font-size: 12.5px; }
.room .meta { text-align: right; font-size: 11px; color: var(--faint); white-space: nowrap; }
.room .unread { display: inline-block; margin-top: 3px; min-width: 18px; padding: 0 5px; background: var(--red); color: #fff; border-radius: 9px; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; }
.group-av { width: 34px; height: 34px; border-radius: 12px; background: #e4e7ec; color: #555; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.chat { display: flex; flex-direction: column; min-height: 0; background: #b9cfe0; background: #eef1f5; }
.chat-head { background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; align-items: center; gap: 10px; min-height: 56px; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; }
.chat-day { text-align: center; margin: 14px 0; }
.chat-day span { background: rgba(0,0,0,.08); color: #555; font-size: 11.5px; padding: 3px 12px; border-radius: 10px; }
.sys { text-align: center; font-size: 12px; color: var(--mute); margin: 8px 0; }
.m { display: flex; gap: 8px; margin: 6px 0; align-items: flex-start; }
.m .who { font-size: 12px; color: var(--sub); margin-bottom: 3px; }
.m .line { display: flex; align-items: flex-end; gap: 5px; }
.bubble { background: #fff; padding: 8px 11px; border-radius: 4px 14px 14px 14px; max-width: min(520px, 70vw); white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.45; box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.m.mine { flex-direction: row-reverse; }
.m.mine .line { flex-direction: row-reverse; }
.m.mine .bubble { background: #ffe9e9; border-radius: 14px 4px 14px 14px; }
.m .tm { font-size: 10.5px; color: var(--mute); white-space: nowrap; text-align: right; line-height: 1.2; }
.m .rc { color: #e0a800; font-weight: 700; font-size: 11px; display: block; }
.m.cont { margin-top: 2px; }
.m.cont .av-slot { visibility: hidden; height: 0; }
.bubble img { max-width: 260px; max-height: 260px; border-radius: 6px; display: block; cursor: zoom-in; }
.filebox { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.m-act { display: none; gap: 2px; align-self: center; }
.m:hover .m-act { display: flex; }
.m-act button { border: 1px solid var(--line); background: #fff; border-radius: 12px; width: 26px; height: 24px; font-size: 12px; cursor: pointer; padding: 0; }
.m-act button:hover { background: var(--soft); }
@media (hover: none) { .m-act { display: flex; opacity: .55; } }
.quote { border-left: 3px solid #c9ced6; padding: 2px 8px; margin-bottom: 6px; font-size: 12.5px; color: var(--sub); cursor: pointer; background: rgba(0,0,0,.03); border-radius: 0 4px 4px 0; }
.m.flash .bubble { box-shadow: 0 0 0 3px #ffd54a; }
.typing { font-size: 12px; color: var(--mute); padding: 0 16px; min-height: 0; }
.typing:not(:empty) { padding: 4px 16px; }
.reply-bar { display: flex; align-items: center; gap: 8px; background: #f7f8fa; border-top: 1px solid var(--line); padding: 6px 12px; font-size: 12.5px; color: var(--sub); }
.room .unread.muted { background: #aab0b8; }
.chat-input { background: #fff; border-top: 1px solid var(--line); padding: 10px; display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { flex: 1; border: 0; outline: 0; resize: none; max-height: 140px; min-height: 40px; padding: 9px 4px; font-size: 14px; line-height: 1.45; }
.msgr-empty { display: flex; align-items: center; justify-content: center; color: var(--faint); height: 100%; flex-direction: column; gap: 8px; }

/* ── 결재 ── */
.doc { background: #fff; border: 1px solid var(--line); padding: 28px 32px; }
.doc h2 { text-align: center; font-size: 24px; letter-spacing: 8px; margin: 0 0 22px; }
.sign { display: flex; justify-content: flex-end; gap: 0; margin-bottom: 18px; flex-wrap: wrap; }
.sign table { border-collapse: collapse; font-size: 12px; }
.sign th { background: var(--soft); border: 1px solid #bbb; padding: 3px 8px; font-weight: 400; writing-mode: vertical-rl; letter-spacing: 3px; }
.sign td { border: 1px solid #bbb; width: 82px; text-align: center; padding: 4px; vertical-align: top; }
.sign .pos { font-size: 11px; color: var(--sub); border-bottom: 1px solid #ddd; padding-bottom: 3px; }
.sign .stamp { height: 42px; display: flex; align-items: center; justify-content: center; }
.sign .stamp i { font-style: normal; color: var(--red); border: 2px solid var(--red); border-radius: 50%; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; transform: rotate(-12deg); }
.sign .stamp i.rej { color: #333; border-color: #333; }
.sign .when { font-size: 10.5px; color: var(--mute); }
.doc-meta { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 16px; }
.doc-meta th { background: var(--soft); border: 1px solid #ccc; padding: 8px 10px; width: 110px; font-weight: 600; text-align: left; color: var(--sub); }
.doc-meta td { border: 1px solid #ccc; padding: 8px 10px; }
.doc-body { border: 1px solid #ccc; padding: 16px; min-height: 160px; }
.line-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.line-pick .who { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line2); background: #fff; border-radius: 16px; padding: 3px 6px 3px 10px; font-size: 13px; }
.line-pick .who button { border: 0; background: none; cursor: pointer; color: var(--mute); padding: 0 3px; font-size: 14px; }
.line-pick .arrow { color: var(--faint); }
.line-pick .who[data-di] { cursor: grab; touch-action: none; user-select: none; }
.line-pick .who.dragging { opacity: .45; cursor: grabbing; }
.line-pick .who.drop-l { box-shadow: -3px 0 0 var(--blue); }
.line-pick .who.drop-r { box-shadow: 3px 0 0 var(--blue); }
.items td { padding: 4px 6px; }
.items .inp { height: 32px; }

/* ── 일정 ── */
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; }
.cal th { padding: 8px; font-size: 12.5px; color: var(--sub); font-weight: 600; border-bottom: 1px solid var(--line); background: var(--soft); }
.cal th:first-child, .cal .sun .dn { color: var(--red); }
.cal th:last-child, .cal .sat .dn { color: var(--blue); }
.cal td { height: 112px; vertical-align: top; border: 1px solid #eee; padding: 4px; cursor: pointer; }
.cal td:hover { background: var(--hover); }
.cal td.other { background: #fbfbfb; }
.cal td.other .dn { opacity: .4; }
.cal td.today { background: #fffbea; }
.cal .dn { font-size: 13px; font-weight: 600; display: flex; gap: 4px; align-items: baseline; }
.cal .hol { color: var(--red); font-size: 11px; font-weight: 400; }
.cal td.holi .dn { color: var(--red); }
.ev { display: block; font-size: 11.5px; line-height: 18px; padding: 0 5px; margin-top: 2px; border-radius: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.ev.blue { background: var(--blue-bg); color: var(--blue); }
.ev.green { background: var(--green-bg); color: var(--green); }
.ev.orange { background: var(--orange-bg); color: var(--orange); }
.ev.purple { background: var(--purple-bg); color: var(--purple); }
.ev.gray { background: var(--gray-bg); color: var(--sub); }
.ev.leave { background: #f6f0ff; color: var(--purple); }
.ev.task { background: #fff; border: 1px dashed var(--line2); color: var(--sub); }
.ev.more { color: var(--mute); background: none; }

/* ── 업무 칸반 ── */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
.kcol { background: #eceef1; border-radius: 6px; padding: 8px; min-height: 160px; }
.kcol h3 { font-size: 13px; margin: 2px 4px 8px; display: flex; gap: 6px; align-items: center; }
.kcol.drop { outline: 2px dashed var(--red); }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 10px; margin-bottom: 8px; cursor: pointer; font-size: 13px; }
.kcard:hover { border-color: #bbb; }
.kcard .t { font-weight: 700; margin-bottom: 6px; line-height: 1.4; }
.kcard .meta { display: flex; align-items: center; gap: 6px; color: var(--mute); font-size: 12px; }
.over { color: var(--red); font-weight: 700; }

/* ── 예약 ── */
.tl { position: relative; }
.tl-grid { display: grid; grid-template-columns: 120px repeat(28, 1fr); font-size: 11px; }
.tl-grid .h { color: var(--mute); border-left: 1px solid #eee; padding: 4px 2px; }
.tl-row { display: grid; grid-template-columns: 120px 1fr; border-top: 1px solid var(--line); min-height: 52px; }
.tl-row .nm { padding: 10px; font-weight: 700; font-size: 13px; background: var(--soft); }
.tl-track { position: relative; background: repeating-linear-gradient(90deg, #fff 0, #fff calc(100% / 28 - 1px), #f0f0f0 calc(100% / 28 - 1px), #f0f0f0 calc(100% / 28)); cursor: copy; }
.tl-bk { position: absolute; top: 6px; bottom: 6px; background: var(--blue-bg); border: 1px solid #b9cdf5; color: var(--blue); border-radius: 4px; font-size: 11.5px; padding: 2px 5px; overflow: hidden; white-space: nowrap; cursor: pointer; }
.tl-bk.mine { background: var(--red-bg); border-color: #f0b8b8; color: var(--red); }

/* ── 모달 · 알림 ── */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 8px; width: 100%; max-width: 560px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 16px; }
.modal-head .x { margin-left: auto; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--mute); line-height: 1; }
.modal-body { padding: 16px 18px; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--soft); border-radius: 0 0 8px 8px; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: #222; color: #fff; padding: 11px 16px; border-radius: 6px; font-size: 13.5px; max-width: 360px; box-shadow: 0 6px 20px rgba(0,0,0,.2); cursor: pointer; animation: up .2s ease; }
.toast.err { background: var(--red); }
.toast .t { font-weight: 700; margin-bottom: 2px; }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }
.pop { position: absolute; right: 0; top: 46px; width: 360px; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 30px rgba(0,0,0,.14); z-index: 50; }
.pop-head { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 700; }
.pop-list { max-height: 420px; overflow-y: auto; }
.pop-item { display: block; padding: 10px 14px; border-bottom: 1px solid #f3f3f3; font-size: 13px; }
.pop-item:hover { background: var(--hover); text-decoration: none; }
.pop-item.new { background: #fff8f8; }
.pop-item .when { font-size: 11.5px; color: var(--mute); }
.menu-item { display: block; width: 100%; padding: 10px 14px; border: 0; background: none; text-align: left; cursor: pointer; font-size: 13.5px; }
.menu-item:hover { background: var(--soft); text-decoration: none; }
.pager { display: flex; justify-content: center; gap: 4px; padding: 14px; }
.pager button { min-width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 3px; cursor: pointer; }
.pager button.on { border-color: var(--red); color: var(--red); font-weight: 700; }
.files { list-style: none; padding: 0; margin: 0; }
.files li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f2f2f2; }
.comment .body { flex: 1; min-width: 0; }
.picker-list { max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.picker-list label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #f4f4f4; cursor: pointer; }
.picker-list label:hover { background: var(--hover); }

/* ── 로그인 ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 36px 32px; }
.login .logo { justify-content: center; font-size: 30px; margin-bottom: 6px; }
.login p { text-align: center; color: var(--mute); margin: 0 0 24px; font-size: 13px; }
.login .inp { height: 46px; font-size: 15px; margin-bottom: 8px; }
.login .btn { width: 100%; height: 48px; font-size: 16px; margin-top: 6px; }
.login .err { color: var(--red); font-size: 13px; min-height: 20px; margin-top: 8px; text-align: center; }

/* ── 투표 ── */
.poll-opt { position: relative; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; overflow: hidden; }
.poll-opt > * { position: relative; z-index: 1; }
.poll-opt .bar { position: absolute; left: 0; top: 0; bottom: 0; background: #f1f3f6; z-index: 0; }
.poll-opt.mine { border-color: var(--red); }
.poll-opt.mine .bar { background: var(--red-bg); }
.poll-opt input { accent-color: var(--red); width: 16px; height: 16px; margin: 0; }

/* ── 고도화: 목록 링크·@부르기·방 공지·칸반 버튼·주 52시간·OTP ── */
a.row-link { color: inherit; }
a.row-link:hover { text-decoration: underline; }
.kcard a.t { display: block; }
.av.xs { width: 20px; height: 20px; font-size: 9px; }
.mention { color: var(--blue, #1a5fd0); }
.mention-pop { position: absolute; left: 0; bottom: 100%; margin-bottom: 4px; z-index: 30; background: #fff; border: 1px solid var(--line2); border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,.12); min-width: 200px; max-height: 260px; overflow: auto; padding: 4px; }
.mention-pop button { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; padding: 6px 8px; font-size: 13px; text-align: left; cursor: pointer; border-radius: 4px; }
.mention-pop button:hover, .mention-pop button.on { background: var(--soft); }
.pin-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #fffbea; border-bottom: 1px solid #f1e3a6; font-size: 13px; cursor: pointer; }
.pin-bar .pin-ic { flex: none; }
.k-move { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.k-move button { border: 1px solid var(--line2); background: #fff; border-radius: 3px; font-size: 11.5px; padding: 2px 7px; cursor: pointer; color: var(--sub, #555); }
.k-move button:hover { border-color: var(--txt); color: var(--txt); }
@media (hover: hover) and (min-width: 761px) { .k-move { display: none; } .kcard:hover .k-move, .kcard:focus-within .k-move { display: flex; } }
.wk .row { gap: 6px; }
.wk-bar { position: relative; height: 8px; background: #eef0f3; border-radius: 4px; margin-top: 4px; overflow: hidden; }
.wk-bar.thin { height: 6px; width: 90px; display: inline-block; vertical-align: middle; margin: 0 6px 0 0; }
.wk-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: #3aa76d; border-radius: 4px; }
.wk-bar s { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(0,0,0,.25); }
.wk.warn .wk-bar i { background: var(--orange); }
.wk.over .wk-bar i { background: var(--red); }
.dash-num { font-size: 13px; color: var(--mute); }
.dash-num b { display: block; font-size: 26px; color: var(--txt); margin-bottom: 2px; }
.qr { display: flex; justify-content: center; margin: 6px 0 8px; }
.qr svg { width: 200px; height: 200px; }
.files li.mute { list-style: none; }

/* ── 인쇄: 결재 문서만 (PDF 저장도 이것으로) ── */
/* ── 사용 안내 ── */
.help .side { position: sticky; top: 12px; align-self: start; }
.help-body { font-size: 14px; line-height: 1.8; }
.help-body ol, .help-body ul { padding-left: 20px; margin: 6px 0; }
.help-body p { margin: 8px 0; }
.help-body .tbl th { background: var(--soft); text-align: left; font-weight: 600; }
.help-shot { margin: 0 0 12px; }
.help-shot img { display: block; max-width: 100%; border: 1px solid var(--line); border-radius: 4px; }
.help-shot figcaption { font-size: 12px; color: var(--mute); margin-top: 4px; }
.faq dt { font-weight: 700; margin-top: 10px; }
.faq dd { margin: 2px 0 0; color: var(--sub); }

@media print {
  @page { size: A4; margin: 14mm; }
  .help .panel { break-inside: avoid; border: 0; }
  body { background: #fff; }
  .top, .gnb, .side, #toasts, #modal-root, .page-head .btn, .btn, .no-print, #cmts, .panel:has(.list) { display: none !important; }
  .g-side { grid-template-columns: 1fr; }
  .doc { border: 0; padding: 0; }
  .doc table, .sign { break-inside: avoid; }
  main { padding: 0; }
}

/* ── 좁은 화면 ── */
@media (max-width: 1000px) {
  .g-home { grid-template-columns: 1fr 1fr; }
  .g-home > :first-child { grid-column: 1 / -1; }
  .kanban { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .top .wrap { gap: 8px; height: 54px; }
  .logo span { display: none; }
  .search { height: 36px; }
  .me-btn .nm { display: none; }
  .g-home, .g-2, .g-side { grid-template-columns: 1fr; }
  .msgr { grid-template-columns: 1fr; height: calc(100vh - 130px); height: calc(100dvh - 130px); }
  /* 아이폰 사파리는 16px 보다 작은 입력칸을 누르면 화면을 확대한다 */
  .inp, .sel, .txt, .search input, .chat-input textarea { font-size: 16px; }
  .msgr.in-room .msgr-list { display: none; }
  .msgr:not(.in-room) .chat { display: none; }
  .form { grid-template-columns: 90px 1fr; }
  .doc { padding: 18px 14px; }
  .cal td { height: 76px; padding: 2px; }
  .ev { font-size: 10.5px; padding: 0 3px; }
  .cal .hol { display: none; }
  .kanban { grid-template-columns: 1fr; }
  .tbl .hide-m { display: none; }
  .pop { position: fixed; left: 8px; right: 8px; top: 56px; width: auto; }
  main { padding-top: 14px; }
  .tl-grid { grid-template-columns: 70px repeat(28, 1fr); }
  .tl-row { grid-template-columns: 70px 1fr; }
  .tl-grid .h:nth-child(odd) { visibility: hidden; }
}

/* ── 조직도 그림 (org.js orgTree) ── */
.ot { --ot-line: #9aa8bd; --ot-navy: #1f3864; display: flex; flex-direction: column; align-items: center; overflow-x: auto; padding: 24px 16px 28px; }
.ot-node { display: flex; flex-direction: column; align-items: center; width: 100%; }
.ot-top { background: var(--ot-navy); color: #fff; border-radius: 12px; padding: 14px 36px; text-align: center; min-width: 240px; }
.ot-top-name { font-size: 18px; font-weight: 800; }
.ot-top-sub { font-size: 13px; opacity: .9; margin-top: 4px; }
.ot-top .ot-who { color: #fff; }
/* 위 상자에서 내려오는 줄. 가운데 칸이 줄이고, 옆 가지(경영지원)는 오른쪽 칸에 가로줄로 붙는다 */
.ot-stem { display: grid; grid-template-columns: 1fr 2px 1fr; width: 100%; min-height: 24px; }
.ot-v { grid-column: 2; background: var(--ot-line); }
.ot-side { grid-column: 3; justify-self: start; position: relative; padding: 14px 0 14px 36px; display: grid; gap: 10px; }
.ot-side::before { content: ''; position: absolute; left: 0; top: 50%; width: 36px; border-top: 2px solid var(--ot-line); }
.ot-side .ot-card { min-width: 200px; }
/* 아래 부서 줄: 각 칸이 가로줄 반쪽씩 + 가운데 세로 눈금을 그려 이어 붙인다 */
.ot-kids { display: flex; justify-content: center; width: 100%; }
.ot-kid { flex: 1 1 auto; min-width: 170px; position: relative; padding: 24px 6px 0; display: flex; }
.ot-kid::before, .ot-kid::after { content: ''; position: absolute; top: 0; width: 50%; height: 24px; border-top: 2px solid var(--ot-line); }
.ot-kid::before { left: 0; }
.ot-kid::after { right: 0; border-left: 2px solid var(--ot-line); }
.ot-kid:first-child::before, .ot-kid:last-child::after { border-top: 0; }
.ot-kid > .ot-node { align-self: stretch; }
.ot-kid .ot-card { width: 100%; height: 100%; }
.ot-card { background: #fff; border: 1px solid var(--line2); border-radius: 10px; padding: 14px 16px; text-align: left; }
.ot-card-name { font-weight: 800; font-size: 16px; color: var(--ot-navy); padding-bottom: 8px; margin-bottom: 8px; border-bottom: 2px solid #dfe5ee; }
.ot-line { font-size: 13px; line-height: 1.8; }
.ot-line b { margin-right: 4px; white-space: nowrap; }
.ot-grp, .ot-leads { white-space: nowrap; }
.ot-who { cursor: pointer; white-space: nowrap; }
.ot-who:hover { text-decoration: underline; }
.ot-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 3px; vertical-align: 1px; border: 0; padding: 0; }
.ot-dot.st-in { background: var(--green); }
.ot-dot.st-away { background: var(--orange); }
.ot-dot.st-leave { background: var(--purple); }
.ot-dot.st-out, .ot-dot.st-none { background: #c9ced6; }
@media (max-width: 760px) {
  /* 휴대폰: 팀 카드를 세로로 쌓고, 가로줄 대신 세로줄 하나로 잇는다 */
  .ot { padding: 16px 0; }
  .ot-kids { flex-direction: column; border-left: 2px solid var(--ot-line); margin-left: 12px; width: calc(100% - 12px); }
  .ot-kid { padding: 10px 0 0 16px; min-width: 0; }
  .ot-kid::before { left: 0; top: 50%; width: 14px; height: 0; border-top: 2px solid var(--ot-line) !important; }
  .ot-kid::after { display: none; }
  .ot-top { min-width: 0; width: 100%; padding: 12px 16px; }
  .ot-stem { grid-template-columns: 12px 2px 1fr; }
  .ot-side { padding-left: 24px; }
  .ot-side::before { width: 24px; }
  .ot-side .ot-card { min-width: 0; }
}
