@import url("https://cdn.jsdelivr.net/npm/pretendard@1.3.9/dist/web/static/pretendard.css");
:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --ink: #161b26;
  --ink-2: #3d4553;
  --muted: #6b7280;
  --faint: #c3c8d0;
  --line: #e2e6ec;
  --stripe: #f8f9fb;
  --head: #eceff4;
  --accent: #1f5fbf;
  --accent-soft: #e6eefb;
  --good: #0f7a40;
  --bad: #c42828;
  --warn-bg: #fff4d9;
  --warn-ink: #7a4f00;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-up: 0 4px 14px rgba(16, 24, 40, .10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11141a; --panel: #1a1f28; --ink: #eceff4; --ink-2: #c5ccd8; --muted: #9aa3b2; --faint: #4a5263;
    --line: #2c3340; --stripe: #1e242e; --head: #232a35;
    --accent: #7aa8ff; --accent-soft: #1f2b42; --good: #52c98e; --bad: #ff8080;
    --warn-bg: #3a2f12; --warn-ink: #f3c96b; --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-up: 0 4px 14px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* nav 처럼 display 를 정한 요소도 hidden 이면 숨김 */
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 상단 메뉴: 한 줄 (좁은 화면에서는 메뉴만 옆으로 밀어서 봄) */
.top {
  display: flex; align-items: center; gap: 8px 20px;
  padding: 8px 24px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5; box-shadow: var(--shadow);
}
.brand { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; white-space: nowrap; flex: none; }
#year-pick { font-weight: 700; color: var(--accent); min-height: 34px; padding: 4px 8px; }
nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
nav a { padding: 8px 13px; border-radius: 8px; color: var(--ink-2); font-weight: 500; white-space: nowrap; transition: background .12s; }
nav a:hover { background: var(--stripe); text-decoration: none; }
nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.mode { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; white-space: nowrap; flex: none; }
@media (max-width: 1100px) { .mode { display: none; } nav { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 24px; } }

main { padding: 24px; max-width: 1500px; margin: 0 auto; }
h1 { font-size: 22px; margin: 0 0 16px; letter-spacing: -0.02em; }
h2 { font-size: 17px; margin: 28px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }

/* 요약 카드 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.card .k { color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: 0; }
.card .v { font-size: 23px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.card .unit { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 2px; }

/* 검색·필터 줄 */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .spacer, .modal-actions .spacer { flex: 1; }
input, select, textarea, button {
  font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; min-height: 38px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 0; border-color: var(--accent); }
input[type=search] { min-width: 260px; }
input[type=checkbox] { min-height: 0; width: 17px; height: 17px; vertical-align: -3px; }
label.check { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); cursor: pointer; }
button { cursor: pointer; font-weight: 500; transition: background .12s, border-color .12s, box-shadow .12s; }
button:hover { background: var(--stripe); border-color: var(--faint); }
button:active { transform: translateY(1px); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); background: var(--accent); }
button.danger { color: var(--bad); }
.count { color: var(--muted); font-size: 14px; }

