/* 플로어(floor) · 선진RCS — 흰 배경, 회사 빨강(#E31F26)·주황(#E87724)은 포인트로만. 휴대폰 우선. */
:root {
  --red: #E31F26; --orange: #E87724; --ink: #1d2128; --ink2: #4b5260; --mute: #8a909c;
  --line: #e6e8ec; --bg: #ffffff; --soft: #f6f7f9; --ok: #1f8a4c; --warn: #b7791f;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; }
h1 { font-size: 20px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
.mute { color: var(--mute); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }

/* ---------- 로그인 ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login .box { width: 100%; max-width: 380px; }
.login .logo { display: block; width: 210px; max-width: 70%; margin: 0 auto 28px; }
.login p.lead { text-align: center; color: var(--ink2); margin: -12px 0 24px; }
.secret { font: 600 17px/1.5 ui-monospace, Consolas, monospace; letter-spacing: .08em; background: var(--soft); border-radius: 10px; padding: 12px; text-align: center; word-break: break-all; }

/* ---------- 입력·버튼 ---------- */
label.f { display: block; }
label.f > span { display: block; font-size: 13px; color: var(--ink2); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input:not([type]), select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--ink2); }
textarea { min-height: 96px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 16px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #000; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.block { width: 100%; padding: 13px; }
.btn.big { padding: 16px 20px; font-size: 17px; border-radius: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.err { color: var(--red); font-size: 13px; min-height: 18px; }

/* ---------- 틀: 휴대폰 = 위 막대 + 아래 탭, PC = 왼쪽 메뉴 ---------- */
.top { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 10px 16px; backdrop-filter: blur(6px); }
.top .logo { height: 26px; }
.top .title { font-weight: 700; font-size: 16px; }
.bell { position: relative; border: 0; background: none; padding: 6px; cursor: pointer; font-size: 18px; }
.bell .dot { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font: 700 11px/17px system-ui; text-align: center; }
main { padding: 16px 16px calc(84px + var(--safe-b)); max-width: 980px; margin: 0 auto; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11.5px; color: var(--mute); position: relative; }
.tabs a .ic { font-size: 20px; line-height: 1; filter: grayscale(1); opacity: .7; }
.tabs a.on { color: var(--ink); font-weight: 700; }
.tabs a.on .ic { filter: none; opacity: 1; }
.tabs a .n { position: absolute; top: 3px; left: 54%; min-width: 16px; height: 16px; border-radius: 8px; background: var(--red); color: #fff; font: 700 10px/16px system-ui; padding: 0 4px; }
.side { display: none; }
@media (min-width: 900px) {
  body.shell #app { display: grid; grid-template-columns: 232px 1fr; }
  .side { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); padding: 18px 12px; background: #fff; }
  .side .logo { width: 170px; margin: 4px 8px 20px; }
  .side a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink2); }
  .side a:hover { background: var(--soft); }
  .side a.on { background: var(--soft); color: var(--ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--red); }
  .side a .n { margin-left: auto; background: var(--red); color: #fff; border-radius: 9px; font: 700 11px/18px system-ui; padding: 0 6px; }
  .side .sep { height: 1px; background: var(--line); margin: 10px 8px; }
  .side .who { margin-top: auto; padding: 10px 12px; font-size: 13px; color: var(--ink2); }
  .tabs { display: none; }
  .top .logo { display: none; }
  main { padding: 24px 32px 40px; }
}

/* ---------- 카드·목록 ---------- */
.card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #fff; }
.card.soft { background: var(--soft); border-color: transparent; }
.card h2 + *, .card h3 + * { margin-top: 10px; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--soft); border-radius: 12px; padding: 12px 10px; text-align: center; }
.stat b { display: block; font-size: 22px; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--ink2); }
.stat.hot b { color: var(--red); }
.list { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.list > .it { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-top: 1px solid var(--line); background: #fff; cursor: pointer; }
.list > .it:first-child { border-top: 0; }
.list > .it:hover { background: #fbfbfc; }
.list .empty { padding: 22px; text-align: center; color: var(--mute); }
.it .t { font-weight: 600; } .it .s { font-size: 12.5px; color: var(--mute); }
.chip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--ink2); white-space: nowrap; }
.chip.pending { background: #fff3e8; color: var(--orange); }
.chip.approved { background: #e9f6ee; color: var(--ok); }
.chip.rejected { background: #fdeceb; color: var(--red); }
.chip.draft, .chip.withdrawn { background: #eef0f3; color: var(--ink2); }
.chip.pin { background: #fdeceb; color: var(--red); }
.seg { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.seg button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; cursor: pointer; white-space: nowrap; font-weight: 600; color: var(--ink2); }
.seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.head h1 { flex: 1 1 auto; min-width: 8em; }
/* 데모 v1: 휴대폰 폭에서 제목(워크플로우·주간 동료 일정 등)이 한 글자씩 꺾이지 않게 */
.row:has(> h3), .row:has(> h2) { flex-wrap: wrap; }
.row > h3, .row > h2 { min-width: 7em; }
.back { border: 0; background: none; font-size: 20px; cursor: pointer; padding: 2px 6px 2px 0; }
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-weight: 700; color: var(--ink2); flex: none; font-size: 14px; }

/* 결재선 */
.line { display: flex; gap: 6px; flex-wrap: wrap; }
.step { flex: 1; min-width: 92px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.step .who { font-weight: 700; } .step .st { font-size: 12px; margin-top: 2px; }
.step.approved { border-color: #bfe3cc; background: #f3fbf6; } .step.approved .st { color: var(--ok); }
.step.rejected { border-color: #f4c3c1; background: #fdf4f3; } .step.rejected .st { color: var(--red); }
.step.pending { border-color: var(--orange); } .step.pending .st { color: var(--orange); font-weight: 700; }
dl.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; margin: 0; }
dl.kv dt { color: var(--mute); font-size: 13px; } dl.kv dd { margin: 0; white-space: pre-wrap; word-break: break-word; }

/* 출퇴근 */
.clock { text-align: center; padding: 22px 16px; }
.clock .time { font: 700 40px/1.1 system-ui, sans-serif; letter-spacing: -.01em; }
.clock .date { color: var(--ink2); margin-top: 4px; }
.clock .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.bar { height: 10px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink2); }
.bar.warn > i { background: var(--orange); } .bar.over > i { background: var(--red); }

/* 채팅 */
.chatwrap { display: flex; flex-direction: column; height: calc(100vh - 150px - var(--safe-b)); }
@media (min-width: 900px) { .chatwrap { height: calc(100vh - 110px); } }
.msgs { flex: 1; overflow-y: auto; padding: 8px 2px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 82%; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg .nm { font-size: 12px; color: var(--mute); margin-bottom: 2px; }
.msg .bb { background: var(--soft); border-radius: 14px; padding: 9px 12px; white-space: pre-wrap; word-break: break-word; }
.msg.me .bb { background: #fff3e8; }
.msg .meta { font-size: 11px; color: var(--mute); margin-top: 2px; display: flex; gap: 6px; }
.msg .meta .ur { color: var(--orange); font-weight: 700; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding-top: 8px; border-top: 1px solid var(--line); }
.composer textarea { min-height: 44px; height: 44px; }
.file { display: inline-flex; gap: 6px; align-items: center; text-decoration: underline; }

/* 체크 목록 (참조자·채팅 상대 고르기) */
.picks { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.picks label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.picks label:first-child { border-top: 0; }

/* 알림 띠·대화상자 */
.toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 50; font-size: 14px; max-width: 90vw; }
@media (min-width: 900px) { .toast { bottom: 28px; } }
.modal { position: fixed; inset: 0; background: rgba(15,18,24,.45); display: grid; place-items: end center; z-index: 40; }
.modal .sheet { background: #fff; width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); max-height: 88vh; overflow-y: auto; }
@media (min-width: 700px) { .modal { place-items: center; } .modal .sheet { border-radius: 18px; } }

/* 인쇄 (재직증명서·업체 제출용) */
.paper { max-width: 720px; margin: 0 auto; padding: 48px 40px; border: 1px solid var(--line); background: #fff; }
.paper h1 { text-align: center; font-size: 26px; letter-spacing: .4em; margin: 10px 0 30px; }
.paper table { width: 100%; border-collapse: collapse; }
.paper td { border: 1px solid #999; padding: 10px; }
.paper td:first-child { width: 120px; background: #f5f5f5; font-weight: 600; }
.paper .foot { text-align: center; margin-top: 48px; font-size: 18px; }
.paper .foot img { height: 34px; display: block; margin: 16px auto 0; }
.side .chip.demo { align-self: flex-start; margin: -12px 0 12px 12px; }
/* 견적 업무 흐름 */
.chip.orange { background: #fff3e8; color: var(--orange); }
.chip.st-hold { background: #fdeceb; color: var(--red); }
.chip.st-design, .chip.st-pricing, .chip.st-approval { background: #fff3e8; color: var(--orange); }
.chip.st-reply { background: #fdeceb; color: var(--red); }
.chip.st-sent { background: #e9f6ee; color: var(--ok); }
.pipe { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.pipe li { font-size: 11.5px; text-align: center; padding: 8px 2px; border-radius: 8px; background: var(--soft); color: var(--mute); line-height: 1.25; }
.pipe li.done { background: #e9f6ee; color: var(--ok); font-weight: 700; }
.pipe li.now { background: var(--orange); color: #fff; font-weight: 700; }
.pipe li.hold { background: var(--red); color: #fff; font-weight: 700; }
@media (max-width: 520px) { .pipe { grid-template-columns: repeat(3, 1fr); } }
.card.bad { border-color: #f3b4b1; background: #fffafa; }
.card.warnbox { border-color: #f6c89f; background: #fffaf5; }
.card ul, .card ol { margin: 0; padding-left: 20px; }
.mailbody { white-space: pre-wrap; background: var(--soft); border-radius: 10px; padding: 12px; font-size: 14px; line-height: 1.6; word-break: break-word; }
code { font-size: 12.5px; background: var(--soft); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.tbl th { color: var(--mute); font-weight: 600; font-size: 12px; }
table.tbl td:last-child, table.tbl th:last-child { text-align: right; }
table.tbl tr.sum td { font-weight: 800; border-bottom: 0; }
ol.hist li { margin: 4px 0; }
ul.files { max-height: 260px; overflow: auto; margin: 8px 0 0; padding-left: 18px; }
details summary { cursor: pointer; font-weight: 700; }
a.card.row { color: inherit; }
/* 급여·평가 */
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.big { display: block; font-size: 26px; font-weight: 800; margin-top: 2px; }
table.tbl td .btn { padding: 4px 10px; font-size: 12px; margin-top: 4px; }
.pipe li.now { background: var(--orange); }
@media print { .top, .tabs, .side, .noprint { display: none !important; } body.shell #app { display: block; } main { padding: 0; } .paper { border: 0; } }
.side .coname { margin: -6px 0 8px 4px; }

/* ---------- 플렉스 반영(11-20) ---------- */
.seg.wrap { flex-wrap: wrap; overflow: visible; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar > input, .toolbar > select { width: auto; flex: 1 1 150px; min-width: 0; }
.grouph { font-weight: 700; font-size: 13px; color: var(--ink2); padding: 10px 14px 6px; background: var(--soft); border-top: 1px solid var(--line); }
.list > .grouph:first-child { border-top: 0; }
.faces { display: flex; gap: 4px; margin-top: 6px; }
.face { width: 26px; height: 26px; border-radius: 50%; background: var(--soft); border: 1px solid var(--line); font-size: 10px; display: grid; place-items: center; color: var(--ink2); }
.face.approved { background: #e9f6ee; border-color: #9bd3ae; } .face.pending { background: #fff3e8; border-color: #f3c27a; } .face.rejected { background: #fdeceb; border-color: #f1a1a1; }
.viewchip { display: inline-flex; align-items: center; gap: 4px; } .viewchip .x { border: 0; background: none; cursor: pointer; color: var(--mute); padding: 0 2px; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.pcard { border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; background: #fff; text-align: left; font: inherit; color: inherit; }
.pcard:hover { border-color: var(--ink2); } .pcard b { display: block; font-size: 22px; margin: 4px 0; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .h { text-align: center; font-size: 12px; color: var(--mute); }
.cal .d { padding: 8px 0; text-align: center; border-radius: 8px; cursor: pointer; font-size: 14px; }
.cal .d:hover { background: var(--soft); } .cal .d.off { color: var(--red); } .cal .d.rng { background: #eef0f3; } .cal .d.sel { background: var(--ink); color: #fff; } .cal .d.blank { cursor: default; background: none; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 7px 6px; text-align: right; white-space: nowrap; }
table.grid th { color: var(--ink2); font-weight: 600; background: var(--soft); }
table.grid th:first-child, table.grid td:first-child { text-align: left; }
.tt { display: grid; grid-template-columns: 70px 1fr 48px; gap: 6px; align-items: center; font-size: 12px; }
.tt .off { color: var(--red); }
.track { position: relative; height: 22px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.track i { position: absolute; display: block; }
.track .tick { top: 0; bottom: 0; width: 1px; background: #e2e5ea; }
.track .seg-w { top: 4px; bottom: 4px; background: #4a7bd8; border-radius: 4px; }
.track .seg-b { top: 4px; bottom: 4px; background: #f2b84b; }
.track .seg-e { top: 0; height: 4px; background: #1f8a4c; } .track .seg-e.pending { background: var(--orange); } .track .seg-e.rejected, .track .seg-e.withdrawn { background: #bbb; }
i.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; } i.lg.w { background: #4a7bd8; } i.lg.b { background: #f2b84b; } i.lg.e { background: #1f8a4c; }
.week7 { display: grid; grid-template-columns: repeat(7, minmax(92px, 1fr)); gap: 6px; overflow-x: auto; }
.week7 .dcol { border: 1px solid var(--line); border-radius: 10px; padding: 6px; min-height: 96px; font-size: 12px; }
.week7 .dcol.today { border-color: var(--ink); box-shadow: inset 0 3px 0 var(--red); }
.week7 .hd { font-weight: 700; margin-bottom: 4px; } .week7 .hd.off { color: var(--red); }
.week7 .ev { background: #eef4ff; border-radius: 6px; padding: 2px 5px; margin-top: 3px; } .week7 .ev.lv { background: #e9f6ee; }
.praise { border-top: 1px solid var(--line); padding-top: 10px; }
.palette { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 60; display: flex; justify-content: center; align-items: flex-start; padding-top: 10vh; }
.palette .box { background: #fff; width: min(560px, 94vw); border-radius: 14px; padding: 12px; max-height: 72vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.palette .sec { font-size: 12px; color: var(--mute); margin: 10px 6px 4px; }
.palette .row1 { padding: 9px 8px; border-radius: 8px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.palette .row1:hover { background: var(--soft); }
.searchbtn { justify-content: flex-start; margin: 0 4px 8px; font-weight: 500; color: var(--ink2); }
.emo { display: flex; gap: 6px; flex-wrap: wrap; }
.emo button { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 4px 10px; cursor: pointer; }
.emo button.on { background: #eef4ff; border-color: #7aa7f7; }
.sealbox { text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px; min-width: 100px; }
.sealimg { width: 72px; height: 72px; display: block; margin: 0 auto; }
.paper .foot .sealimg { height: 72px; width: 72px; }
.demo-wm { position: relative; }
.top .sideopen { display: none; }
@media (min-width: 900px) {
  body.sidecollapsed #app { grid-template-columns: 1fr !important; }
  body.sidecollapsed .side { display: none !important; }
  body.sidecollapsed .top .sideopen { display: inline-block; }
}

/* AI 물어보기 (11-23) */
.ai-q { align-self: flex-end; margin-left: auto; width: fit-content; max-width: 80%; background: var(--red, #E31F26); color: #fff; border-radius: 16px 16px 4px 16px; padding: 9px 14px; white-space: pre-wrap; word-break: break-word; }
.ai-a { max-width: 92%; width: fit-content; min-width: 60%; }
.ai-text { white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.ai-blocked { background: #fff4ec; border-color: #f3c9a8; }
.ai-box textarea { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; }

/* 플로어(floor) 표기 (11-23 과장님 결정) */
.brandmark { font-size: 13px; color: var(--ink2, #444); margin: 2px 0 0; letter-spacing: .02em; }
.brandmark b, .brand b { color: #E31F26; font-weight: 800; letter-spacing: .04em; }
.lead.brand { font-size: 16px; }

/* 주간 업무 (11-24) */
.pre { white-space: pre-wrap; word-break: break-word; }
.grid.weekly textarea { width: 100%; box-sizing: border-box; font: inherit; resize: vertical; min-height: 44px; }
.grid.weekly td:first-child { white-space: nowrap; width: 64px; }
.grid.weekly th, .grid.small th { text-align: left; }
@media (max-width: 600px) {
  .weeknav b { flex-basis: 100%; order: -1; }
  .grid.weekly, .grid.weekly tbody, .grid.weekly tr, .grid.weekly td { display: block; width: auto; }
  .grid.weekly tr:first-child { display: none; }
  .grid.weekly td:first-child { font-weight: 700; padding-top: 10px; border: 0; }
  .grid.weekly td { border: 0; padding: 2px 0; }
}
.chipbtn { border: 1px solid var(--line, #dde); background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chipbtn:hover { background: #fff4ec; }
.grid.small td, .grid.weekly td { text-align: left; }
