
:root {
  --bg: #f5f6fa; --surface: #ffffff; --surface-2: #f8fafc; --line: #e5e7eb; --line-2: #eef0f4;
  --ink: #111827; --ink-2: #4b5563; --muted: #6b7280;
  --accent: #4f46e5; --accent-2: #eef2ff; --accent-ink: #3730a3;
  --head: #1e1b4b; --head-ink: #e0e7ff;
  --ok: #047857; --ok-bg: #ecfdf5; --warn: #b45309; --warn-bg: #fffbeb; --bad: #b91c1c; --bad-bg: #fef2f2;
  --bar: #6366f1;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117; --surface: #171a22; --surface-2: #1d212b; --line: #2a2f3a; --line-2: #232833;
    --ink: #e5e7eb; --ink-2: #b6bcc8; --muted: #8b93a3;
    --accent: #818cf8; --accent-2: #232650; --accent-ink: #c7d2fe;
    --head: #12102e; --head-ink: #e0e7ff;
    --ok: #34d399; --ok-bg: #0f2a22; --warn: #fbbf24; --warn-bg: #2b2210; --bad: #f87171; --bad-bg: #2d1515;
    --bar: #818cf8;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 13px/1.65 "Noto Sans KR", -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; letter-spacing: -0.01em; word-break: keep-all; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.3; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
small, .muted { color: var(--muted); }

/* 머리글 */
.top { background: linear-gradient(90deg, #4338ca, #312e81); color: #fff; position: sticky; top: 0; z-index: 40; }
.top .in { max-width: 1328px; margin: 0 auto; padding: 8px 24px; min-height: 60px; display: flex; align-items: center; gap: 0 24px; }
.logo { display: flex; align-items: baseline; gap: 6px; flex-shrink: 0; color: #fff; }
.logo:hover { text-decoration: none; }
.logo b { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; }
.logo span { font-size: 12px; color: #c7d2fe; }
.hd-nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; font-size: 14px; font-weight: 500; scrollbar-width: none; }
.hd-nav a { color: #e0e7ff; padding: 8px 12px; border-radius: 8px; white-space: nowrap; transition: background .15s; }
.hd-nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.hd-nav a.on { background: rgba(255,255,255,.15); color: #fff; font-weight: 600; }
.top .who { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.top .avatar { width: 32px; height: 32px; border-radius: 50%; background: #fff; color: #4338ca; display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.top .who-t { line-height: 1.25; }
.top .who-t b { display: block; font-size: 13px; font-weight: 500; }
.top .who-t small { display: block; font-size: 11px; color: #c7d2fe; }
@media (max-width: 760px) { .top .in { padding: 8px 12px; gap: 0 12px; } .top .who-t { display: none; } }

main { max-width: 1280px; margin: 0 auto; padding: 22px 76px 60px 16px; }
@media (max-width: 760px) { main { padding-right: 16px; padding-bottom: 90px; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 14px; }
.grid > .card { margin-top: 0; }
.grid { display: grid; gap: 14px; }
.grid.tiles { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.tile:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(79,70,229,.12); text-decoration: none; }
.tile .ic { font-size: 24px; }
.tile b { display: block; margin-top: 6px; font-size: 15px; }
.tile span { color: var(--muted); font-size: 13px; }

.kpi .v { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 13px; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 8px 13px; font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 9px; font-size: 13px; }

.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); }
.pills a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pills a:hover { text-decoration: none; border-color: var(--accent); }

table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
table.t th { color: var(--muted); font-weight: 600; font-size: 12.5px; background: var(--surface-2); position: sticky; top: 0; }
table.t tr:hover td { background: var(--surface-2); }
.scroll { overflow-x: auto; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--accent-2); color: var(--accent-ink); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.gray { background: var(--line-2); color: var(--ink-2); }

.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--bad-bg); color: var(--bad); }
.notice { padding: 11px 14px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); margin-bottom: 14px; }

form.f label { display: block; font-size: 13px; color: var(--ink-2); margin: 0 0 4px; }
form.f .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 14px; margin-bottom: 12px; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks label { display: flex; align-items: center; gap: 6px; color: var(--ink); margin: 0; }

/* 로그인 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(160deg, #1e1b4b, #312e81 55%, #4338ca); }
.login { width: 100%; max-width: 380px; background: var(--surface); border-radius: 14px; padding: 30px 26px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.login h1 { font-size: 20px; margin-bottom: 4px; }
.login p { margin: 0 0 20px; color: var(--muted); }
.login .fld { margin-bottom: 12px; }
.login .btn { width: 100%; justify-content: center; padding: 11px; }

/* 아바타 */
.av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; font-weight: 700; color: #fff; font-size: 15px; background: var(--bar); }
.av.lg { width: 96px; height: 96px; font-size: 30px; }
.av.sm { width: 28px; height: 28px; font-size: 12px; }

/* 내 업무 */
.work li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.work ul { list-style: none; margin: 0; padding: 0; }
.work .ti { flex: 1; min-width: 0; }
.work .ti a { color: var(--ink); font-weight: 600; }
.work .ti small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due.over { color: var(--bad); font-weight: 600; }
.due.soon { color: var(--warn); font-weight: 600; }

/* 조직도 */
.org { overflow-x: auto; padding: 8px 4px 20px; }
.org ul { list-style: none; margin: 0; padding: 22px 0 0; display: flex; justify-content: center; position: relative; }
.org li { position: relative; padding: 22px 8px 0; display: flex; flex-direction: column; align-items: center; }
.org li::before, .org li::after { content: ''; position: absolute; top: 0; width: 50%; height: 22px; border-top: 2px solid var(--line); }
.org li::before { right: 50%; } .org li::after { left: 50%; border-left: 2px solid var(--line); }
.org li:only-child::before, .org li:only-child::after { display: none; }
.org li:only-child { padding-top: 0; }
.org li:first-child::before, .org li:last-child::after { border: 0 none; }
.org li:last-child::before { border-right: 2px solid var(--line); border-radius: 0 8px 0 0; }
.org li:first-child::after { border-radius: 8px 0 0 0; }
.org ul ul::before { content: ''; position: absolute; top: 0; left: 50%; border-left: 2px solid var(--line); height: 22px; }
.org > ul { padding-top: 0; }
.unit { background: var(--surface); border: 1px solid #cfd4dc; border-radius: 12px; min-width: 200px; max-width: 260px; overflow: hidden; }
.unit .uh { background: var(--accent-2); color: var(--accent-ink); font-weight: 700; padding: 8px 12px; display: flex; justify-content: space-between; gap: 8px; }
.unit .uh small { color: var(--accent-ink); opacity: .75; font-weight: 500; }
.unit .mem { padding: 6px; }
.person { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; cursor: pointer; text-align: left; width: 100%; background: none; border: 0; font: inherit; color: var(--ink); }
.person:hover { background: var(--surface-2); }
.person b { display: block; font-size: 14px; }
.person small { display: block; font-size: 12px; }
.ceo > .unit { border-color: #aab1bd; } /* 대표 칸만 조금 진한 회색 (부서 칸은 회색 선) */
.org li::before, .org li::after, .org ul ul::before { border-color: #cfd4dc !important; }
/* 조직도: 오늘 자리 비움 (휴가 · 출장) */
.person .away { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 600; vertical-align: 1px; }
.person .away.leave { background: #dcfce7; color: #166534; } .person .away.trip { background: #e0f2fe; color: #075985; } .person .away.pend { opacity: .65; }
.person.is-away .av { opacity: .55; }
.ceo .person { padding: 10px; }

/* 막대(인력현황): 한 계열, 한 색, 값 직접 표기 */
.bars { display: grid; grid-template-columns: minmax(80px, max-content) 1fr 36px; gap: 8px 10px; align-items: center; }
.bars .lb { color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars .tr { height: 14px; position: relative; }
.bars .b { height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 2px; }
.bars .n { font-variant-numeric: tabular-nums; color: var(--ink); font-size: 13px; text-align: right; }
.bars .tr:hover .b { filter: brightness(1.12); }

dialog { border: 0; border-radius: 14px; padding: 0; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(15, 17, 23, .45); }
dialog .dh { padding: 22px 22px 0; display: flex; gap: 16px; align-items: center; }
dialog .db { padding: 16px 22px 22px; }
dialog dl { display: grid; grid-template-columns: 80px 1fr; gap: 6px 10px; margin: 0; }
dialog dt { color: var(--muted); }
dialog dd { margin: 0; word-break: break-all; }

@media (max-width: 760px) {
  main { padding: 16px 12px 50px; }
  .hide-m { display: none; }
}

/* 공지 */
.notice-body { white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.75; font-size: 14px; }

/* 홈 대시보드 */
.dash-kpi { margin-bottom: 14px; }
.kpi-card { display: block; color: var(--ink); padding: 14px 16px; }
.kpi-card:hover { border-color: var(--accent); text-decoration: none; }
.kpi-card .l { color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi-card .v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--accent-ink); }
.kpi-card .s { color: var(--muted); font-size: 12px; }
.card + .card.kpi-card, .dash .card + .card { margin-top: 0; }
.dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.dash .wide { grid-column: 1 / -1; }
@media (max-width: 1100px) { .dash { grid-template-columns: 1fr; } }
.dash-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.dash-h h2 { margin: 0; font-size: 15px; font-weight: 600; }
.dash-h a, .dash-h span { font-size: 12.5px; }
.dash-card .empty { margin: 6px 0 2px; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.dash-list li:last-child { border-bottom: 0; }
.dash-list .ti { flex: 1; min-width: 0; }
.dash-list .ti a { color: var(--ink); font-weight: 600; }
.dash-list .ti small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-list .st { color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.dash-card .more { margin: 8px 0 0; font-size: 12.5px; }
.mini-kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.mk-col { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.mk-h { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px; font-size: 13px; }
.mk-h span { background: var(--surface); border-radius: 99px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.mk-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--ink); }
.mk-card:hover { border-color: var(--accent); text-decoration: none; }
.mk-card b { display: block; font-weight: 600; font-size: 13px; }
.mk-card small, .mk-card .due { display: block; font-size: 12px; }
.mini-kanban.two { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 600px) { .mini-kanban.two { grid-template-columns: 1fr; } }
.mk-empty { margin: 4px 4px 6px; font-size: 12.5px; }

/* 게시판 댓글 */
.comment { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.comment .ch { margin-bottom: 4px; display: flex; gap: 8px; align-items: baseline; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.linkish:hover { color: var(--bad); text-decoration: underline; }


/* 홈: 바탕을 조금 어둡게 해서 흰 카드가 구분되게 */
body.home { background: #dfe2ec; }
body.home .card { border-color: #dfe2ec; box-shadow: 0 1px 3px rgba(30, 27, 75, .07); }
body.home .mk-col { background: #f1f2f8; border-color: #e3e5ef; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.home { background: #0b0d12; }
}

/* 홈 숫자 요약: 상자 하나에 네 칸 (회색 계열) */
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; border-radius: var(--radius);
  overflow: hidden; border: 1px solid #dfe2ec; box-shadow: 0 1px 3px rgba(30, 27, 75, .07); }
.stat-strip a { display: flex; flex-direction: column; gap: 2px; padding: 14px 20px; color: #2b2d36; background: var(--p); transition: filter .15s; position: relative; }
.stat-strip a + a::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: #dcdfe5; }
/* 회색 계열: 칸마다 아주 조금씩 다른 회색 */
.stat-strip a:nth-child(1) { --p: #f4f5f7; }
.stat-strip a:nth-child(2) { --p: #eef0f3; }
.stat-strip a:nth-child(3) { --p: #f4f5f7; }
.stat-strip a:nth-child(4) { --p: #eef0f3; }
.stat-strip a:hover { filter: brightness(.97); text-decoration: none; }
.stat-strip .l { font-size: 12.5px; color: #5b6070; font-weight: 600; }
.stat-strip b { font-size: 28px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; color: #23252e; }
.stat-strip small { font-size: 12px; color: #6b7080; }
.stat-strip small.warn { color: #b0413e; font-weight: 600; }
@media (max-width: 760px) { .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 문서 관리 ---------- */
.dlayout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .dlayout { grid-template-columns: 1fr; } }
.dside { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 10px; position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: auto; }
.dspace-pick select { margin-bottom: 8px; }
.droot { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; color: var(--ink); }
.droot .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.droot.on, .dt a.on { background: var(--accent-2); color: var(--accent-ink); }
.droot:hover, .dt a:hover { background: var(--surface-2); text-decoration: none; }
.dt { list-style: none; margin: 0; padding: 0 0 0 12px; }
.dt li { margin: 1px 0; }
.dt details > summary { list-style: none; cursor: pointer; }
.dt details > summary::-webkit-details-marker { display: none; }
.dt details > summary::before { content: ''; display: inline-block; width: 0; height: 0; border: 4px solid transparent; border-left: 5px solid var(--muted); margin: 0 3px 0 0; transition: transform .12s; vertical-align: middle; }
.dt details[open] > summary::before { transform: rotate(90deg); }
.dt a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 7px; color: var(--ink); max-width: calc(100% - 12px); }
.dt a.leaf { margin-left: 12px; }
.dt a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt a small { color: var(--muted); font-size: 11px; }
.dside-foot { border-top: 1px solid var(--line-2); margin-top: 10px; padding-top: 10px; display: grid; gap: 8px; font-size: 12.5px; }
.dempty-tree { font-size: 12.5px; margin: 6px 8px; }
svg.flag { width: 15px; height: 15px; flex: none; fill: #e5484d; stroke: #b42318; stroke-width: 1.2; stroke-linejoin: round; }
svg.flag.lg { width: 22px; height: 22px; margin-right: 6px; vertical-align: -3px; }
svg.fold { width: 15px; height: 15px; flex: none; fill: #c7d2fe; stroke: #6366f1; stroke-width: 1.2; }
.btn svg.flag { margin-right: 2px; }
.dcrumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.dcrumbs a { color: var(--muted); }
.dtitle { display: flex; align-items: center; gap: 6px; }
.dacts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dacts form { margin: 0; }
.dflags { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 14px; }
.dflags a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fff5f5; border: 1px solid #f6d5d5; border-radius: 10px; color: var(--ink); }
.dflags a:hover { border-color: #e5484d; text-decoration: none; }
.dflags span { flex: 1; min-width: 0; }
.dflags b { display: block; font-size: 13.5px; }
.dflags small { display: block; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dflags em { font-style: normal; color: var(--muted); font-size: 12px; }
.dname { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; }
.dkind { display: inline-grid; place-items: center; min-width: 36px; height: 20px; padding: 0 4px; border-radius: 4px; background: var(--accent-2); color: var(--accent-ink); font-size: 10.5px; font-weight: 700; letter-spacing: .02em; flex: none; }
.dkind.lg { min-width: 44px; height: 26px; font-size: 12px; margin-right: 4px; }
.btn.dlatest { color: var(--accent-ink); border-color: #c7d2fe; background: var(--accent-2); font-weight: 600; }
.drow-folder td { background: #fafbfe; }
.dlatest-card { display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; border-color: #c7d2fe; background: #f7f8ff; }
.dlatest-card .dfile { display: block; font-size: 15px; margin: 6px 0 2px; word-break: break-all; }
.dupload { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 8px; align-items: end; }
@media (max-width: 760px) { .dupload { grid-template-columns: 1fr; } }
.dfoot { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-top: 14px; font-size: 13px; }
.dfoot summary { cursor: pointer; color: var(--ink-2); }
.dspaces { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.dspace { display: flex; gap: 12px; align-items: flex-start; color: var(--ink); }
a.dspace:hover { border-color: var(--accent); text-decoration: none; }
.dspace + .dspace, .dspaces .card + .card { margin-top: 0; }
.dspace b { display: block; font-size: 15px; }
.dspace small { display: block; }
.dspace.new { display: block; }
.dspace.new summary { display: flex; gap: 12px; align-items: center; cursor: pointer; list-style: none; }
.dmark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: #fff; font-weight: 700; font-size: 17px; flex: none; }
.dmark.plus { background: var(--accent-2); color: var(--accent-ink); font-size: 22px; }
.dcolors { display: flex; gap: 8px; }
.dcolors input { position: absolute; opacity: 0; }
.dcolors span { display: inline-block; width: 26px; height: 26px; border-radius: 7px; cursor: pointer; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.dcolors input:checked + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.dcolors input:focus-visible + span { outline: 2px solid var(--accent); }
dialog .db { padding: 22px; }

/* 화면을 가득 쓰는 페이지 (문서 관리 등): 업무 관리처럼 폭 제한 없이 */
body.wide .top .in { max-width: none; }
body.wide main { max-width: none; padding: 18px 76px 40px 20px; }
@media (max-width: 760px) { body.wide main { padding: 12px 12px 90px; } }
body.wide .dlayout { grid-template-columns: 280px minmax(0, 1fr); }
@media (max-width: 900px) { body.wide .dlayout { grid-template-columns: 1fr; } }

/* 문서 관리: 끌어다 놓기 */
.dhint { font-size: 12.5px; margin: -4px 0 12px; }
.dempty-drop { border: 2px dashed #c7d2fe; border-radius: 10px; padding: 34px 16px; text-align: center; color: var(--muted); background: #fafbff; }
.ddrop { position: fixed; inset: 0; z-index: 2147482000; background: rgba(79, 70, 229, .10); border: 3px dashed #6366f1; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.ddrop-box { background: #fff; border-radius: 14px; padding: 20px 28px; box-shadow: 0 16px 40px rgba(30, 27, 75, .25); text-align: center; }
.ddrop-box b { display: block; font-size: 17px; color: var(--accent-ink); }
.ddrop-box small { display: block; color: var(--muted); margin-top: 4px; }
.drop-on, tr.drop-on td { background: #e0e7ff !important; outline: 2px solid #6366f1; outline-offset: -2px; }
.dprogress { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 2147482001; background: #1e1b4b; color: #fff; padding: 10px 18px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 13px; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 문서 관리: 왼쪽 목록의 문서 · 오른쪽 미리보기 */
.dt a.ddoc { color: var(--ink-2); font-weight: 400; }
.dt a.ddoc.on { color: var(--accent-ink); font-weight: 600; }
.dkind.sm { min-width: 30px; height: 17px; font-size: 9.5px; }
.dpreview { padding: 0; overflow: hidden; background: #f3f4f7; }
.dpreview iframe { display: block; width: 100%; height: 75vh; border: 0; background: #fff; }
.dpreview img { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto; }
.dpreview video { display: block; width: 100%; max-height: 75vh; background: #000; }
.dpreview audio { display: block; width: calc(100% - 32px); margin: 16px; }
.dnopreview { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 16px; text-align: center; color: var(--muted); }
.dnopreview p { margin: 0; }
body.wide .dside { max-height: calc(100vh - 90px); }
.ddrop[hidden], .dprogress[hidden] { display: none; }

/* 문서 관리: 등록·폴더 창 */
dialog.ddlg { width: min(540px, calc(100vw - 32px)); border-radius: 16px; padding: 0; box-shadow: 0 24px 64px rgba(15, 17, 40, .35); }
dialog.ddlg::backdrop { background: rgba(17, 19, 40, .45); backdrop-filter: blur(2px); }
.ddlg-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line-2); }
.ddlg-h h2 { margin: 0 0 6px; font-size: 18px; }
.ddlg-where { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: 12px; }
.ddlg-where .dot { width: 8px; height: 8px; border-radius: 3px; }
.ddlg-x { border: 0; background: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 8px; }
.ddlg-x:hover { background: var(--surface-2); color: var(--ink); }
.ddlg-b { padding: 18px 22px 6px; display: grid; gap: 14px; }
.ddlg-f { display: grid; gap: 6px; font-size: 13px; }
.ddlg-f > span { color: var(--ink-2); font-weight: 600; }
.ddlg-f em { font-style: normal; font-weight: 400; color: var(--muted); margin-left: 4px; font-size: 12px; }
.ddlg-check { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.ddlg-check:has(input:checked) { border-color: #f3b4b6; background: #fff7f7; }
.ddlg-check input { margin-top: 3px; }
.ddlg-check svg.flag { margin-top: 2px; }
.ddlg-check b { display: block; font-size: 13.5px; }
.ddlg-check small { display: block; color: var(--muted); font-size: 12px; }
.ddlg-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 22px 20px; }
.ddlg-note { margin-right: auto; font-size: 12px; }
.dz { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; border: 2px dashed #c7d2fe; border-radius: 12px; background: #fafbff; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.dz:hover, .dz.over { background: #eef2ff; border-color: #6366f1; }
.dz.has { border-style: solid; border-color: #a5b4fc; background: #f5f6ff; }
.dz input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dz svg { width: 34px; height: 34px; fill: none; stroke: #6366f1; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dz b { font-size: 14px; color: var(--ink); word-break: break-all; }
.dz small { color: var(--muted); font-size: 12px; }
@media (max-width: 560px) { .ddlg-note { display: none; } }
.dz-list { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; max-width: 420px; text-align: left; position: relative; z-index: 1; pointer-events: none; }
.dz-list li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 10px; margin-top: 4px; background: #fff; border: 1px solid #e0e7ff; border-radius: 7px; font-size: 12.5px; }
.dz-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-list li em { font-style: normal; color: var(--muted); flex: none; }
.dz-list li.big { border-color: #f3b4b6; color: #b0413e; }
.dz-list li.more { justify-content: center; color: var(--muted); }
.ddlg-f[hidden], .dz-list[hidden] { display: none; }

/* 사진 없는 사람 표시: 연한 회색 원 */
span.av { background: #e5e7eb; color: #4b5563; }

/* 문서 관리: 문서 아이콘(확장자 표시 대신) · 너비 조절 · 끌어 옮기기 · 최종본 보기 */
svg.doci { width: 16px; height: 16px; flex: none; fill: #eef2ff; stroke: #6366f1; stroke-width: 1.4; stroke-linejoin: round; }
svg.doci.lg { width: 26px; height: 26px; }
.dash-list li svg.doci { width: 18px; height: 18px; }
.dlayout { --side-w: 280px; }
body.wide .dlayout { grid-template-columns: var(--side-w) minmax(0, 1fr); }
.dside { position: sticky; }
.dside-resize { position: absolute; top: 0; right: 0; width: 10px; height: 100%; cursor: col-resize; z-index: 5; }
.dside-resize::after { content: ''; position: absolute; left: 4px; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: transparent; transition: background .15s; }
.dside-resize:hover::after, .dside-resize:focus-visible::after, body.dresizing .dside-resize::after { background: #6366f1; }
body.dresizing { cursor: col-resize; user-select: none; }
body.dresizing iframe { pointer-events: none; }
.dside { overflow-x: hidden; }
.dt a[draggable=true] { cursor: grab; }
.dt a.dragging, a.dname.dragging { opacity: .45; }
.move-on, tr.move-on td { background: #e0e7ff !important; outline: 2px dashed #6366f1; outline-offset: -2px; }
.badge.dfinal { background: #4f46e5; color: #fff; font-weight: 600; }
tr.dver-final td { background: #f7f8ff; }
.dupload { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; align-items: stretch; }
.dupload-side { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.dupload-side .btn { align-self: flex-end; }
.dz.dz-sm { padding: 18px 14px; }
.dz.dz-sm svg { width: 26px; height: 26px; }
@media (max-width: 760px) { .dupload { grid-template-columns: 1fr; } }
.dview-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-width: 2px; }
.dview-bar.final { border-color: #6366f1; background: #f7f8ff; }
.dview-bar.old { border-color: #d6d9e0; background: #fafafa; }
.dview-tag { display: flex; align-items: baseline; gap: 8px; }
.dview-tag b { font-size: 22px; }
.dview-tag small { color: var(--muted); }
.dview-badge { display: inline-block; padding: 4px 12px; border-radius: 8px; font-weight: 700; font-size: 14px; }
.dview-badge.final { background: #4f46e5; color: #fff; }
.dview-badge.old { background: #e5e7eb; color: #4b5563; }
.dview-info { flex: 1; min-width: 200px; }
.dview-info b { display: block; font-size: 15px; }
.dview-body iframe { height: calc(100vh - 250px); min-height: 420px; }
.dview-body img { max-height: calc(100vh - 250px); }
.daccess-scope { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.daccess-scope .ddlg-check.on { border-color: #a5b4fc; background: #f5f6ff; }
.daccess-add { display: flex; gap: 8px; flex-wrap: wrap; }
.daccess-add select:first-of-type { flex: 1; min-width: 220px; }
.daccess-add select { width: auto; }

/* ---------- 메시지(채팅): 카카오톡 같은 모양, 파란색 ---------- */
.chat { --k-bg: #c5d7ec; --k-me: #3d82f6; --k-me-ink: #fff; --k-them: #fff;
  display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 150px); min-height: 480px; background: #fff;
  border: 1px solid #d5deea; border-radius: 16px; overflow: hidden; box-shadow: 0 6px 24px rgba(30, 58, 110, .08); }
@media (max-width: 860px) { .chat { grid-template-columns: 1fr; height: auto; } .chat-list { max-height: 280px; } .chat-room { height: 72vh; } }
.chat-list { border-right: 1px solid #e3e9f2; overflow-y: auto; background: #fff; }
.chat-list-h { display: flex; justify-content: space-between; align-items: center; padding: 18px 16px 12px; position: sticky; top: 0; background: #fff; z-index: 1; }
.chat-list-h b { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.chat-empty-list { padding: 8px 16px; font-size: 12.5px; }
.chat-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: var(--ink); }
.chat-item:hover { background: #f3f7fd; text-decoration: none; }
.chat-item.on { background: #e8f0fd; }
/* 둥근 네모 프로필 (카톡 느낌) */
.av.k-sq, .chat-item .av, .chat-h .av { width: 44px; height: 44px; border-radius: 16px; font-size: 13px; flex: none; object-fit: cover; }
.k-grp { position: relative; width: 44px; height: 44px; flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.k-grp .av { width: 21px; height: 21px; border-radius: 8px; font-size: 8.5px; }
.k-grp.n1 { grid-template-columns: 1fr; } .k-grp.n1 .av { width: 44px; height: 44px; border-radius: 16px; font-size: 13px; }
.k-grp.n2 .av:first-child { align-self: start; } .k-grp.n2 .av:last-child { align-self: end; }
.ci-t { flex: 1; min-width: 0; }
.ci-t b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-t small { display: block; color: #7b8494; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.ci-n { font-style: normal; font-weight: 400; color: #98a1b0; font-size: 12.5px; }
.ci-r { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.ci-r small { color: #98a1b0; font-size: 11px; }
.ci-r em { font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #ff4d4f; color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.chat-room { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--k-bg); }
.chat-none { margin: auto; display: grid; gap: 6px; text-align: center; padding: 40px; color: #44546b; }
.chat-h { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: rgba(197, 215, 236, .92); backdrop-filter: blur(4px); border-bottom: 1px solid rgba(0, 0, 0, .05); }
.chat-h b { display: block; font-size: 15.5px; font-weight: 700; color: #1d2a3b; }
.chat-h small { display: block; font-size: 12px; color: #52637a !important; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px 20px 14px; display: flex; flex-direction: column; }
.chat-day { text-align: center; margin: 16px 0 10px; }
.chat-day span { display: inline-block; padding: 4px 14px; border-radius: 999px; background: rgba(30, 50, 80, .18); color: #fff; font-size: 11.5px; }
.chat-sys { text-align: center; margin: 8px 0; }
.chat-sys span { display: inline-block; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .55); color: #44546b; font-size: 12px; }
/* 한 줄(행): 남 = 프로필 + (이름 · 말풍선) / 나 = 오른쪽 파란 말풍선 */
.k-row { display: flex; gap: 8px; margin-top: 10px; max-width: 78%; }
.k-row.cont { margin-top: 3px; }
.k-row.me { align-self: flex-end; justify-content: flex-end; }
.k-row.them { align-self: flex-start; }
.k-face { width: 40px; height: 40px; border-radius: 15px; flex: none; object-fit: cover; display: inline-grid; place-items: center; background: #e9eef6; color: #5b6b82; font-size: 12px; font-weight: 700; }
.k-face-sp { width: 40px; flex: none; }
.k-col { display: flex; flex-direction: column; min-width: 0; }
.k-row.me .k-col { align-items: flex-end; }
.k-name { font-size: 12.5px; color: #3c4a5d; margin: 1px 0 5px 2px; }
.k-line { display: flex; align-items: flex-end; gap: 6px; }
.k-row.me .k-line { flex-direction: row-reverse; }
.k-bubble { position: relative; padding: 8px 12px; border-radius: 16px; background: var(--k-them); color: #1d2533; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; font-size: 14px; max-width: 100%; box-shadow: 0 1px 1px rgba(0, 0, 0, .04); }
.k-row.me .k-bubble { background: var(--k-me); color: var(--k-me-ink); }
.k-row.me .k-bubble a { color: #e8f0ff; text-decoration: underline; }
/* 말꼬리: 묶음의 첫 말풍선에만 */
.k-bubble.tail::before { content: ''; position: absolute; top: 9px; width: 10px; height: 10px; background: inherit; }
.k-row.them .k-bubble.tail { border-top-left-radius: 4px; }
.k-row.them .k-bubble.tail::before { left: -5px; clip-path: polygon(100% 0, 0 0, 100% 100%); }
.k-row.me .k-bubble.tail { border-top-right-radius: 4px; }
.k-row.me .k-bubble.tail::before { right: -5px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.k-meta { display: flex; flex-direction: column; align-items: flex-start; flex: none; font-size: 10.5px; color: #52637a; line-height: 1.25; padding-bottom: 1px; }
.k-row.me .k-meta { align-items: flex-end; }
.k-row.notime .k-time { display: none; }
.chat-unread { font-style: normal; color: #1d5bd8; font-weight: 700; font-size: 11px; }
.chat-file { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border-radius: 16px; color: var(--ink); max-width: 300px; box-shadow: 0 1px 1px rgba(0, 0, 0, .04); }
.chat-file:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .1); }
.chat-file svg { width: 30px; height: 30px; flex: none; fill: #e8f0fd; stroke: #3d82f6; stroke-width: 1.4; }
.chat-file b { display: block; font-size: 13px; overflow-wrap: anywhere; }
.chat-file small { color: var(--muted); font-size: 11.5px; }
.chat-img img { display: block; max-width: 240px; max-height: 240px; border-radius: 14px; }
.chat-in { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px; background: #fff; border-top: 1px solid #e3e9f2; }
.chat-in textarea { flex: 1; resize: none; min-height: 42px; max-height: 160px; line-height: 1.45; border: 0; outline: 0; background: #fff; padding: 10px 6px; font-size: 14px; }
.chat-in textarea:focus { outline: 0; }
.k-send { flex: none; height: 38px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--k-me, #3d82f6); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.k-send:hover { filter: brightness(1.06); }
.chat-attach { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; color: #7b8494; flex: none; }
.chat-attach:hover { background: #f1f5fb; color: #3d82f6; }
.chat-attach svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-drop { position: absolute; inset: 0; background: rgba(61, 130, 246, .12); border: 3px dashed #3d82f6; display: grid; place-items: center; pointer-events: none; }
.chat-drop[hidden] { display: none; }
.chat-drop b { background: #fff; padding: 14px 22px; border-radius: 12px; color: #1d4ed8; box-shadow: 0 10px 30px rgba(30, 58, 110, .2); }
.chat-pick { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.chat-pick label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.chat-pick label[hidden] { display: none; }
.chat-pick label:has(input:checked) { background: #e8f0fd; }
.chat-pick b { display: block; font-size: 13px; }
.chat-pick small { display: block; font-size: 11.5px; }
.btn[hidden] { display: none; }

/* 문서 관리: 최종본 지정 · 체크해서 지우기 */
.dlatest-card.nofinal { border-color: var(--line); background: var(--surface); }
.btn.dmark-final { color: var(--accent-ink); border-color: #c7d2fe; }
.ddoc-li { display: flex; align-items: center; gap: 2px; }
.ddoc-li .dchk { margin: 0 0 0 10px; width: 14px; height: 14px; flex: none; opacity: .35; transition: opacity .12s; cursor: pointer; }
.ddoc-li:hover .dchk, .ddoc-li .dchk:checked, .ddoc-li .dchk:focus-visible { opacity: 1; }
.ddoc-li .dchk + a.leaf { margin-left: 2px; }
.dbulk { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 8px; border-radius: 10px; background: #fff5f5; border: 1px solid #f3c4c5; font-size: 12.5px; }
.dbulk[hidden] { display: none; }
.dbulk b { flex: 1; color: #b0413e; }
.dside-tip { font-size: 11.5px; margin: 8px 2px 0; }
.ddel-warn { display: grid; gap: 4px; padding: 12px 14px; border-radius: 10px; background: #fff5f5; border: 1px solid #f3c4c5; color: #7a2a28; font-size: 13px; }
.ddel-warn > b { font-size: 14.5px; color: #b0413e; }
.ddel-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.ddel-list li { padding: 7px 12px; border-bottom: 1px solid var(--line-2); font-size: 13px; overflow-wrap: anywhere; }
.ddel-list li:last-child { border-bottom: 0; }
.ddel-list li.more { color: var(--muted); text-align: center; }
.btn.danger-fill { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn.danger-fill:hover { background: #b91c1c; }
/* 모든 화면 공통 폭: 가운데 정렬, 내용은 최대 1440px, 좌우 여백 80px (오른쪽 떠 있는 메뉴와도 겹치지 않음) */
main, body.wide main { max-width: 1600px; margin: 0 auto; padding: 22px 80px 60px; }
.top .in, body.wide .top .in { max-width: 1600px; padding: 8px 80px; }
@media (max-width: 760px) { main, body.wide main { padding: 14px 16px 90px; } .top .in, body.wide .top .in { padding: 8px 12px; } }

/* 문서 관리: 되돌리기 알림 · 휴지통 */
.dundo { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 2147482002; display: flex; align-items: center; gap: 12px;
  background: #1e1b4b; color: #fff; padding: 10px 12px 10px 18px; border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .3); font-size: 13.5px; max-width: calc(100vw - 32px); }
.dundo[hidden] { display: none; }
.dundo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dundo .btn { background: #fff; color: #312e81; border-color: #fff; font-weight: 700; }
.dundo a { color: #c7d2fe; font-size: 12.5px; white-space: nowrap; }
.dundo .ddlg-x { color: #c7d2fe; }
.dtrash-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dtrash-bar label { display: flex; align-items: center; gap: 6px; margin-right: auto; font-size: 13px; }

/* 메시지: 화면에 가득 (머리글 아래 남은 높이·폭을 다 쓴다. 오른쪽 떠 있는 메뉴 자리만 비움) */
body.chatfull main { max-width: none; height: calc(100vh - 60px); display: flex; flex-direction: column; padding: 12px 80px 12px 12px; }
body.chatfull main > .notice, body.chatfull main > .flash { margin-bottom: 10px; flex: none; }
body.chatfull .chat { flex: 1; height: auto; min-height: 0; border-radius: 12px; }
body.chatfull .top .in { max-width: none; padding-left: 24px; padding-right: 80px; }
@media (max-width: 860px) { body.chatfull main { height: auto; padding: 8px 8px 90px; } }
/* 메시지: 여백 없이 머리글 바로 아래부터 화면 끝까지 */
body.chatfull main { padding: 0; }
body.chatfull main > .notice { display: none; }
body.chatfull main > .flash { margin: 0; border-radius: 0; }
body.chatfull .chat { border: 0; border-radius: 0; box-shadow: none; }
@media (max-width: 860px) { body.chatfull main { padding: 0 0 80px; } }
/* 오른쪽 떠 있는 메뉴에 내 말풍선이 가리지 않게 (화면 여백이 아니라 대화 칸 안쪽만) */
body.chatfull .chat-msgs, body.chatfull .chat-h { padding-right: 96px; }
body.chatfull .chat-in { padding-right: 96px; }
html.osnav-folded body.chatfull .chat-msgs, html.osnav-folded body.chatfull .chat-h, html.osnav-folded body.chatfull .chat-in { padding-right: 32px; }
@media (max-width: 760px) { body.chatfull .chat-msgs, body.chatfull .chat-h, body.chatfull .chat-in { padding-right: 14px; } }

/* 결재 미리보기: 오른쪽에서 열리는 창 */
.apv-row { cursor: pointer; }
.apv-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.apv-row.on td { background: var(--accent-2) !important; }
.apv-dim { position: fixed; inset: 0; background: rgba(17, 19, 40, .18); z-index: 2147482996; }
.apv-dim[hidden], .apv[hidden] { display: none; }
.apv { position: fixed; top: 52px; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 2147482997; background: var(--surface); box-shadow: -12px 0 40px rgba(17, 19, 40, .18);
  display: flex; flex-direction: column; animation: apv-in .16s ease-out; }
@keyframes apv-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.apv-h { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.apv-no { color: var(--muted); font-size: 12.5px; }
.apv-x { margin-left: auto; border: 0; background: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 8px; }
.apv-x:hover { background: var(--surface-2); color: var(--ink); }
.apv-b { flex: 1; overflow-y: auto; padding: 16px 20px 20px; }
.apv-title { font-size: 18px; margin: 0 0 12px; line-height: 1.4; }
.apv-meta { display: grid; grid-template-columns: 92px 1fr; gap: 7px 12px; margin: 0 0 6px; font-size: 13px; }
.apv-meta dt { color: var(--muted); }
.apv-meta dd { margin: 0; overflow-wrap: anywhere; }
.apv-meta dd small { color: var(--muted); }
.apv-amt { font-size: 15px; color: var(--accent-ink); }
.apv-b h3 { font-size: 13px; color: var(--ink-2); margin: 18px 0 8px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.apv-line { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.apv-line li { display: grid; gap: 1px; min-width: 92px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; }
.apv-line li .who { font-weight: 600; } .apv-line li .who small { color: var(--muted); font-weight: 400; }
.apv-line li .what { color: var(--muted); }
.apv-line li small { color: var(--muted); font-size: 11px; }
.apv-line li em { font-style: normal; font-size: 11.5px; color: var(--ink-2); margin-top: 3px; }
/* 결재선은 색 없이 회색으로 (승인 · 반려 · 차례는 글자 굵기로만) */
.apv-line li.done.ok { background: #f9fafb; border-color: #e5e7eb; } .apv-line li.done.ok .what { color: #374151; font-weight: 600; }
.apv-line li.done.bad { background: #f9fafb; border-color: #e5e7eb; } .apv-line li.done.bad .what { color: #374151; font-weight: 600; }
.apv-line li.cur { border-color: #9ca3af; background: #f3f4f6; } .apv-line li.cur .what { color: #111827; font-weight: 700; }
.apv-text { margin: 0; white-space: pre-wrap; font-size: 13.5px; }
.apv-content { font-size: 13.5px; line-height: 1.7; overflow-wrap: anywhere; }
.apv-content img { max-width: 100%; }
.apv-content table { border-collapse: collapse; max-width: 100%; } .apv-content td, .apv-content th { border: 1px solid var(--line); padding: 4px 6px; }
.apv-files { list-style: none; margin: 0; padding: 0; }
.apv-files li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.apv-files small { color: var(--muted); white-space: nowrap; }
.apv-items { font-size: 12.5px; }
.apv-rel { font-size: 12.5px; color: var(--ink-2); margin: 12px 0 0; }
.apv-f { border-top: 1px solid var(--line); padding: 12px 18px 16px; display: grid; gap: 8px; }
.apv-f textarea { resize: vertical; min-height: 44px; }
.apv-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.apv-acts .sp { flex: 1; }
.bars .b { background: #374151; } /* 인력현황 막대: 진한 회색 */
/* 인력현황 막대: 칸반 보드의 차분한 색 (그래프마다 한 색) */
.grid.two > .card:nth-child(1) .bars .b { background: #6285a8; }
.grid.two > .card:nth-child(2) .bars .b { background: #5f8f73; }
.grid.two > .card:nth-child(3) .bars .b { background: #c49a5a; }
.grid.two > .card:nth-child(4) .bars .b { background: #a36f8e; }
/* 인력현황 막대: 같은 색을 조금 더 밝게 */
.grid.two > .card:nth-child(1) .bars .b { background: #8aa9c9; }
.grid.two > .card:nth-child(2) .bars .b { background: #8cb59b; }
.grid.two > .card:nth-child(3) .bars .b { background: #dcb780; }
.grid.two > .card:nth-child(4) .bars .b { background: #c597b2; }
/* 인력현황 막대: 칸반 컬럼 색(하늘·민트·피치·라벤더)을 맑게 */
.grid.two > .card:nth-child(1) .bars .b { background: #6fb3f2; }
.grid.two > .card:nth-child(2) .bars .b { background: #6ccf98; }
.grid.two > .card:nth-child(3) .bars .b { background: #f6ac72; }
.grid.two > .card:nth-child(4) .bars .b { background: #b292f2; }

/* 게시판: 게시판 탭(왼쪽 메뉴로 옮기지 않는 탭) · 관리 화면 */
.btabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.btabs > a { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 13px; }
.btabs > a:hover { border-color: var(--accent); text-decoration: none; }
.btabs > a.on { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.btabs > a small { color: var(--muted); }
.btabs-find { display: flex; gap: 6px; margin: 0 0 0 auto; }
.btabs-find input { width: 200px; }
.badd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: 10px; align-items: end; margin-bottom: 14px; }
@media (max-width: 760px) { .badd { grid-template-columns: 1fr; } .btabs-find { margin-left: 0; } }
.bsave { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(0, 1.4fr); gap: 6px; margin: 0; }
.bdel { display: inline-block; position: relative; }
.bdel > summary { list-style: none; display: inline-flex; }
.bdel > summary::-webkit-details-marker { display: none; }
.bdel-box { position: absolute; right: 0; top: 36px; z-index: 5; width: 260px; display: grid; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); text-align: left; white-space: normal; }
.bdel-box p { margin: 0; font-size: 13px; }
/* 홈: 결재 · 공지사항 · 게시판 칸은 같은 높이 (최근 5개 목록이 들어가는 높이) */
.dash .dash-card.d5 { align-self: stretch; display: flex; flex-direction: column; }
.dash .dash-card.d5 .more { margin-top: auto; }
/* 문서 관리: 폴더 권한 */
.dt .dlock { font-style: normal; font-size: 10px; margin-left: 4px; opacity: .7; }
.dclash { border-color: #f5c46b; background: #fffbeb; }
.dclash h2 { color: #92400e; }
.dclash ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }

/* 홈 칸반: 열마다 카드 2×2 */
.mk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mk-grid .mk-card b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .mk-grid { grid-template-columns: 1fr; } }

/* 결재 관리 화면: 오른쪽 화면을 꽉 채우지 않게 폭 제한 */
body.apv-page main { max-width: 1212px; margin-left: 0 !important; padding-left: 64px !important; } /* 왼쪽에 붙이고 남는 폭은 오른쪽으로 */
/* 근태 신청 화면: 신청서 왼쪽에 여백 */
.att-wrap { max-width: 760px; padding-left: 24px; }
@media (max-width: 760px) { .att-wrap { padding-left: 0; } }
/* 홈 바탕: 진한 회색 */
html.os-shell body.home, html.os-shell:not(.os-noside) body.home { background: #fff !important; }
/* 홈 결재 · 공지사항 · 게시판 칸: 조금 더 높게 */
.dash .dash-card.d5 { min-height: 170px; }
/* 대시보드: 흰 바탕 위 상자는 회색 테두리 */
body.home .card, body.home .stat-strip { border: 1px solid #d1d5db !important; box-shadow: none !important; }
body.home .mk-col { border-color: #d1d5db !important; }
/* 초기 비밀번호 안내: 회색 바탕 */
.notice { background: #f3f4f6 !important; color: #374151 !important; border: 1px solid #e5e7eb; }