/* 표 */
.table-wrap {
  overflow: auto; max-height: calc(100vh - 210px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.table-wrap.free { max-height: none; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; font-size: 14.5px; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: middle; }
th {
  background: var(--head); color: var(--ink-2); font-weight: 700; font-size: 13px;
  position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--faint);
}
td.n, th.n { text-align: right; }
td.wrap { white-space: normal; min-width: 240px; max-width: 420px; }
td .sub-line { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
tbody tr:nth-child(even) td { background: var(--stripe); }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--accent-soft); }
tr.sub td {
  background: var(--panel) !important; color: var(--accent); font-weight: 700;
  border-top: 2px solid var(--line); padding-top: 14px;
}
tr.sub td .muted { font-weight: 500; }
tr.total td { font-weight: 800; background: var(--head) !important; border-top: 2px solid var(--faint); position: sticky; bottom: 0; }
.zero { color: var(--faint); }
.pos { color: var(--good); font-weight: 600; }
.neg { color: var(--bad); font-weight: 600; }
.strong { font-weight: 700; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--stripe); border: 1px solid var(--line); color: var(--ink-2); vertical-align: 1px; }
.tag.blue { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.tag.good { background: transparent; color: var(--good); border-color: currentColor; }
.warn { background: var(--warn-bg); color: var(--warn-ink); padding: 10px 14px; border-radius: 8px; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px 20px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; font-variant-numeric: tabular-nums; }
.kv .sum { font-weight: 800; border-top: 1px solid var(--line); padding-top: 8px; }

/* 입력 창 */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--panel); color: var(--ink); width: min(560px, 94vw); max-height: 92vh; }
dialog { box-shadow: var(--shadow-up); }
dialog::backdrop { background: rgba(10, 15, 25, .45); backdrop-filter: blur(2px); }
dialog form { padding: 20px 22px; }
dialog h2 { margin-top: 0; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; }
.field .hint { font-size: 12.5px; color: var(--muted); }
#modal-body.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
#modal-body .field.wide { grid-column: 1 / -1; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; position: sticky; bottom: 0; background: var(--panel); padding-top: 8px; }
.login { max-width: 380px; margin: 80px auto; }

/* 체험판(로컬 모드) 안내 줄 */
.demo-bar { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 6px 24px; border-bottom: 1px solid var(--line); background: var(--warn-bg); color: var(--warn-ink); font-size: 13.5px; }
.demo-bar .spacer { flex: 1; }
.demo-bar button { min-height: 32px; padding: 3px 10px; font-size: 13px; }
.demo-bar button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 760px) { .demo-bar { padding: 8px 16px; } }

