/* =========================================================
 * 업무관리 스타일 — 도면지(모눈) 위에 잉크와 형광 주황
 *  paper  #EEF1EC  모눈 도면지
 *  ink    #18252F  제도 잉크
 *  hi     #E8641B  측량 안전조끼 주황 (오늘 / 강조)
 * ========================================================= */
:root {
  --paper: #EEF1EC;
  --panel: #FFFFFF;
  --ink: #18252F;
  --ink-2: #3A4A55;
  --muted: #66757E;
  --line: #D3DAD4;
  --line-2: #E4E9E4;
  --grid: rgba(24, 37, 47, .05);
  --hi: #E8641B;
  --hi-soft: #FCE9DC;
  --ok: #2F7D55;
  --warn: #B87812;
  --none: #BAC3BD;
  --sun: #C8322B;
  --sat: #2F5D8A;
  --side: #18252F;
  --r: 6px;
  --bar-h: 20px;
  --dnum-h: 34px;
  --font: 'IBM Plex Sans KR', 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
}
.area-admin { --side: #2A2438; }
*, *::before, *::after { box-sizing: inherit; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum' 1;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; letter-spacing: -.01em; }
code { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: .88em; background: var(--line-2); padding: 1px 5px; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--hi); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .strong { font-weight: 600; }
.nowrap { white-space: nowrap; } .pre { white-space: pre-wrap; } .mt { margin-top: 20px; }
[hidden] { display: none !important; }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------------- 레이아웃 ---------------- */
#app { min-height: 100%; }
#app:has(.side) { display: grid; grid-template-columns: 220px 1fr; }
.side {
  position: sticky; top: 0; height: 100vh; background: var(--side); color: #E6ECE8;
  display: flex; flex-direction: column; padding: 18px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 4px 8px 22px; }
.brand-sq { width: 26px; height: 26px; border-radius: 5px; background: var(--hi); position: relative; flex: none; }
.brand-sq::before, .brand-sq::after { content: ''; position: absolute; background: var(--side); }
.brand-sq::before { left: 12px; top: 4px; width: 2px; height: 18px; }
.brand-sq::after { top: 12px; left: 4px; height: 2px; width: 18px; }
.brand b { display: block; font-size: 15px; color: #fff; }
.brand small { display: block; font-size: 12px; color: #9FB0A9; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 5px; text-decoration: none;
  color: #C9D4CF; background: none; border: 0; cursor: pointer; width: 100%; text-align: left; font-size: 14.5px;
}
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.on { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 3px 0 0 var(--hi); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 12px; }
.side-link.switch { color: #fff; }
.me { padding: 8px 10px; }
.me b { display: block; color: #fff; } .me small { color: #9FB0A9; }
.demo-tag { display: inline-block; margin-top: 4px; font-size: 11.5px; background: var(--hi); color: #fff; padding: 0 6px; border-radius: 3px; }
#view { min-width: 0; outline: none; }
.tabbar { display: none; }

.page { padding: 28px 32px 80px; max-width: 1280px; }
.page.narrow { max-width: 820px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.page-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------- 공통 부품 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 500; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #26394A; }
.btn.danger { color: var(--sun); border-color: #E7B7B3; }
.btn.primary.danger { background: var(--sun); color: #fff; border-color: var(--sun); }
.btn.ghost { background: transparent; border-style: dashed; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn .ico { width: 15px; height: 15px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); cursor: pointer; padding: 0; }
.icon-btn:hover { border-color: var(--ink-2); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; gap: 10px; }
.panel-head h2 { font-size: 16px; font-weight: 700; }
.panel-head .count { color: var(--muted); font-weight: 500; margin-left: 4px; }
.more { font-size: 13px; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.more:hover { color: var(--ink); border-color: var(--ink); }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 3px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: #DDEFE4; color: var(--ok); }
.badge.warn { background: #F6EBD3; color: var(--warn); }
.badge.none { background: #EEE; color: #8A8F8C; }
.badge.adm { background: #E8E2F3; color: #5A3E8E; }
.badge.st-진행 { background: var(--hi-soft); color: #B04A0F; }
.badge.st-예정 { background: #E1EAF4; color: var(--sat); }
.badge.st-완료 { background: #E3EDE6; color: var(--ok); }
.badge.st-중지 { background: #EEE; color: #7B7F7C; }
.tchip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--c); padding: 1px 8px 1px 6px; border-radius: 3px; background: color-mix(in srgb, var(--c) 12%, white); white-space: nowrap; }
.tchip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.tchip em { font-style: normal; font-weight: 400; color: var(--ink-2); }
.cchip { display: inline-block; font-size: 12px; font-weight: 600; color: #fff; background: var(--c); padding: 1px 8px; border-radius: 3px; white-space: nowrap; }
.kchip { display: inline-block; font-size: 12px; padding: 0 7px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink-2); }
.dday { font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.dday.hot { color: var(--hi); }
.prog { position: relative; height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; min-width: 60px; flex: 1; }
.prog i { position: absolute; inset: 0 auto 0 0; background: var(--ink); border-radius: 3px; }
.legend { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.alert { background: #FBE7E5; color: #8E231D; border: 1px solid #F0C5C1; padding: 10px 12px; border-radius: var(--r); }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.ok-t { color: var(--ok); font-weight: 600; } .need { color: var(--hi); font-weight: 600; }
.loading { display: flex; align-items: center; gap: 10px; padding: 40px 32px; color: var(--muted); }
.spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--hi); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty p { margin: 0 0 10px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); background: var(--panel); padding: 5px 12px; border-radius: 999px; cursor: pointer; font-size: 13.5px; }
.chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip span { color: var(--muted); font-size: 12px; }
.chip.on { background: var(--c); border-color: var(--c); color: #fff; }
.chip.on::before { background: #fff; }
.chip.on span { color: rgba(255, 255, 255, .8); }

.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper strong { font-size: 17px; min-width: 7.5em; text-align: center; }
.stepper strong small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 4px; }
.bar-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs, .seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 3px; }
.tabs button, .seg button { border: 0; background: none; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-weight: 500; color: var(--muted); }
.tabs button.on, .seg button.on { background: var(--ink); color: #fff; }
.filters { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.search { padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--r); min-width: 240px; background: var(--panel); }

/* 표 */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); background: #F7F9F6; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr[data-pid] { cursor: pointer; }
.tbl tr[data-pid]:hover td { background: #FAFBF9; }
.tbl .num { text-align: right; }
.tbl th.off, .tbl td.off { color: var(--sun); }
.tbl.compact td { padding: 7px 10px; font-size: 13.5px; vertical-align: top; }
.tbl tr.dim td { color: var(--muted); }

/* 폼 */
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label, .wk-notes label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; background: #fff; font-size: 14.5px; font-weight: 400; color: var(--ink); width: 100%; min-width: 0;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--hi) 60%, white); outline-offset: 0; border-color: var(--hi); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px 12px; margin: 0; }
legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 4px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
label.check { flex-direction: row !important; align-items: center; gap: 6px; font-weight: 400 !important; font-size: 14px !important; color: var(--ink) !important; }
.switch-l { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.ms-row { display: grid; grid-template-columns: 110px 1fr 140px 140px 34px; gap: 6px; margin-bottom: 6px; }

/* 모달 */
.modal-wrap { position: fixed; inset: 0; background: rgba(24, 37, 47, .45); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--panel); border-radius: 8px; width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 18px 50px rgba(24, 37, 47, .3); }
.modal.wide { width: min(880px, 100%); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-2); gap: 12px; }
.modal header h2 { font-size: 17px; }
.modal header .icon-btn { border: 0; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-2); }
.modal footer .danger:first-child { margin-right: auto; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r); font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.toast.err { background: var(--sun); }

/* ---------------- 로그인 ---------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 28px; display: flex; flex-direction: column; gap: 16px; border-top: 5px solid var(--hi); }
.login-card h1 { font-size: 22px; }
.brand-mark { font-size: 13px; color: var(--muted); font-weight: 600; }
.demo summary { cursor: pointer; color: var(--ink-2); font-size: 14px; }
.demo form { margin-top: 12px; }

/* ---------------- 대시보드 ---------------- */
.hero { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 20px; }
.hero-date { padding: 24px 26px; background: var(--ink); color: #fff; position: relative; display: flex; flex-direction: column; gap: 6px; }
.hero-date::after { /* 측점 표시 */
  content: ''; position: absolute; right: 18px; top: 18px; width: 22px; height: 22px; border: 2px solid var(--hi); border-radius: 50%;
  background: linear-gradient(var(--hi), var(--hi)) center / 2px 100% no-repeat, linear-gradient(var(--hi), var(--hi)) center / 100% 2px no-repeat;
}
.hero-y { font-size: 13px; color: #9FB0A9; }
.hero-date h1 { font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.hero-date h1 span { font-size: 18px; font-weight: 500; color: #C9D4CF; }
.hero-date p { margin: 0; color: #C9D4CF; font-size: 13.5px; }
.my-status { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.my-item { text-decoration: none; background: rgba(255, 255, 255, .07); border-radius: 4px; padding: 6px 10px; font-size: 13.5px; }
.my-item:hover { background: rgba(255, 255, 255, .13); }
.my-item .tchip { background: #fff; }
.my-item .ok-t { color: #8FD3AC; }
.field-board { padding: 22px 26px; }
.fb-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.fb-head h2 { font-size: 18px; }
.fb-head span { color: var(--muted); font-size: 13px; }
.fb-bar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; gap: 2px; margin-bottom: 14px; }
.fb-bar i { background: var(--c); }
.fb-bar i.none { background: repeating-linear-gradient(45deg, var(--none) 0 3px, #E4E9E4 3px 6px); }
.fb-groups { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fb-groups li { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: baseline; padding-bottom: 8px; border-bottom: 1px dashed var(--line-2); }
.fb-groups li:last-child { border-bottom: 0; }
.fb-k { font-weight: 700; color: var(--c, var(--muted)); font-size: 14px; display: flex; gap: 6px; align-items: baseline; }
.fb-k b { font-size: 18px; }
.fb-names { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.fb-names small { color: var(--muted); margin-left: 4px; font-size: 12.5px; }
.fb-none .fb-names { color: var(--muted); }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.span2 { grid-column: span 2; }
.upc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.upc li { display: grid; grid-template-columns: 62px 1fr; gap: 10px; padding: 9px 0 9px 10px; border-left: 3px solid var(--c); border-bottom: 1px solid var(--line-2); }
.upc li:last-child { border-bottom: 0; }
.upc-d { font-weight: 700; font-size: 13px; color: var(--ink-2); padding-top: 1px; }
.upc-d.now { color: var(--hi); }
.upc b { display: block; font-size: 14px; font-weight: 600; }
.upc small { color: var(--muted); font-size: 12.5px; }
.sub-meter .meter { display: flex; height: 10px; gap: 2px; border-radius: 3px; overflow: hidden; background: var(--line-2); }
.meter .ok { background: var(--ok); } .meter .warn { background: #E3B55A; } .meter .none { background: var(--none); }
.sub-meter p { margin: 10px 0 12px; font-size: 14px; }
.sub-meter p b { font-size: 26px; margin-right: 4px; }
.sub-meter p span { color: var(--muted); margin-left: 12px; }
.names-line { font-size: 14px; margin: 0; }
.run { list-style: none; padding: 0; margin: 0; }
.run li { display: grid; grid-template-columns: 4px 1fr 200px 56px; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.run li:last-child { border-bottom: 0; }
.run li:hover .run-main b { text-decoration: underline; }
.run-cat { width: 4px; height: 32px; background: var(--c); border-radius: 2px; }
.run-main b { display: block; font-weight: 600; font-size: 14.5px; }
.run-main small { color: var(--muted); font-size: 12.5px; }
.run-prog { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.run-prog span { width: 36px; text-align: right; color: var(--ink-2); }

/* 근무 현황표 */
.matrix-wrap { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.matrix { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.matrix th, .matrix td { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); text-align: center; padding: 4px 2px; min-width: 32px; height: 34px; }
.matrix thead th { background: #F7F9F6; font-weight: 500; color: var(--ink-2); line-height: 1.1; }
.matrix thead th b { display: block; font-size: 13px; } .matrix thead th small { font-size: 11px; color: var(--muted); }
.matrix .off { background: #FAF3F2; } .matrix thead th.off, .matrix thead th.off small { color: var(--sun); }
.matrix .today { box-shadow: inset 2px 0 0 var(--hi), inset -2px 0 0 var(--hi); }
.matrix thead th.today { background: var(--hi); color: #fff; } .matrix thead th.today small { color: #fff; }
.matrix th.sticky { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; padding: 4px 12px; min-width: 96px; white-space: nowrap; }
.matrix th.sticky b { font-weight: 600; } .matrix th.sticky small { color: var(--muted); margin-left: 4px; font-size: 11.5px; }
.matrix thead th.sticky { background: #F7F9F6; }
.matrix tfoot td, .matrix tfoot th { font-size: 12px; color: var(--muted); background: #F7F9F6; }
.mcell { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 4px; background: var(--c); color: #fff; font-weight: 700; font-size: 12px; }
.matrix.editable td[data-u] { cursor: pointer; }
.matrix.editable td[data-u]:hover { background: var(--hi-soft); }
.reg-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 24px; }
.reg-list li { display: grid; grid-template-columns: 64px 1fr 48px; gap: 10px; align-items: center; font-size: 13.5px; }
.reg-list b { text-align: right; font-weight: 500; color: var(--muted); }

/* ---------------- 사업현황 캘린더 ---------------- */
.cal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px 20px; }
.cal-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.cal-top .stepper strong { font-size: 22px; }
.cal-grid { border-top: 2px solid var(--ink); }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cal-dow span { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.cal-dow .sun { color: var(--sun); } .cal-dow .sat { color: var(--sat); }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 3px; min-height: 118px; border-bottom: 1px solid var(--line-2); position: relative; padding-bottom: 6px; }
.cal-day { grid-row: 1 / -1; border: 0; border-right: 1px solid var(--line-2); background: none; text-align: left; padding: 6px 8px; cursor: pointer; display: flex; justify-content: space-between; align-items: flex-start; font-size: 13.5px; }
.cal-day:nth-child(7) { border-right: 0; }
.cal-day:hover { background: #F7F9F6; }
.cal-day.other .dnum { color: #B3BCB6; }
.cal-day.sun .dnum { color: var(--sun); } .cal-day.sat .dnum { color: var(--sat); }
.cal-day.other.sun .dnum, .cal-day.other.sat .dnum { opacity: .45; }
.dnum { font-weight: 600; width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 50%; }
.cal-day.today .dnum { background: var(--hi); color: #fff; }
.cal-day.sel { background: var(--hi-soft); }
.more-n { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.bar {
  margin: 0 3px; height: var(--bar-h); border-radius: 3px; font-size: 12px; line-height: var(--bar-h); padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--c) 15%, white); color: color-mix(in srgb, var(--c) 80%, black); border-left: 3px solid var(--c); cursor: pointer; position: relative; z-index: 1;
}
.bar span { overflow: hidden; text-overflow: ellipsis; display: block; }
.bar small { font-size: 11px; opacity: .75; }
.bar.k-ms { background: var(--c); color: #fff; border-left-color: rgba(0, 0, 0, .18); font-weight: 600; }
.bar.k-hol { background: transparent; color: var(--sun); border-left: 0; font-weight: 600; cursor: default; padding-left: 4px; }
.bar.k-period { border-left-width: 3px; }
.bar.cl { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; border-left-style: dashed; }
.bar.cr { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.bar:hover { filter: brightness(.96); }

.month-sum { margin-top: 24px; }
.month-sum > h2, .ev-detail h2 { font-size: 19px; margin-bottom: 12px; }
.ms-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ms-col { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: var(--r); padding: 14px 16px; }
.ms-col h3 { color: var(--c); font-size: 15px; margin-bottom: 8px; }
.ms-col ul { list-style: none; margin: 0; padding: 0; }
.ms-col li { padding: 6px 0; border-top: 1px dashed var(--line-2); cursor: pointer; }
.ms-col li:first-child { border-top: 0; }
.ms-col li b { display: block; font-weight: 500; font-size: 14px; }
.ms-col li small { color: var(--muted); font-size: 12.5px; }
.ev-detail { margin-top: 28px; }
.ev-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 4px; }
.ev-head h2 { margin: 0; } .ev-head h2 span { color: var(--hi); font-size: 16px; margin-left: 6px; }
.ev { padding: 16px 4px 16px 16px; border-bottom: 1px solid var(--line); border-left: 3px solid var(--c); margin-top: 10px; background: var(--panel); }
.ev[data-pid] { cursor: pointer; }
.ev[data-pid]:hover h3 { text-decoration: underline; }
.ev h3 { font-size: 16.5px; font-weight: 700; }
.ev .when { margin: 4px 0 6px; font-size: 14px; color: var(--ink-2); }
.ev-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ev-desc { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.ev-note { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }

/* 사업 상세 */
.pd-top { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 8px 14px; margin: 0; font-size: 14.5px; }
.kv dt { color: var(--muted); font-size: 13.5px; }
.kv dd { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kv dd .prog { max-width: 200px; }
h3.sub { font-size: 14.5px; margin: 20px 0 8px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 4px 0 10px 8px; font-size: 14px; }
.timeline li::before { content: ''; position: absolute; left: -21px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--hi); border: 2px solid #fff; }
.timeline li.past::before { background: var(--none); }
.timeline li.past { color: var(--muted); }
.timeline time { display: block; font-size: 12.5px; color: var(--muted); }

/* ---------------- 주간업무보고 ---------------- */
.wk-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; font-size: 14px; }
.wk-total { margin-left: auto; } .wk-total b { font-size: 18px; }
.wk-days { display: flex; flex-direction: column; gap: 6px; }
.wk-day { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.wk-day.today { border-color: var(--hi); box-shadow: inset 3px 0 0 var(--hi); }
.wk-day-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 0; background: none; cursor: pointer; text-align: left; }
.wk-date { display: inline-flex; gap: 6px; align-items: baseline; min-width: 64px; font-size: 14px; }
.wk-date b { font-size: 16px; }
.wk-day.off .wk-date b { color: var(--sun); }
.hol { font-size: 12px; color: var(--sun); }
.wk-count { margin-left: auto; font-size: 13px; color: var(--muted); }
.wk-body { display: none; padding: 0 14px 14px; }
.wk-day.open .wk-body { display: block; }
.wk-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.wk-row { display: grid; grid-template-columns: minmax(160px, 240px) 1fr 84px 34px; gap: 8px; align-items: start; }
.wk-row textarea { min-height: 40px; }
.hrs { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.wk-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.wk-notes label:last-child { grid-column: span 2; }
.sticky-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 0; margin-top: 12px; background: linear-gradient(transparent, var(--paper) 30%); }
.dirty { margin-right: auto; font-size: 13px; color: var(--hi); font-weight: 600; }
.rep { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 6px; }
.rep summary { display: flex; gap: 10px; align-items: center; padding: 12px 16px; cursor: pointer; list-style: none; }
.rep summary::-webkit-details-marker { display: none; }
.rep summary::after { content: '+'; margin-left: auto; color: var(--muted); font-size: 18px; }
.rep[open] summary::after { content: '−'; }
.rep summary small { color: var(--muted); }
.rep-body { padding: 0 16px 16px; }
.notes { display: grid; grid-template-columns: 80px 1fr; gap: 6px 12px; margin: 12px 0 0; font-size: 14px; }
.notes dt { color: var(--muted); font-size: 13px; } .notes dd { margin: 0; }

/* ---------------- 내·외근 입력 ---------------- */
.att-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.att-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.att-row { display: grid; grid-template-columns: 96px 110px 1fr 1fr 1fr; gap: 8px; padding: 6px 12px 6px 10px; border-bottom: 1px solid var(--line-2); align-items: center; border-left: 4px solid var(--c); }
.att-row:last-child { border-bottom: 0; }
.att-row.off { background: #FBF6F5; }
.att-row.today { background: var(--hi-soft); }
.att-date { display: flex; gap: 6px; align-items: baseline; }
.att-date b { font-size: 16px; width: 22px; text-align: right; }
.att-date span { font-size: 13px; color: var(--muted); }
.att-row.off .att-date span, .att-row.off .att-date b { color: var(--sun); }
.att-date em { font-style: normal; font-size: 11px; color: var(--sun); }
.att-row select, .att-row input { padding: 6px 8px; font-size: 14px; }

/* 설정 */
.tree { background: #F7F9F6; border: 1px solid var(--line-2); padding: 12px 14px; border-radius: var(--r); font-size: 13px; overflow-x: auto; font-family: ui-monospace, Consolas, monospace; }
.panel + .panel { margin-top: 16px; }
.print-area { display: none; }

/* ---------------- 모바일 ---------------- */
@media (max-width: 900px) {
  #app:has(.side) { grid-template-columns: 1fr; }
  .side { display: none; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--side);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #AFBDB7; text-decoration: none; font-size: 11px; padding: 4px 0; }
  .tabbar a.on { color: #fff; }
  .tabbar a.on .ico { color: var(--hi); }
  .tabbar .ico { width: 21px; height: 21px; }
  .page { padding: 18px 14px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 21px; }
  .page-head p { font-size: 13px; }
  .hero { grid-template-columns: 1fr; }
  .hero-date h1 { font-size: 28px; }
  .dash-grid { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .run li { grid-template-columns: 4px 1fr 50px; }
  .run-prog { grid-column: 2 / 4; grid-row: 2; }
  .sticky-actions { bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .row3 { grid-template-columns: 1fr 1fr; }
  .ms-row { grid-template-columns: 1fr 1fr; }
  .ms-row [data-m=title] { grid-column: span 2; order: -1; }
  .search { min-width: 0; width: 100%; }
  /* 표 → 카드 */
  .tbl.cards-sm, .tbl.cards-sm tbody, .tbl.cards-sm tr, .tbl.cards-sm td { display: block; }
  .tbl.cards-sm { border: 0; background: none; }
  .tbl.cards-sm thead { display: none; }
  .tbl.cards-sm tr { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; padding: 8px 12px; }
  .tbl.cards-sm td { border: 0; padding: 3px 0; display: flex; gap: 10px; align-items: center; }
  .tbl.cards-sm td[data-l]::before { content: attr(data-l); width: 64px; flex: none; color: var(--muted); font-size: 12px; }
  .tbl.cards-sm td.hide-sm { display: none; }
  .tbl.cards-sm td.num { text-align: left; }
}
@media (max-width: 640px) {
  :root { --bar-h: 6px; --dnum-h: 28px; }
  .cal { padding: 12px 8px; margin: 0 -6px; }
  .cal-top .stepper strong { font-size: 18px; }
  .cal-week { min-height: 64px; row-gap: 2px; }
  .cal-day { padding: 4px 2px; flex-direction: column; align-items: center; gap: 0; font-size: 12.5px; }
  .more-n { font-size: 10px; }
  .dnum { width: 22px; height: 22px; }
  .bar { font-size: 0; padding: 0; margin: 0 1px; border-left-width: 0; }
  .bar span { display: none; }
  .bar.k-hol { display: none; }
  .bar.k-period { background: color-mix(in srgb, var(--c) 45%, white); }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-right: -14px; padding-bottom: 4px; }
  .chip { flex: none; }
  .row2, .row3, .wk-notes { grid-template-columns: 1fr; }
  .wk-notes label:last-child { grid-column: auto; }
  .wk-row { grid-template-columns: 1fr 84px 34px; }
  .wk-row select { grid-column: 1 / 4; }
  .wk-row textarea { grid-column: 1 / 2; }
  .att-row { grid-template-columns: 70px 1fr; gap: 6px; padding: 8px 10px; }
  .att-date { grid-row: span 3; flex-direction: column; gap: 0; align-self: start; }
  .att-row input[data-f=place], .att-row select[data-f=projectId], .att-row input[data-f=note] { grid-column: 2; }
  .att-row input[data-f=note] { display: none; }
  .fb-groups li { grid-template-columns: 1fr; gap: 2px; }
  .hero-date, .field-board { padding: 18px; }
  .kv { grid-template-columns: 76px 1fr; }
  .modal-wrap { padding: 0; align-items: end; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 12px 12px 0 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------------- 인쇄 ---------------- */
@media print {
  body { background: #fff; }
  .side, .tabbar, .page-head, .bar-line, .page > .scroll-x, .toasts { display: none !important; }
  #app:has(.side) { display: block; }
  .print-area { display: block !important; }
  .print-area h1 { font-size: 18px; margin-bottom: 12px; }
  .print-area article { break-inside: avoid; margin-bottom: 16px; }
  .print-area h2 { font-size: 14px; margin-bottom: 6px; }
}
