/* 사무실 업무 — 공통 디자인. 외부 글꼴·라이브러리 없이 시스템 글꼴 사용 */
:root {
  --bg: #f3f5f9; --card: #ffffff; --ink: #18202f; --ink-2: #3c4658; --muted: #6b7587; --line: #e3e7ee; --line-2: #eef1f6;
  --brand: #16233f; --brand-2: #22335a; --brand-ink: #e8edf7; --brand-muted: #9aa8c4;
  --accent: #2563eb; --accent-2: #1d4fd0; --accent-soft: #e7efff; --accent-ink: #fff;
  --ok: #157347; --ok-soft: #e3f4ea; --warn: #9a5b00; --warn-soft: #fff1d6; --danger: #b42318; --danger-soft: #fde8e6;
  --info: #1d4fd0; --info-soft: #e7efff; --chip: #eef1f6;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .05);
  --radius: 12px; --side: 232px;
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141d; --card: #171e2b; --ink: #e7ecf4; --ink-2: #c3cbd8; --muted: #8f9aae; --line: #263044; --line-2: #1d2535;
    --brand: #0b111b; --brand-2: #172238; --accent: #4c8dff; --accent-2: #6aa0ff; --accent-soft: #1b2a47;
    --ok: #4cc38a; --ok-soft: #12301f; --warn: #f0b04a; --warn-soft: #33270f; --danger: #ff7b6e; --danger-soft: #3a1714;
    --info: #7aa7ff; --info-soft: #1b2a47; --chip: #222b3b; --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 레이아웃: 넓은 화면은 왼쪽 사이드바 ---------- */
.shell { display: flex; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; width: var(--side); flex: 0 0 var(--side); background: var(--brand); color: var(--brand-ink);
        display: flex; flex-direction: column; padding: 18px 12px; gap: 6px; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -.2px; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #3b82f6, #2563eb 60%, #1e40af);
               display: grid; place-items: center; font-size: 15px; color: #fff; }
.brand small { display: block; font-weight: 400; font-size: 11px; color: var(--brand-muted); }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
nav .sec { font-size: 11px; color: var(--brand-muted); padding: 12px 12px 4px; letter-spacing: .4px; }
nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--brand-ink); font-size: 14px; }
nav a svg { width: 18px; height: 18px; flex: 0 0 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
nav a:hover { background: var(--brand-2); text-decoration: none; }
nav a.on { background: var(--accent); color: #fff; }
nav a.on svg { opacity: 1; }
nav a .badge { margin-left: auto; background: #ef4444; color: #fff; }
.who { border-top: 1px solid rgba(255, 255, 255, .08); padding: 12px 10px 0; font-size: 13px; color: var(--brand-muted); display: flex; flex-direction: column; gap: 6px; }
.who b { color: #fff; font-weight: 600; }
.who .link { color: var(--brand-muted); text-align: left; }
.who .link:hover { color: #fff; }
main { flex: 1; min-width: 0; padding: 26px 32px 60px; max-width: 1280px; }
.anon main { margin: 0; padding: 0; max-width: none; }

/* ---------- 머리말·제목 ---------- */
h1 { font-size: 22px; margin: 0; letter-spacing: -.3px; }
h2 { font-size: 15px; margin: 0 0 10px; letter-spacing: -.1px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 카드·격자 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 14px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer;
       display: flex; flex-direction: column; gap: 2px; transition: border-color .15s, transform .15s; }
.kpi:hover { border-color: var(--accent); transform: translateY(-1px); }
.kpi .n { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.kpi .l { color: var(--muted); font-size: 13px; }
.kpi.alert .n { color: var(--danger); }
.kpi.warn .n { color: var(--warn); }
.kpi.ok .n { color: var(--ok); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 폼 ---------- */
label { display: block; font-size: 12.5px; color: var(--muted); margin: 10px 0 4px; font-weight: 500; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 14px;
                          background: var(--card); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 76px; resize: vertical; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--ink-2); font-size: 14px; }

/* ---------- 버튼 ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
               background: var(--card); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none;
               transition: background .15s, border-color .15s; white-space: nowrap; }
button:hover, .btn:hover { border-color: #c8cfdb; background: var(--line-2); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover, .btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: transparent; }
button.danger:hover { background: var(--danger-soft); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; font-weight: 500; }
button.link:hover { text-decoration: underline; background: none; }
button.sm, .btn.sm { padding: 5px 10px; font-size: 13px; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 줄·글자 ---------- */
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.muted { color: var(--muted); font-size: 13px; }
.err { color: var(--danger); }
.hint { background: var(--line-2); border-radius: 8px; padding: 10px 12px; color: var(--ink-2); font-size: 13px; margin: 0 0 14px; }
.notice { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin: 0 0 14px; }

/* ---------- 상태 표시 ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--ink-2);
         font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }

/* ---------- 표 ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; font-size: 14px; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: .2px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--line-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.empty { color: var(--muted); text-align: center; padding: 22px; }
tr.dim td { color: var(--muted); text-decoration: line-through; }

/* ---------- 작성 항목·키값 ---------- */
.items .item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: var(--line-2); }
.kpis.ceo { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* 결재 요약 카드 */
.digest-list { display: grid; gap: 10px; }
.digest { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--card, transparent); }
.digest.has-flag { border-left: 4px solid var(--warn); }
.dg-head { display: flex; align-items: center; gap: 10px; }
.dg-head input.pick { width: 18px; height: 18px; flex: none; }
.dg-title { flex: 1; min-width: 0; }
.dg-amt { font-weight: 700; white-space: nowrap; }
.dg-headline { margin: 6px 0 0; font-weight: 600; }
.dg-flags, .dg-points { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; }
.dg-flags li { color: var(--warn); }
.dg-flags li::marker { content: "⚠ "; }
.dg-points { color: var(--ink-2); }
.dg-actions { margin-top: 8px; }
/* 묶음 선택 버튼 (보고 종류 등) */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.seg button { padding: 6px 12px; font-size: 13px; border-radius: 999px; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
p.note { margin: 12px 0 0; }
/* 접는 카드 (회사별 목록 등) */
details.card.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-size: 15px; }
details.card.fold > summary::-webkit-details-marker { display: none; }
details.card.fold > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.card.fold[open] > summary::before { transform: rotate(90deg); }
details.card.fold[open] > summary { margin-bottom: 12px; }
details.card.fold .cnt { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--chip); color: var(--ink-2); }
.sub-card { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
/* 새 문서: 종류 버튼 */
.kind-groups { display: grid; gap: 14px; margin-bottom: 16px; }
.kind-group .glabel { font-size: 12px; color: var(--muted); font-weight: 600; margin: 0 0 6px 2px; }
.kind-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
button.kind-tile { flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; text-align: left; height: 100%; }
button.kind-tile b { white-space: normal; line-height: 1.35; }
button.kind-tile span { font-size: 12px; color: var(--muted); font-weight: 400; }
button.kind-tile.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.new-opts { border-top: 1px solid var(--line); padding-top: 14px; }
/* 관리: 칩·결재선·역할 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 3px 10px; border-radius: 999px; background: var(--chip); color: var(--ink); font-size: 13px; white-space: nowrap; }
.chip small { color: var(--muted); font-size: 11.5px; }
.chip.final { background: var(--accent); color: #fff; }
.chip.final small { color: rgba(255, 255, 255, .8); }
.chip button.x { border: 0; background: none; padding: 0 0 0 6px; color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer; }
.chip button.x:hover { color: var(--danger); }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chain .arrow { color: var(--muted); font-size: 13px; }
.route-list { display: grid; gap: 0; }
.route-item { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.route-item:first-child { border-top: 0; padding-top: 4px; }
.route-kind { display: grid; gap: 4px; align-content: start; }
.route-rows { display: grid; gap: 8px; }
.route-row { display: grid; grid-template-columns: 118px 1fr auto; gap: 10px; align-items: center; }
.route-row .who { font-size: 13px; color: var(--ink-2); }
button.link.add { justify-self: start; font-size: 13px; }
button.link.danger { color: var(--danger); }
.role-list { display: grid; }
.role-item { display: grid; grid-template-columns: minmax(200px, 1fr) 2fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: center; }
.role-item:first-child { border-top: 0; padding-top: 2px; }
select.sm { padding: 3px 8px; font-size: 13px; width: auto; }
p.empty { color: var(--muted); text-align: center; padding: 18px; margin: 0; }
@media (max-width: 720px) {
  .route-item, .role-item { grid-template-columns: 1fr; }
  .route-row { grid-template-columns: 1fr; gap: 4px; }
}
.ceo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.ceo-grid > .card { min-width: 0; }
.sub-h { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 16px 0 6px; }
.evidence { margin-top: 8px; padding: 8px 10px; border-radius: 8px; border: 1px dashed var(--line); background: var(--surface, transparent); display: grid; gap: 6px; }
.evidence.missing { border-color: var(--warn); background: var(--warn-soft); }
.evidence a { word-break: break-all; }
.items .item .grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; white-space: pre-wrap; word-break: break-word; }

/* ---------- 결재·단계 ---------- */
.steps { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.step { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 112px; text-align: center; background: var(--card); }
.step .muted { font-size: 12px; }
.step.cur { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.save-state { font-size: 13px; }

/* ---------- 달력(운영대장) ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { font-size: 12px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal .d { border: 1px solid var(--line); border-radius: 8px; min-height: 64px; padding: 6px 7px; background: var(--card); cursor: pointer; font-size: 12px;
          display: flex; flex-direction: column; gap: 3px; }
.cal .d:hover { border-color: var(--accent); }
.cal .d .n { font-weight: 700; font-size: 13px; }
.cal .d.missing { background: var(--danger-soft); border-color: transparent; }
.cal .d.rec { background: var(--ok-soft); border-color: transparent; }
.cal .d.off { background: var(--chip); border-color: transparent; }
.cal .d.future, .cal .d.pad { background: transparent; border-style: dashed; cursor: default; opacity: .5; }
.cal .d.closed { outline: 2px solid var(--line); }

/* ---------- 알림·대화상자 ---------- */
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #18202f; color: #fff; padding: 11px 18px; border-radius: 10px;
         max-width: min(560px, 92vw); z-index: 50; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); font-size: 14px; }
#toast.err { background: var(--danger); }
dialog { border: 0; border-radius: 14px; padding: 22px; width: min(480px, 94vw); background: var(--card); color: var(--ink); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(15, 20, 30, .45); }
dialog h2 { font-size: 17px; margin-bottom: 4px; }
dialog .row.end { margin-top: 16px; }
.recs { padding: 0; max-height: 50vh; overflow: auto; }
.recs li { list-style: none; margin: 6px 0; }

/* ---------- 로그인 ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: radial-gradient(1200px 600px at -10% -20%, #2a4a8f 0%, transparent 60%), var(--brand); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h1 { font-size: 30px; line-height: 1.3; }
.auth-side p { color: var(--brand-muted); max-width: 420px; }
.auth-side ul { padding-left: 18px; color: var(--brand-ink); }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(380px, 100%); }
.auth-card h1 { margin-bottom: 18px; }
.auth-card button.primary { width: 100%; margin-top: 16px; padding: 11px; }

/* ---------- 좁은 화면: 위쪽 메뉴 ---------- */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { position: sticky; height: auto; width: 100%; flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 8px; }
  .brand { padding: 0; flex: 1; }
  .brand small { display: none; }
  nav { order: 3; flex: 0 0 100%; flex-direction: row; overflow-x: auto; gap: 4px; }
  nav .sec { display: none; }
  nav a { padding: 7px 10px; white-space: nowrap; }
  nav a svg { display: none; }
  .who { border: 0; padding: 0; flex-direction: row; align-items: center; }
  main { padding: 16px 14px 48px; }
  .cols-2 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 640px) {
  h1 { font-size: 19px; }
  .card { padding: 14px; }
  table.resp thead { display: none; }
  table.resp tr { display: block; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; padding: 6px 0; }
  table.resp td { display: flex; gap: 10px; border: 0; padding: 4px 12px; }
  table.resp td::before { content: attr(data-l); color: var(--muted); font-size: 12px; min-width: 84px; flex: 0 0 84px; }
  table.resp td.empty::before { content: none; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 8px; }
  .step { min-width: 0; flex: 1 1 40%; }
  .cal { gap: 3px; }
  .cal .d { min-height: 46px; padding: 4px; font-size: 10px; }
  .kpi .n { font-size: 22px; }
}
@media print {
  .side, .page-head .actions, button { display: none !important; }
  main { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}

.title-row { margin-bottom: 4px; }
.title-row + .muted { margin: 0 0 16px; }

td[data-l="일자"], td[data-l="유형"], td[data-l="기간·기안일"], td[data-l="날짜"], td.num { white-space: nowrap; }

/* 날짜별 묶음 편집 (주간) */
.day-group { border-left: 3px solid var(--accent-soft); padding: 4px 0 2px 12px; margin-bottom: 14px; }
.day-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.items .item .grid .wide { grid-column: 1 / -1; }

/* 한 줄 표 형태 편집 (일일 시간대별 업무) */
.items.gtable { overflow-x: auto; }  /* 칸이 많은 표(점검표 등)는 표 안에서만 옆으로 넘김 */
.gtable .grow { min-width: max-content; }
.gtable .grow { display: grid; grid-template-columns: var(--gcols); gap: 6px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.gtable .ghead { font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.gtable .gcell label { display: none; }
.gtable .gcell input, .gtable .gcell select, .gtable .gcell textarea { padding: 6px 8px; font-size: 13.5px; }
.gtable .gcell textarea { min-height: 38px; }
.gtable .gcell.del { align-self: center; text-align: center; }
@media (max-width: 1000px) {
  .gtable .ghead { display: none; }
  .gtable .grow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; background: var(--line-2); }
  .gtable .gcell { min-width: 0; }
  .gtable .gcell label { display: block; margin-top: 0; }
  .gtable .gcell:has(textarea) { grid-column: 1 / -1; }
  .gtable .gcell.del { grid-column: 1 / -1; text-align: right; }
  .gtable .grow:not(.more) .gcell.opt { display: none; }
  .gtable .more-btn { display: inline; margin-right: 14px; }
  .gtable .grow.more .more-btn::after { content: " (접기)"; }
}
.gtable .more-btn { display: none; }

/* ===== 정리용 공통 요소 ===== */
/* 표: 머리줄 바탕·촘촘한 줄 */
th { background: var(--line-2); }
th:first-child { border-top-left-radius: 8px; }
th:last-child { border-top-right-radius: 8px; }
td, th { padding: 9px 10px; }
.card > .table-wrap:last-child, .tab-body > .table-wrap:last-child { margin-bottom: -4px; }
/* 카드 머리 + 개수 */
.card-head h2 .cnt { display: inline-block; margin-left: 6px; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--chip);
                     color: var(--ink-2); font-size: 12px; text-align: center; font-weight: 600; }
.card-head h2 .cnt.hot { background: var(--danger-soft); color: var(--danger); }
/* 탭 */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs a .cnt { margin-left: 6px; font-size: 12px; padding: 0 6px; border-radius: 999px; background: var(--chip); color: var(--ink-2); }
.tabs a .cnt.hot { background: var(--danger-soft); color: var(--danger); }
/* 접는 도움말 */
details.help { margin: -8px 0 16px; font-size: 13px; color: var(--ink-2); }
details.help summary { cursor: pointer; color: var(--muted); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.help summary::before { content: "ⓘ"; font-size: 13px; }
details.help summary::-webkit-details-marker { display: none; }
details.help[open] summary { margin-bottom: 6px; }
details.help ul { margin: 0; padding: 10px 14px 10px 28px; background: var(--line-2); border-radius: 8px; }
details.help li { margin: 2px 0; }
/* 필터 줄 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters select, .filters input:not([type=checkbox]) { width: auto; min-width: 140px; padding: 7px 10px; }
.filters .grow1 { flex: 1; min-width: 180px; }
/* 2단 배치: 내용 + 오른쪽 정보 */
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.layout-2 > aside { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 0; }
@media (max-width: 1100px) { .layout-2 { grid-template-columns: 1fr; } .layout-2 > aside { position: static; } }
/* 결재 단계 세로 목록 (오른쪽) */
.vsteps { list-style: none; margin: 0 0 12px; padding: 0; }
.vsteps li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.vsteps li:last-child { border-bottom: 0; }
.vsteps .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
               background: var(--chip); color: var(--muted); flex: 0 0 26px; }
.vsteps .ok .dot { background: var(--ok-soft); color: var(--ok); }
.vsteps .cur .dot { background: var(--accent); color: #fff; }
.vsteps .bad .dot { background: var(--danger-soft); color: var(--danger); }
.vsteps .who { flex: 1; }
.vsteps .who small { display: block; color: var(--muted); font-size: 12px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack > button, .stack > .btn { width: 100%; }
/* 작성 화면 아래 고정 작업 바 */
.actionbar { position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px -4px 0;
             padding: 12px 16px; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(6px);
             border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 -4px 16px rgba(16, 24, 40, .06); }
.actionbar .spacer { flex: 1; }
.actionbar.decide { margin-top: 16px; border-color: var(--accent); }
/* 요약 카드 묶음 */
.kpi-group { margin-bottom: 6px; }
.kpi-group .glabel { font-size: 12px; color: var(--muted); font-weight: 600; margin: 0 0 8px 2px; letter-spacing: .3px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
/* 상태 점 */
.dotlabel { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.dotlabel::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.dotlabel.ok::before { background: var(--ok); } .dotlabel.warn::before { background: var(--warn); }
.dotlabel.danger::before { background: var(--danger); } .dotlabel.info::before { background: var(--accent); }
.sub2 { color: var(--muted); font-size: 12.5px; }

.layout-2 aside .kv { grid-template-columns: 92px 1fr; gap: 6px 10px; font-size: 13.5px; }
.layout-2 aside .card { padding: 16px; }

.filters .spacer { flex: 1; }

/* 표 칸 줄바꿈 정리 */
td[data-l="회사"], td[data-l="발급일"], td[data-l="만료"], td[data-l="상태"], td[data-l="공개"], td[data-l="법정 기한"], td[data-l="효력"] { white-space: nowrap; }
.table-wrap td:last-child .row { flex-wrap: nowrap; justify-content: flex-end; }

.tabs { overflow-y: hidden; scrollbar-width: thin; }

/* ---------- 협업: 글·기록·달력 ---------- */
.pre { white-space: pre-wrap; word-break: break-word; margin: 0; }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
ul.timeline { list-style: none; padding: 0; margin: 0 0 12px; }
ul.timeline li { padding: 8px 0 8px 14px; border-left: 2px solid var(--line); margin-left: 4px; }
ul.timeline li .pre { margin-top: 2px; color: var(--ink-2); font-size: 14px; }
.row > textarea { flex: 1; min-width: 200px; min-height: 44px; }
.pick-many .chip { cursor: pointer; }
tr.dim-soft td { color: var(--muted); }
.cal.big .d { min-height: 104px; cursor: default; overflow: hidden; }
.cal.big .d.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.cal.big .d.pad { opacity: .45; }
a.cal-item { display: block; font-size: 11.5px; line-height: 1.35; padding: 1px 6px; border-radius: 5px; background: var(--chip); color: var(--ink);
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--muted); }
a.cal-item:hover { text-decoration: none; filter: brightness(.96); }
a.cal-item.ok { border-left-color: var(--ok); } a.cal-item.warn { border-left-color: var(--warn); }
a.cal-item.danger { border-left-color: var(--danger); } a.cal-item.info { border-left-color: var(--accent); }
a.cal-item.over { background: var(--danger-soft); color: var(--danger); }
.agenda-row a.cal-item { display: inline; background: none; border: 0; padding: 0; font-size: 14px; font-weight: 600; }
.agenda { display: grid; }
.agenda-day { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.agenda-day.today .agenda-date { color: var(--accent); }
.agenda-date { font-weight: 700; font-size: 14px; }
.agenda-row { padding: 2px 0; }
@media (max-width: 640px) {
  .cal.big .d { min-height: 64px; }
  a.cal-item { font-size: 9.5px; padding: 0 3px; }
  .agenda-day { grid-template-columns: 1fr; gap: 4px; }
}

/* 일정: 팀 표 */
table.sgrid { min-width: 820px; table-layout: fixed; }
table.sgrid th:first-child, table.sgrid td.sname { width: 92px; }
table.sgrid th.today { color: var(--accent); }
table.sgrid tr.me td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
table.sgrid td.sname button.link { font-size: 12.5px; display: block; margin-top: 2px; }
.scell { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.scell.weekend { opacity: .7; }
.sblock { display: block; width: 100%; font-size: 12px; line-height: 1.35; padding: 2px 6px; border-radius: 6px; background: var(--chip);
          border-left: 3px solid var(--muted); word-break: keep-all; }
.sblock .st { font-variant-numeric: tabular-nums; color: var(--muted); }
.sblock.ok { border-left-color: var(--ok); } .sblock.info { border-left-color: var(--accent); }
.sblock.warn { border-left-color: var(--warn); } .sblock.danger { border-left-color: var(--danger); }
.sblock.busy { background: var(--warn-soft); }
.sblock.mine { cursor: pointer; } .sblock.mine:hover { outline: 1px solid var(--accent); }
.chip.free { background: var(--ok-soft); color: var(--ok); border: 0; font-size: 12px; padding: 2px 8px; cursor: pointer; }
.chip.free:hover { outline: 1px solid var(--ok); }
.legend { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; }
.legend .sblock { width: auto; display: inline-block; }
.start-card { border-left: 4px solid var(--accent); }
.start-card ol, .start-card ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
p.total-live { margin: 10px 0 0; font-size: 15px; }
p.total-live b { font-size: 17px; }
dialog .pick-many { max-height: 180px; overflow: auto; }
tr.diff td { background: var(--warn-soft); }
tr.diff td:first-child { font-weight: 600; }
.quick-find { margin: -2px 0 12px; }
.quick-find button.chip { border: 0; cursor: pointer; padding: 3px 10px; font-size: 13px; font-weight: 500; }
.quick-find button.chip:hover { background: var(--accent-soft); color: var(--accent); }
details.fold-plain > summary { cursor: pointer; list-style: none; }
details.fold-plain > summary::-webkit-details-marker { display: none; }
details.fold-plain > summary::before { content: "▸ "; }
details.fold-plain[open] > summary::before { content: "▾ "; }
details.fold-plain[open] > summary { margin-bottom: 6px; }

/* 휴대폰: 요약 숫자는 두 칸씩 (한 줄에 하나면 홈이 너무 길어짐) */
@media (max-width: 640px) {
  .kpis, .kpis.ceo { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi .l { font-size: 12px; line-height: 1.35; }
}

.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 560px; }
.layout-2 { grid-template-columns: minmax(0, 1fr) 300px; }
@media (max-width: 1100px) { .layout-2 { grid-template-columns: 1fr; } }