/* 홈: 잔디처럼 왼쪽 공사 목록 + 오른쪽 내용 */
.jd { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.jd-side { position: sticky; top: 70px; max-height: calc(100vh - 90px); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.jd-side-head { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.jd-side-head input[type=search] { min-width: 0; width: 100%; }
.jd-home { font-weight: 700; padding: 6px 8px; border-radius: 8px; color: var(--ink-2); }
.jd-home.on, .jd-home:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.jd-filter { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.jd-filter select { flex: 1; min-width: 0; min-height: 34px; padding: 4px 8px; font-weight: 600; }
.jd-filter label { white-space: nowrap; }
.jd-list { overflow-y: auto; padding: 6px; }
.jd-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 9px 10px; border-radius: 8px; color: var(--ink); }
.jd-item:hover { background: var(--stripe); text-decoration: none; }
.jd-item.on { background: var(--accent-soft); }
.jd-name { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.jd-sub { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
.jd-main { min-width: 0; }
.jd-back { display: none; margin: 0 0 8px; }
.jd-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.star { font-size: 22px; line-height: 1; padding: 4px 8px; color: var(--faint); }
.star.on { color: #e0a100; }
.jd-nums { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.jd-nums .k { display: block; font-size: 12.5px; color: var(--muted); }
.jd-nums b { font-size: 18px; }
.jd-mini { line-height: 1.9; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.jd-side .chips { margin: 0; }
.chips button { min-height: 30px; padding: 2px 10px; font-size: 13px; border-radius: 999px; }
.chips button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chips button.on .muted { color: #dfe8fa; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 14px; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; padding: 8px 14px; color: var(--ink-2); white-space: nowrap; }
.tabs button.on { border-bottom-color: var(--accent); color: var(--accent); font-weight: 700; }
.todo { display: grid; gap: 8px; }
.todo-item { display: flex; gap: 12px; align-items: center; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
.todo-item:hover { border-color: var(--accent); text-decoration: none; }
.todo-item.hot { border-left: 4px solid var(--bad); }
.todo-n { font-size: 20px; font-weight: 800; min-width: 36px; font-variant-numeric: tabular-nums; }
.todo-item span:nth-child(2) { flex: 1; }
.feed-day { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed-date { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.feed-line { padding: 2px 0; }
.feed-line.click { cursor: pointer; }
.feed-line.click:hover { color: var(--accent); }
.rate-in { width: 120px; text-align: right; min-height: 32px; }
@media (max-width: 760px) {
  .jd { grid-template-columns: 1fr; }
  .jd-side { position: static; max-height: none; }
  .jd.has-sel .jd-side { display: none; }
  .jd:not(.has-sel) .jd-main { order: -1; }
  .jd-back { display: block; }
  .feed-day { grid-template-columns: 1fr; gap: 2px; }
}

/* 메뉴 숫자 (승인 대기) */
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; margin-left: 2px; }
.approve { margin-bottom: 20px; border-color: var(--accent); }

/* 반장 공수 입력 (핸드폰 기준) */
.fm, .fm-day { max-width: 640px; }
.fm-day { margin-bottom: 10px; padding: 12px 14px; }
.fm-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.fm-group { background: var(--head); color: var(--ink-2); font-size: 13px; font-weight: 700; padding: 6px 12px; }
.fm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); }
.fm-row.picked { background: var(--accent-soft); }
.fm-name { font-weight: 600; font-size: 16px; }
.seg { display: flex; gap: 4px; }
.seg button { min-width: 46px; min-height: 42px; padding: 4px 8px; font-weight: 600; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.fm-submit { width: 100%; min-height: 50px; font-size: 16px; }
.fm-submit:disabled { opacity: .55; cursor: default; }
.fm-item { padding: 8px 0; border-top: 1px solid var(--line); }
.fm-item.click { cursor: pointer; }

/* 휴대폰: 표를 카드 목록으로 */
@media (max-width: 760px) {
  main { padding: 14px 16px 40px; }
  .top { padding: 8px 16px; gap: 6px 10px; }
  .brand { width: 100%; display: flex; justify-content: space-between; }
  nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav a { white-space: nowrap; padding: 6px 11px; }
  .mode { display: none; }
  h1 { font-size: 20px; }
  input[type=search] { min-width: 0; width: 100%; }
  .toolbar select { flex: 1 1 40%; }
  .cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .card { padding: 12px 14px; }
  .card .v { font-size: 18px; }
  .table-wrap { max-height: none; overflow: visible; background: transparent; border: 0; }
  table.rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable thead { display: none; }
  .rtable tr {
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
    padding: 12px 14px; margin-bottom: 8px;
  }
  .rtable tbody tr:nth-child(even) td { background: transparent; }
  .rtable td { border: 0; padding: 2px 0; white-space: normal; max-width: none; min-width: 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .rtable td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; flex: none; }
  .rtable td.title { display: block; text-align: left; font-weight: 700; font-size: 15.5px; margin-bottom: 4px; }
  .rtable td.title .sub-line { font-weight: 400; }
  .rtable td.hide-m, .rtable td:empty { display: none; }
  .rtable tr.sub { background: transparent; border: 0; padding: 14px 2px 4px; margin: 0; }
  .rtable tr.sub td { padding: 0; border: 0; justify-content: flex-start; text-align: left; }
  .rtable tr.total { position: static; background: var(--head); }
  .rtable tr.total td { background: transparent !important; border: 0; padding: 2px 0; position: static; }
  .kv { grid-template-columns: 110px 1fr; }
}

/* 결재 라인 ☑ 이진기 → ☐ 이주영 → ☐ 이장성 */
.chk-line { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.chk { padding: 2px 8px; border-radius: 6px; background: var(--stripe); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chk.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.chk small { font-weight: 400; }
.panel.appr.turn { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
@media (max-width: 760px) {
  .top { padding: 8px 14px; flex-wrap: wrap; }
  nav { flex-basis: 100%; order: 3; }
  main { padding: 16px 14px; }
  h1 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.chips button.sheet-edit { border-style: dashed; color: var(--muted); }
.sheet-row { display: flex; gap: 8px; margin-bottom: 8px; }
.sheet-row input { flex: 1; min-width: 0; }
.sheet-row .x { min-width: 38px; color: var(--muted); }
.sheet-row .x:hover { color: var(--bad); border-color: var(--bad); }
.appr-row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; padding: 6px; border-radius: 10px; border: 1px solid transparent; }
.appr-row input { flex: 1; min-width: 0; }
.appr-row input.t { flex: 0 1 38%; }
.appr-row button { min-width: 34px; padding: 4px 6px; }
.appr-row button:disabled { opacity: .35; cursor: default; }
.appr-row .x:hover:not(:disabled) { color: var(--bad); border-color: var(--bad); }
.appr-no { flex: none; min-width: 42px; text-align: center; font-weight: 700; color: var(--muted); }
.appr-no.final { background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 8px; font-size: 12.5px; }
.appr-row.final { background: var(--accent-soft); border-color: var(--accent); }
/* 결재함의 최종 결재자 표시 */
.chk.final-chk { border-color: var(--accent); }
.chk .final-tag { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11.5px; font-weight: 700; margin-left: 3px; }
#appr-add { margin: 2px 0 12px; }

/* ---- 다듬기 2차: 아이콘·글꼴·터치 크기 ---- */
.ic { width: 1.05em; height: 1.05em; vertical-align: -0.15em; flex: none; }
.star-ic { color: #e0a100; }
.star-ic .ic { width: .95em; height: .95em; vertical-align: -0.1em; }
button.star .ic { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; }
button.star.on .ic { fill: currentColor; stroke: none; }
.jd-home .ic { margin-right: 2px; }
body { font-feature-settings: "tnum" 1; letter-spacing: -0.003em; }
h1 { font-size: 24px; letter-spacing: -0.025em; }
th { letter-spacing: 0; }
/* 손가락으로 누르는 화면: 누르는 칸을 크게 (44px) */
@media (pointer: coarse) {
  button, select, input:not([type=checkbox]) { min-height: 44px; }
  .chips button { min-height: 40px; }
  nav a { padding: 11px 14px; }
  .demo-bar button { min-height: 38px; }
  input[type=checkbox] { width: 22px; height: 22px; }
  .jd-item { padding: 12px 10px; }
}

/* ---- 다듬기 3차 (ui-ux-pro-max: Minimal & Swiss, 업무용 대시보드) ----
   그림자 대신 얇은 선, 표 줄무늬 없애고 마우스 올린 줄만 표시, 색은 남색 하나 + 경고·좋음만 */
:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --faint: #cbd5e1;
  --line: #e5e8ee; --stripe: #f8fafc; --head: #f1f4f8;
  --accent: #1e40af; --accent-soft: #eaf0fc; --good: #047857; --bad: #c81e1e;
  --warn-bg: #fdf5e3; --warn-ink: #8a5300;
  --shadow: none; --shadow-up: 0 12px 32px rgba(15, 23, 42, .16);
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117; --panel: #161b22; --ink: #e6edf3; --ink-2: #c3ccd7; --muted: #8b97a6; --faint: #3a4350;
    --line: #262d37; --stripe: #1b2129; --head: #1b2129;
    --accent: #8ab4ff; --accent-soft: #1b2a45; --good: #4ccf8f; --bad: #ff7b7b;
    --warn-bg: #33290f; --warn-ink: #f0c56a; --shadow: none; --shadow-up: 0 12px 32px rgba(0, 0, 0, .55);
  }
}
body { font-size: 14.5px; }
:focus-visible { outline: 2px solid var(--accent) !important; outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }

/* 위 막대 */
.top { padding: 0 24px; min-height: 56px; box-shadow: none; }
.brand { font-size: 16px; }
.brand::before { content: ""; width: 10px; height: 22px; border-radius: 3px; background: var(--accent); }
#year-pick { border-color: transparent; background: var(--accent-soft); min-height: 32px; }
nav a { padding: 7px 12px; font-size: 14px; color: var(--muted); transition: color .15s, background .15s; }
nav a:hover { color: var(--ink); background: var(--stripe); }
nav a.on { background: var(--accent-soft); color: var(--accent); }
.demo-bar { background: var(--panel); color: var(--muted); padding: 6px 24px; font-size: 13px; }
.demo-bar b { display: inline-block; background: var(--warn-bg); color: var(--warn-ink); border-radius: 999px; padding: 0 9px; font-size: 12px; margin-right: 2px; }
.demo-bar label { color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.demo-bar select { min-height: 32px; padding: 3px 8px; font-size: 13px; }

/* 제목·구역 */
main { padding: 28px 28px 48px; }
h1 { font-size: 22px; font-weight: 800; margin-bottom: 18px; }
h2 { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .01em; margin: 30px 0 10px; }
.jd-main h2:first-child, h1 + h2 { margin-top: 0; }

/* 카드·판: 그림자 대신 선 */
.panel, .card, .table-wrap, .jd-side, .jd-nums, .todo-item { border-radius: var(--r); box-shadow: none; }
.card { padding: 14px 16px; }
.card .k { font-weight: 500; }
.card .v { font-size: 24px; font-weight: 700; }

/* 버튼 */
input, select, textarea, button { border-radius: 8px; border-color: var(--line); }
button { font-weight: 600; color: var(--ink-2); }
button:hover { background: var(--stripe); border-color: var(--faint); color: var(--ink); }
button.primary { box-shadow: 0 1px 0 rgba(15, 23, 42, .08); }
button.primary:hover { color: #fff; }
.chips button { font-weight: 500; }
.chips button.on { font-weight: 600; }

/* 표: 줄무늬 없이, 마우스 올린 줄만 */
table { font-size: 14px; }
th { background: var(--head); color: var(--muted); font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--line); padding-top: 9px; padding-bottom: 9px; }
th, td { padding-left: 16px; padding-right: 16px; }
tbody tr:nth-child(even) td { background: transparent; }
tbody tr:hover td { background: var(--stripe); }
tr.click:hover td { background: var(--accent-soft); }
tr.sub td { color: var(--ink); font-weight: 700; font-size: 13px; background: var(--stripe) !important; border-top: 1px solid var(--line); padding-top: 9px; padding-bottom: 9px; }
tr.total td { background: var(--head) !important; border-top: 1px solid var(--faint); }

/* 꼬리표 */
.tag { font-size: 11.5px; padding: 1px 7px; border-radius: 6px; line-height: 1.6; white-space: nowrap; align-self: start; }
.tag.good { background: transparent; border: 1px solid currentColor; }
.jd-item > .tag { justify-self: end; }

/* 홈 */
.jd { grid-template-columns: 300px minmax(0, 1fr); gap: 24px; }
.jd-side { top: 72px; }
.jd-item { padding: 9px 10px; }
.jd-item.on { box-shadow: inset 3px 0 0 var(--accent); }
.jd-nums { padding: 14px 18px; }
.todo { gap: 6px; }
.todo-item { padding: 12px 16px; transition: border-color .15s, background .15s; }
.todo-item:hover { background: var(--stripe); border-color: var(--faint); }
.todo-item.hot { border-left: 1px solid var(--line); }
.todo-item.hot .todo-n { color: var(--bad); }
.todo-n { font-size: 18px; font-weight: 700; min-width: 32px; }
.todo-item .muted { transition: transform .15s; }
.todo-item:hover .muted { transform: translateX(2px); color: var(--accent); }
.feed-day { border-bottom-color: var(--line); }

/* 입력 창 */
dialog { border-radius: 14px; border-color: var(--line); overflow-x: hidden; }
dialog form { padding: 22px 24px 20px; }
dialog h2 { font-size: 18px; color: var(--ink); font-weight: 800; margin-bottom: 16px; }
#modal-body > * { min-width: 0; }
.modal-actions { border-top: 1px solid var(--line); margin: 18px -24px 0; padding: 14px 24px 0; }

/* 결재 칸 */
.chk { border-radius: 6px; font-size: 13px; }
.panel.appr.turn { box-shadow: 0 0 0 3px var(--accent-soft); }

@media (max-width: 760px) {
  .top { padding: 8px 16px; }
  main { padding: 16px 16px 40px; }
  .demo-bar { padding: 8px 16px; }
  .brand { justify-content: flex-start; }
  #year-pick { margin-left: auto; }
  .jd { grid-template-columns: 1fr; gap: 16px; }
  .rtable tr { border-radius: var(--r); }
  tbody tr:hover td { background: transparent; }
}
@media (prefers-reduced-motion: reduce) { .todo-item:hover .muted { transform: none; } }

/* ---- 수금 ---- */
a.card-link { display: block; color: inherit; transition: border-color .15s, background .15s; }
a.card-link:hover { text-decoration: none; border-color: var(--faint); background: var(--stripe); }
.card .v.neg, .card .v.pos { font-weight: 700; }
.tag.bad { background: transparent; color: var(--bad); border: 1px solid currentColor; }
.tabs .badge { font-size: 11px; line-height: 18px; min-width: 18px; }
button.small-btn { min-height: 32px; padding: 3px 12px; font-size: 13px; }
@media (pointer: coarse) { button.small-btn { min-height: 40px; } }

/* ---- 앱 설치 안내 ---- */
.install { max-width: 980px; }
.install > .muted { max-width: 640px; margin-top: -6px; }
.ok-note { border-color: var(--good); color: var(--good); font-weight: 600; }
button.big { min-height: 48px; padding: 8px 20px; font-size: 16px; }
.steps { list-style: none; padding: 0; margin: 4px 0 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.step:has(.ill.wide) { grid-column: 1 / -1; }
.step-ill { display: flex; justify-content: center; }
.step-txt b { font-size: 15px; line-height: 1.4; }
.step-txt p { margin: 4px 0 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.step-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; margin-right: 8px; vertical-align: 1px; }
.ill { width: 132px; height: auto; display: block; }
.ill.wide { width: min(100%, 420px); }
.ill-body { fill: var(--head); stroke: var(--faint); stroke-width: 1.5; }
.ill-screen { fill: var(--panel); }
.ill-line { fill: var(--line); }
.ill-bar { fill: var(--head); }
.ill-bar2 { fill: var(--stripe); stroke: var(--line); }
.ill-ic { fill: none; stroke: var(--ink-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ill-dot { fill: var(--ink-2); }
.ill-t { font: 600 10px "Pretendard", sans-serif; fill: var(--ink-2); }
.ill-t.s { font-size: 8px; }
.ill-t.b { fill: var(--accent); font-weight: 800; }
.ill-app { fill: var(--line); }
.ill-mine { fill: var(--accent); }
.ill-dim { fill: rgba(15, 23, 42, .28); }
.ill-sheet { fill: var(--panel); stroke: var(--line); }
.ill-pick { fill: none; stroke: var(--accent); stroke-width: 2; }
.ill-hl { fill: var(--accent); fill-opacity: .18; stroke: var(--accent); stroke-width: 2; }
.ill-ring { fill: none; stroke: var(--accent); stroke-opacity: .35; stroke-width: 1.5; animation: ill-pulse 1.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ill-pulse { from { transform: scale(.75); opacity: 1; } to { transform: scale(1.15); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ill-ring { animation: none; } }
.install-foot input { flex: 1; min-width: 0; }
.fm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; max-width: 640px; }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .step { flex-direction: row; align-items: flex-start; }
  .step:has(.ill.wide) { flex-direction: column; }
  .ill { width: 96px; flex: none; }
  .install-foot .toolbar button { flex: 1; }
}
.steps.list { grid-template-columns: 1fr; max-width: 640px; }
.card .v { white-space: nowrap; }
@media (max-width: 760px) { .card .v { font-size: 19px; } }

/* ---- 달력 ---- */
.cal-page { --k-work: var(--accent); --k-work-bg: var(--accent-soft); --k-off: #b45309; --k-off-bg: #fdf1dc; --k-memo: #475569; --k-memo-bg: #eef1f5; --k-pay: var(--good); --k-pay-bg: #e3f4ec; }
@media (prefers-color-scheme: dark) { .cal-page { --k-off: #f0b35a; --k-off-bg: #3a2c12; --k-memo: #b4bfcc; --k-memo-bg: #232a35; --k-pay-bg: #12332a; } }
.cal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.cal-head h1 { margin: 0; min-width: 130px; }
.cal-nav { display: flex; gap: 4px; }
.cal-nav button { min-width: 40px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.cal-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.cal-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--k, var(--muted)); flex: none; }
.k-work { --k: var(--k-work, var(--accent)); --kb: var(--k-work-bg, var(--accent-soft)); }
.k-off { --k: var(--k-off, #b45309); --kb: var(--k-off-bg, #fdf1dc); }
.k-memo { --k: var(--k-memo, #475569); --kb: var(--k-memo-bg, #eef1f5); }
.k-pay { --k: var(--k-pay, var(--good)); --kb: var(--k-pay-bg, #e3f4ec); }
.cal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--head); border-bottom: 1px solid var(--line); }
.cal-dow span { padding: 6px 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cal .sun, .cal .sun span { color: var(--bad); }
.cal .sat, .cal .sat span { color: var(--accent); }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 3px; min-height: 104px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.cal-week:last-child { border-bottom: 0; }
.cal-day { grid-row: 1 / -1; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: transparent; min-height: 0; padding: 4px 8px; text-align: left; align-self: stretch; display: flex; align-items: flex-start; justify-content: flex-start; font-weight: 600; color: var(--ink-2); }
.cal-day:first-child { border-left: 0; }
.cal-day > span { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 12px; font-size: 13px; }
.cal-day:hover { background: var(--stripe); }
.cal-day.out { color: var(--faint); }
.cal-day.out > span { opacity: .55; }
.cal-day.sel { background: var(--accent-soft); }
.cal-day.today > span { background: var(--accent); color: #fff; }
.cal-ev { position: relative; z-index: 1; margin: 0 3px; min-height: 0; height: 22px; padding: 0 7px; border: 0; border-radius: 5px; background: var(--kb); color: var(--k); border-left: 3px solid var(--k); font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 22px; }
.cal-ev:hover { background: var(--kb); filter: brightness(.96); color: var(--k); }
.cal-ev.cont { border-left-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.cal-ev.more { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.cal-ev:active { transform: none; }
.cal-lists { margin-top: 18px; }
.cal-lists h2 { margin-top: 0; }
.cal-list { display: grid; gap: 6px; }
.cal-item { display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%; padding: 10px 12px; background: var(--panel); font-weight: 400; }
.cal-item .cal-dot { margin-top: 7px; }
.cal-item-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cal-item-main b { color: var(--ink); font-weight: 600; }
.h2-link { color: inherit; }
.proj-sched { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: -4px 0 12px; font-size: 13.5px; color: var(--ink-2); }
button.link-btn { border: 0; background: none; padding: 2px 4px; min-height: 0; color: var(--accent); font-weight: 600; }
button.link-btn:hover { text-decoration: underline; background: none; }
.fm-links { display: inline-flex; gap: 14px; }
@media (max-width: 760px) {
  .cal-head h1 { min-width: 0; }
  .cal-legend { order: 5; width: 100%; }
  .cal-week { min-height: 64px; }
  .cal-day { padding: 2px 3px; }
  .cal-day > span { min-width: 22px; height: 22px; font-size: 12px; }
  .cal-dow span { padding: 5px 4px; text-align: center; }
  .cal-ev { margin: 0 1px; padding: 0 3px; font-size: 10.5px; border-left-width: 2px; }
}

/* ---- 사진·영수증 ---- */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.thumb { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.thumb-img { display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: 0; background: var(--head); min-height: 0; }
.thumb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-img:hover { background: var(--head); filter: brightness(.95); }
.thumb-cap { padding: 8px 10px 10px; font-size: 13px; line-height: 1.5; }
.thumb-cap .sub-line { font-size: 12px; }
.thumb-pick { position: absolute; top: 6px; left: 6px; z-index: 1; background: var(--panel); border-radius: 6px; padding: 4px 6px; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.thumb-pick input { width: 20px; height: 20px; }
.thumbs.mini { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; margin-top: 6px; }
.thumbs.mini img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.approve-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; border-color: var(--accent); }
.att-big img { width: 100%; max-height: 60vh; object-fit: contain; background: var(--head); border-radius: 8px; border: 1px solid var(--line); }
button.link-btn.clip { padding: 0 4px; color: var(--muted); }
button.link-btn.clip:hover { color: var(--accent); }
#f_files { padding: 8px; }
@media (max-width: 760px) {
  .thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
