:root {
  --bg: #ECEEF2; --panel: #fff; --sub: #F5F6F8; --line: #D9DCE3; --line2: #E7E9EE;
  --ink: #191C27; --ink2: #454B5E; --muted: #767C8F;
  --ind: #323C99; --ind2: #252D78; --ind-dk: #1E2463; --ind-soft: #E3E5F4; --ind-mid: #A9AEDB;
  --amb: #9A5F0C; --amb-soft: #FAEDD3; --red: #B4372B; --red-soft: #F8DEDA; --grn: #2B7350; --grn-soft: #DCEFE3;
  --night: #3E3778; --night-soft: #E2DFF2;
  --sans: 'Spoqa Han Sans Neo', -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --mono: 'Red Hat Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); word-break: keep-all; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ol, ul, dl, dd, fieldset { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.dim { color: var(--muted); }
.nowrap { white-space: nowrap; }
sup.nx { font: 600 9px var(--mono); color: var(--muted); margin-left: 1px; vertical-align: 5px; }
.ok, .ok-t { color: var(--grn); } .warn, .warn-t { color: var(--amb); } .bad, .bad-t { color: var(--red); } .ind-t { color: var(--ind2); font-weight: 600; }

.demo { background: #111418; color: #C9CCD1; font-size: 13px; text-align: center; padding: 8px 16px; }
.demo a, .demo button { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.demo button { background: none; border: 0; padding: 0; cursor: pointer; font-size: 13px; }

/* 틀 */
.app { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: calc(100vh - 36px); }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo span { display: flex; flex-direction: column; line-height: 1.2; }
.logo b { font-size: 16px; letter-spacing: -.02em; }
.logo small { font-size: 12px; color: var(--muted); }
.who label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.who select { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 6px; background: var(--sub); padding: 0 8px; font-size: 13px; font-weight: 500; }
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav a { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 6px; text-decoration: none; color: var(--ink2); font-weight: 500; }
#nav a:hover { background: var(--sub); }
#nav a.on { background: var(--ind-soft); color: var(--ind2); font-weight: 700; box-shadow: inset 3px 0 0 var(--ind); }
#nav .sec { font-size: 11.5px; color: var(--muted); padding: 14px 12px 4px; }
.cnt { font: 600 11px var(--mono); font-style: normal; background: var(--ind); color: #fff; border-radius: 9px; padding: 1px 6px; min-width: 18px; text-align: center; }
.side .now { margin-top: auto; display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line2); padding-top: 12px; }
.mtop, .tabbar, .scrim { display: none; }

main { padding: 26px 32px 56px; min-width: 0; }
.page { max-width: 1120px; }
.page.wide { max-width: none; }
.page.narrow { max-width: 640px; }
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 20px; margin-bottom: 18px; flex-wrap: wrap; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px; min-width: 0; }
.card > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line2); }
.card > header h2 { font-size: 14px; font-weight: 700; }
.card .more { font-size: 12.5px; color: var(--ind); text-decoration: none; font-weight: 500; }
.pad { padding: 14px 16px; }
.pad-x { padding: 0 16px 12px; }
.note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.empty { background: var(--panel); border: 1px dashed var(--line); border-radius: 8px; padding: 36px 20px; text-align: center; display: grid; gap: 10px; justify-items: center; color: var(--muted); }
.empty b { color: var(--ink); font-size: 15px; }
.empty-s { padding: 18px 16px; color: var(--muted); font-size: 13.5px; }

.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.home-grid .card { margin: 0; }
.span2 { grid-column: 1 / -1; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tiles.sm .tile b { font-size: 19px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 11px 14px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.tile small { font-size: 12px; color: var(--muted); }
.tile b { font-size: 22px; font-weight: 600; }
a.tile:hover { border-color: var(--ind-mid); }
.tile.hot { border-color: #E2C38C; box-shadow: inset 3px 0 0 #D69B33; }
.tile.bad { border-color: #E3A69E; box-shadow: inset 3px 0 0 var(--red); }
.tile.bad b { color: var(--red); }

/* 칩·버튼 */
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap; margin: 1px 4px 1px 0; background: #EEF0F3; color: var(--ink2); text-decoration: none; }
.chip.ok { background: var(--grn-soft); color: var(--grn); }
.chip.warn { background: var(--amb-soft); color: var(--amb); }
.chip.bad { background: var(--red-soft); color: var(--red); }
.chip.ind, .chip.lv { background: var(--ind-soft); color: var(--ind2); }
.chip.ink { background: var(--ind-dk); color: #fff; }
.chip.night { background: var(--night-soft); color: var(--night); }
.chip.mute { background: #EEF0F3; color: var(--muted); }
.chip.dash { background: none; border: 1px dashed var(--ind-mid); color: var(--ind); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #B9BECB; }
.btn.pri { background: var(--ind); border-color: var(--ind); color: #fff; }
.btn.pri:hover { background: var(--ind2); }
.btn.bad { border-color: #E3A69E; color: var(--red); }
.btn.bad[type=submit], .mbox .btn.bad { background: var(--red); border-color: var(--red); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.big { height: 52px; font-size: 16px; width: 100%; margin-top: 14px; }
.btn.big .mono { font-weight: 400; opacity: .8; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.dis, .btn:disabled { opacity: .4; pointer-events: none; }
.acts { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

/* 오늘 카드 */
.today-b { padding: 16px; }
.today .state { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.io2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.io2 > div { background: var(--sub); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; }
.io2 small { font-size: 12px; color: var(--muted); }
.io2 .mono { font-size: 26px; font-weight: 600; line-height: 1.25; }
.io2 em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.elapsed { margin-top: 10px; font-size: 14px; }
.elapsed .mono { font-weight: 600; font-size: 16px; }
.elapsed small { color: var(--muted); }

/* 주 막대 */
.wbar { position: relative; display: flex; height: 10px; background: #E7E9EF; border-radius: 3px; min-width: 80px; }
.wbar.big { height: 16px; margin: 4px 0 24px; }
.wbar .wb { height: 100%; }
.wbar .wb:first-child { border-radius: 3px 0 0 3px; }
.wbar .reg { background: var(--ind); }
.wbar .ot { background: var(--ind-dk); }
.wbar .plan { background: repeating-linear-gradient(135deg, var(--ind-mid) 0 3px, #D5D8EE 3px 6px); }
.wbar .mk { position: absolute; top: -3px; bottom: -3px; border-left: 1px dashed #8F95A8; }
.wbar .mk.lim { border-left: 2px solid var(--red); }
.wbar .mk b { display: none; }
.wbar.big .mk b { display: block; position: absolute; top: 100%; transform: translateX(-50%); margin-top: 3px; font: 500 10.5px var(--mono); color: var(--muted); }
.wbar.big .mk.lim b { color: var(--red); }
.nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.nums dt { font-size: 12px; color: var(--muted); }
.nums dd { font-size: 17px; font-weight: 600; }
.nums dd .mono { font-weight: 600; }
.nums.sm dd { font-size: 15px; font-family: var(--mono); }
.big-n { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; }
.big-n .mono { font-size: 36px; font-weight: 600; color: var(--ind2); line-height: 1; }
.big-n small { color: var(--muted); }
.hbars { padding: 8px 16px; display: grid; gap: 7px; }
.hbars li { display: grid; grid-template-columns: 54px 1fr 50px; gap: 10px; align-items: center; font-size: 13px; }
.hbars .mono { text-align: right; font-weight: 600; }

.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line2); font-size: 13.5px; }
.list li:first-child { border-top: 0; }
.list.log li { font-size: 12.5px; padding: 7px 16px; }

/* 필터·탭 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters select, .filters input[type=search], .mnav input { height: 36px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; background: var(--panel); font-size: 13.5px; }
.filters input[type=search] { min-width: 200px; }
.chk { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); font-size: 13.5px; cursor: pointer; }
.chk input { accent-color: var(--ind); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.tabs a small { font-weight: 400; font-size: 11.5px; }
.tabs a.on { color: var(--ind2); border-color: var(--ind); }
.mnav { display: flex; align-items: center; gap: 8px; }
.mnav b { font-size: 15px; min-width: 96px; text-align: center; }

/* 표 */
.tbl-wrap, .grid-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 9px 12px; background: var(--sub); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #FAFAFC; }
.tbl tr.sel td { background: #EEF0FB; }
.tbl tr.muted td { color: var(--muted); }
.tbl.num td:not(:first-child), .tbl.num th:not(:first-child) { text-align: right; font-family: var(--mono); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th.sortable.on { color: var(--ind2); }
.who-cell { display: flex; flex-direction: column; text-decoration: none; line-height: 1.3; min-width: 0; }
.who-cell b { font-size: 13.5px; font-weight: 600; }
.who-cell small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
a.who-cell:hover b { color: var(--ind); }
.who-cell.one { flex-direction: row; align-items: baseline; gap: 6px; }
.who-cell.one small { font-size: 11px; }
.empty-row { text-align: center; padding: 30px 12px !important; color: var(--muted); }

/* 월 현황판 */
.grid-wrap { max-height: 72vh; }
.grid { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.grid th, .grid td { border-bottom: 1px solid var(--line2); border-right: 1px solid var(--line2); }
.grid thead th { position: sticky; top: 0; z-index: 2; background: var(--sub); font-weight: 600; color: var(--ink2); padding: 5px 0; text-align: center; min-width: 27px; }
.grid thead th span { display: block; font: 600 12px var(--mono); }
.grid thead th small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; }
.grid thead th.we { background: #E6E8EE; color: var(--muted); }
.grid thead th.td { background: var(--ind); color: #fff; }
.grid thead th.td small { color: #CDD0EE; }
.grid .stick { position: sticky; left: 0; z-index: 1; background: var(--panel); text-align: left; padding: 0 10px; min-width: 116px; border-right: 1px solid var(--line); white-space: nowrap; }
.grid thead .stick { z-index: 3; background: var(--sub); }
.grid td { width: 27px; min-width: 27px; height: 34px; padding: 0; text-align: center; vertical-align: middle; }
.grid td a { display: block; height: 34px; text-decoration: none; font: 500 11px/34px var(--mono); color: var(--ink2); letter-spacing: -.03em; }
.grid td.sel { box-shadow: inset 0 0 0 2px var(--ind); }
.grid td.sum, .grid th.sum { font: 500 12px var(--mono); text-align: right; padding: 0 8px; background: var(--sub); min-width: 44px; white-space: nowrap; }
.grid thead th.sum { font-family: var(--sans); font-size: 11.5px; }
.c-ok a { color: var(--ink2); }
.c-ot a { color: var(--ind2) !important; font-weight: 700 !important; }
td.c-warn, .cc.c-warn { background: var(--amb-soft); }
td.c-warn a { color: var(--amb) !important; font-weight: 700 !important; font-family: var(--sans) !important; }
td.c-miss { box-shadow: inset 0 0 0 1.5px var(--red); background: #FFF6F4; }
td.c-miss a { color: var(--red) !important; font-weight: 700 !important; font-family: var(--sans) !important; }
td.c-bad, .cc.c-bad { background: var(--red); }
td.c-bad a { color: #fff !important; font-weight: 700 !important; font-family: var(--sans) !important; }
td.c-lv, .cc.c-lv { background: var(--ind-soft); }
td.c-lv a, td.c-lvp a { color: var(--ind2) !important; font-weight: 700 !important; font-family: var(--sans) !important; }
td.c-lvp { background: linear-gradient(135deg, var(--ind-soft) 50%, transparent 50%); }
td.c-off, .cc.c-off { background: #F1F2F5; }
td.c-hol, .cc.c-hol { background: #EBECF1; }
td.c-ow, .cc.c-ow { background: var(--ind-dk); }
td.c-ow a { color: #fff !important; }
td.c-run a { color: var(--ind) !important; font-weight: 700 !important; font-family: var(--sans) !important; }
td.c-run { box-shadow: inset 0 0 0 1.5px var(--ind-mid); }
td.c-none, .cc.c-none { background: repeating-linear-gradient(135deg, #F6F6F8 0 4px, #EFF0F3 4px 8px); }
.grid.wk td { width: 52px; }
.grid.wk thead th a { text-decoration: none; font: 600 11.5px var(--mono); display: block; padding: 4px 6px; }
.grid.wk td a { font-size: 12px; }
td.h-ok { background: var(--panel); }
td.h-warn { background: var(--amb-soft); } td.h-warn a { color: var(--amb); font-weight: 700; }
td.h-bad { background: var(--red); } td.h-bad a { color: #fff; font-weight: 700; }
td.h-none { background: #F6F6F8; }
.grid.wk td.cw { box-shadow: inset 0 0 0 2px var(--ind); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin: -6px 0 16px; }
.legend.pad-x { margin: 10px 0 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); vertical-align: -2px; margin-right: 5px; }
.legend i.c-ok { background: #fff; } .legend i.c-ot { background: var(--ind-soft); border-color: var(--ind); }
.legend i.c-warn { background: var(--amb-soft); } .legend i.c-miss { background: #FFF6F4; border: 1.5px solid var(--red); }
.legend i.c-bad { background: var(--red); } .legend i.c-lv { background: var(--ind-soft); } .legend i.c-ow { background: var(--ind-dk); }
.legend i.h-ok { background: #fff; } .legend i.h-warn { background: var(--amb-soft); } .legend i.h-bad { background: var(--red); }

/* 달력 */
.cal { display: grid; }
.cal-h, .cal-w { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) 88px; }
.cal-h span { font-size: 12px; color: var(--muted); text-align: center; padding: 7px 0; background: var(--sub); border-bottom: 1px solid var(--line); }
.cal-h span:nth-child(6), .cal-h span:nth-child(7) { color: #9AA0B2; }
.cal-w + .cal-w { border-top: 1px solid var(--line2); }
.cc { min-height: 96px; padding: 6px 7px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line2); text-decoration: none; font-size: 11.5px; position: relative; min-width: 0; overflow: hidden; }
.cal-w > .cc:first-child { border-left: 0; }
a.cc:hover { background: #F4F5FB; }
.cc .dn { font: 600 12.5px var(--mono); color: var(--ink2); }
.cc.c-hol .dn { color: var(--red); }
.cc .code { display: none; }
.cc .lb { font-size: 11px; color: var(--ind2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc .lb.dash { color: var(--ind); font-weight: 500; }
.cc .fl { font-size: 11px; font-weight: 700; white-space: nowrap; }
.cc .fl.ind { color: var(--ind); }
.cc .io { font: 400 11px var(--mono); color: var(--ink2); white-space: nowrap; }
.cc .tt { margin-top: auto; font: 600 13px var(--mono); color: var(--ink); }
.cc .tt.ot { color: var(--ind2); }
.cc.c-bad { background: var(--red-soft); }
.cc.c-bad .fl { color: var(--red); }
.cc.c-miss { box-shadow: inset 0 0 0 1.5px var(--red); background: #FFF8F6; }
.cc.c-ow { background: var(--ind-soft); }
.cc.c-ow .tt { color: var(--ind-dk); }
.cc.c-run { box-shadow: inset 0 0 0 1.5px var(--ind-mid); }
.cc.today .dn { background: var(--ind); color: #fff; border-radius: 4px; padding: 0 5px; align-self: flex-start; }
.cc.sel { box-shadow: inset 0 0 0 2px var(--ind); background: #EEF0FB; }
.cc.out { background: repeating-linear-gradient(135deg, #FAFAFB 0 4px, #F4F5F7 4px 8px); }
.cc.wk { background: var(--sub); align-items: flex-end; justify-content: flex-end; text-align: right; }
.cc.wk b { font-size: 14px; }
.cc.wk small { font-size: 10.5px; color: var(--muted); }
.cc.wk.warn b { color: var(--amb); } .cc.wk.bad b { color: var(--red); }
.msum { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1px; background: var(--line2); }
.msum > div { background: var(--panel); padding: 10px 14px; }
.msum dt { font-size: 12px; color: var(--muted); }
.msum dd { font-size: 15px; font-weight: 600; }
.msum small { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.lockbar { background: #E5E7EF; border-left: 3px solid var(--ind); border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; color: var(--ink2); }
.lockbar.warn { background: var(--amb-soft); border-color: #D69B33; color: #6E4508; }

/* 하루 패널 */
.sheet-bg { position: fixed; inset: 0; background: rgba(20, 22, 35, .28); z-index: 40; }
.sheet { position: fixed; right: 0; top: 0; bottom: 0; width: 420px; max-width: 100vw; background: var(--panel); z-index: 41; overflow-y: auto; box-shadow: -8px 0 30px rgba(20, 22, 35, .14); padding-bottom: 24px; }
.sheet > header { position: sticky; top: 0; background: var(--panel); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line2); z-index: 1; }
.sheet > header small { font-size: 12px; color: var(--muted); }
.sheet h3 { font: 600 17px var(--mono); }
.sheet .x { font-size: 13px; color: var(--muted); text-decoration: none; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; }
.kv { display: grid; grid-template-columns: 52px 1fr; gap: 8px 12px; padding: 14px 18px 6px; align-items: baseline; }
.kv dt { font-size: 12.5px; color: var(--muted); }
.kv dd .mono { font-size: 15px; font-weight: 600; }
.kv dd small { font-size: 11.5px; color: var(--muted); margin-left: 4px; }
.sheet .chips { padding: 4px 18px 6px; }
table.mini { margin: 6px 18px 4px; width: calc(100% - 36px); border-collapse: collapse; border: 1px solid var(--line2); border-radius: 6px; font-size: 12px; }
table.mini th { background: var(--sub); color: var(--muted); font-weight: 600; padding: 6px; }
table.mini td { text-align: center; padding: 8px 6px; font-size: 14px; }
.sheet .note { padding: 0 18px; }
.sheet h4 { font-size: 13px; padding: 16px 18px 4px; }
.sheet h4 small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.sheet .list li { padding: 8px 18px; }
.sheet .acts { padding: 14px 18px 0; justify-content: flex-start; }
.sheet .lockbar { margin: 14px 18px 0; }
form.fix { margin: 14px 18px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--sub); padding: 0 14px 14px; display: grid; gap: 10px; }
form.fix h4 { padding: 12px 0 0; }
form.fix .acts { padding: 0; justify-content: flex-end; }

/* 폼 */
label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink2); }
label > span small { margin-left: 4px; }
label small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=date], input[type=time], input[type=search], select, textarea { border: 1px solid var(--line); border-radius: 6px; background: #fff; font-weight: 400; color: var(--ink); }
.form input[type=text], .form input[type=date], form.fix input, form.fix select, .mbox textarea, .rej textarea { height: 42px; padding: 0 12px; font-size: 15px; width: 100%; }
.mbox textarea, .rej textarea { height: auto; padding: 8px 12px; font-size: 14px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ind); outline-offset: -1px; border-color: transparent; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form { padding: 18px; display: grid; gap: 14px; }
.seg { display: flex; gap: 3px; padding: 3px; background: var(--sub); border: 1px solid var(--line); border-radius: 8px; }
.seg label { flex: 1; display: block; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 9px 4px; border-radius: 6px; font-size: 14px; font-weight: 600; color: var(--ink2); }
.seg span small { display: block; font: 400 11px var(--mono); color: var(--muted); margin-top: 1px; }
.seg input:checked + span { background: var(--panel); color: var(--ind2); box-shadow: 0 0 0 1px var(--ind-mid), 0 1px 2px rgba(20, 22, 35, .08); }
.seg input:focus-visible + span { outline: 2px solid var(--ind); }
.preview { background: var(--ind-soft); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; color: var(--ink2); }
.preview:empty { display: none; }
.preview > b { font: 600 22px var(--mono); color: var(--ind2); }
.preview small { color: var(--muted); }
.line-prev { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.line-prev small { color: var(--muted); margin-right: 4px; }
.line-prev span { background: var(--sub); border: 1px solid var(--line2); border-radius: 4px; padding: 2px 8px; }
.line-prev i { font-style: normal; color: var(--muted); }
.errs:empty { display: none; }
.errs p { color: var(--red); background: var(--red-soft); padding: 8px 12px; border-radius: 6px; font-size: 13.5px; margin-bottom: 6px; }
.errs p.soft { background: none; color: var(--amb); padding: 0; margin-bottom: 2px; }

/* 결재 */
.reqs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); align-items: start; }
.req { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: grid; gap: 10px; }
.req.focus { box-shadow: 0 0 0 2px var(--ind); border-color: transparent; }
.req > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.req > header > div { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.tag { font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 4px; background: var(--ind-soft); color: var(--ind2); }
.tag.fix { background: var(--amb-soft); color: var(--amb); }
.by { font-size: 13px; color: var(--ink2); }
.kv2 { display: grid; gap: 4px; font-size: 13.5px; }
.kv2 > div { display: grid; grid-template-columns: 58px 1fr; gap: 10px; }
.kv2 dt { color: var(--muted); font-size: 12.5px; }
.kv2 small { color: var(--muted); }
.line { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12.5px; }
.line li { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 4px; background: var(--sub); color: var(--ink2); }
.line li b { font-weight: 600; font-size: 11.5px; color: var(--muted); }
.line li small { font: 400 11px var(--mono); color: var(--muted); }
.line li::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid #B4B9C6; box-sizing: border-box; }
.line li.done::before { background: var(--ind); border-color: var(--ind); }
.line li.now { background: var(--amb-soft); color: #6E4508; }
.line li.now::before { border-color: #D69B33; background: #fff; }
.line li.no { background: var(--red-soft); color: var(--red); }
.line li.no::before { background: var(--red); border-color: var(--red); }
.line li.skip { opacity: .5; }
.line.mini { flex-wrap: nowrap; gap: 3px; }
.line.mini li { padding: 2px 7px 2px 6px; white-space: nowrap; }
.line.mini li small { display: none; }
.rejmemo { background: var(--red-soft); color: #7D241B; border-radius: 6px; padding: 8px 12px; font-size: 13px; }
.rejmemo b { margin-right: 6px; }
.rej { display: grid; gap: 8px; }

/* 연차 */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpis > div { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 11px 14px; }
.kpis small { display: block; font-size: 12px; color: var(--muted); }
.kpis b { font-size: 26px; font-weight: 600; }
.kpis span { font-size: 12px; color: var(--muted); margin-left: 3px; }
.kpis > div:first-child b { color: var(--ind2); }
.kpis .warn { background: var(--amb-soft); border-color: #E2C38C; }
.kpis .warn b { color: var(--amb); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.two > .card { margin-bottom: 16px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { font-size: 14.5px; font-weight: 600; }
.calc-lead { font-size: 13.5px; margin: 12px 0 8px; color: var(--ink2); }
.steps { counter-reset: s; margin-top: 4px; }
.steps li { display: grid; grid-template-columns: 22px 104px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px dashed var(--line2); font-size: 13.5px; align-items: baseline; }
.steps li::before { counter-increment: s; content: counter(s); font: 600 11px var(--mono); color: #fff; background: var(--ind); border-radius: 50%; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; grid-row: 1; grid-column: 1; }
.steps li > b { font-size: 13px; }
.steps li small { color: var(--muted); }
.ladder { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 3px; margin: 14px 0 4px; }
.ladder span { background: var(--sub); border-radius: 4px; text-align: center; padding: 6px 0 5px; }
.ladder small { display: block; font-size: 10px; color: var(--muted); white-space: nowrap; }
.ladder b { font-size: 15px; color: var(--ink2); }
.ladder .on { background: var(--ind); }
.ladder .on small { color: #CDD0EE; }
.ladder .on b { color: #fff; }
.bal { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 12px 14px; background: var(--sub); border-radius: 8px; margin-top: 14px; font-size: 13px; color: var(--ink2); }
.bal b { font-size: 16px; color: var(--ink); margin-left: 2px; }
.bal i { font-style: normal; color: var(--muted); }
.bal .hi b { color: var(--ind2); font-size: 19px; }
.calc-t td { font-size: 13px; padding: 7px 12px; }
.calc-t tr.miss td { color: var(--red); }
.calc-t tr.run td { color: var(--ind); }
.calc-t tr.wait td { color: #A8ADBB; }
.calc-t tfoot td { padding: 9px 12px; background: var(--sub); font-weight: 600; border-top: 1px solid var(--line); }

/* 마감 */
.close-st { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.close-st b { font-size: 16px; }
.close-st p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.close-st.block { box-shadow: inset 4px 0 0 var(--red); }
.close-st.ready { box-shadow: inset 4px 0 0 var(--grn); }
.close-st.done { background: var(--grn-soft); border-color: #B7DCC6; }
.check > li { padding: 12px 16px; border-top: 1px solid var(--line2); }
.check > li:first-child { border-top: 0; }
.ci-h { display: flex; align-items: center; gap: 10px; }
.ci-h::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--grn); flex: none; }
.check .bad .ci-h::before { background: var(--red); }
.check .warn .ci-h::before { background: #D69B33; }
.ci-h b { font-size: 13.5px; color: var(--ink); }
.ci-h .mono { font-weight: 600; }
.check .bad .ci-h .mono { color: var(--red); }
.ci-h small { color: var(--muted); font-size: 12px; margin-left: auto; }
.check ul { margin: 6px 0 0 18px; display: grid; gap: 2px; }
.check ul a { font-size: 13px; color: var(--ink2); text-decoration: none; }
.check ul a:hover { color: var(--ind); text-decoration: underline; }
.sumt { font-size: 13px; }
.sumt td { text-align: right; font-family: var(--mono); white-space: nowrap; padding: 8px 10px; }
.sumt th { padding: 8px 10px; }
.sumt thead th:not(:first-child) { text-align: right; }
.sumt .stick { position: sticky; left: 0; background: var(--panel); z-index: 1; text-align: left; border-right: 1px solid var(--line2); }
.sumt thead .stick { background: var(--sub); }
.sumt tfoot td, .sumt tfoot th { background: var(--sub); font-weight: 700; border-top: 2px solid var(--ink2); padding: 10px; color: var(--ink); }
.sumt td small { color: var(--muted); }
.verify { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 16px; font-size: 12.5px; border-top: 1px solid var(--line2); }
.verify .ok, .verify .bad { font-weight: 600; }

/* 알림·대화상자 */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 70; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--red); }
.mbg { position: fixed; inset: 0; background: rgba(20, 22, 35, .42); z-index: 60; }
.mbox { position: fixed; z-index: 61; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 32px)); background: var(--panel); border-radius: 10px; padding: 20px; display: grid; gap: 12px; box-shadow: 0 20px 50px rgba(20, 22, 35, .25); }
.mbox h3 { font-size: 17px; }
.mb { display: grid; gap: 8px; font-size: 14px; color: var(--ink2); }

@media (max-width: 1180px) {
  .two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 50; transform: translateX(-100%); transition: transform .2s; height: auto; }
  .side.open { transform: none; box-shadow: 8px 0 30px rgba(20, 22, 35, .2); }
  .side.open + .scrim { display: block; position: fixed; inset: 0; background: rgba(20, 22, 35, .3); z-index: 49; }
  .mtop { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; height: 52px; padding: 0 12px; background: rgba(236, 238, 242, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
  .menu { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); display: grid; place-content: center; gap: 4px; cursor: pointer; padding: 0; }
  .menu span { display: block; width: 16px; height: 2px; background: var(--ink2); border-radius: 1px; }
  .mtop .logo b { font-size: 15px; }
  .mrole { margin-left: auto; font-size: 12px; color: var(--ind2); background: var(--ind-soft); border-radius: 4px; padding: 3px 8px; white-space: nowrap; }
  main { padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1; height: 58px; display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; position: relative; }
  .tabbar a.on { color: var(--ind2); }
  .tabbar a.on::before { content: ''; position: absolute; top: -1px; left: 50%; width: 28px; margin-left: -14px; height: 2px; background: var(--ind); }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis > div:first-child { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; }
  .kpis b { font-size: 20px; }
  .kpis > div:first-child b { font-size: 28px; }
  .kpis span { display: block; margin: 0; }
  .kpis > div:first-child span { display: inline; }
  .kpis > div:first-child small { display: inline; }
  .hide-m { display: none !important; }
  .filters input[type=search] { flex: 1 1 100%; min-width: 0; }
  .filters select { flex: 1 1 0; min-width: 0; }
  .ph h1 { font-size: 20px; }
  .cal-h, .cal-w { grid-template-columns: repeat(7, minmax(0, 1fr)) 42px; }
  .cc { min-height: 56px; padding: 4px 3px 3px; align-items: center; gap: 1px; }
  .cc .io, .cc .lb, .cc .fl, .cc .tt { display: none; }
  .cc .code { display: block; font: 600 12px var(--mono); color: var(--ink2); margin-top: auto; }
  .cc.c-ot .code { color: var(--ind2); }
  .cc.c-warn .code { color: var(--amb); font-family: var(--sans); font-weight: 700; }
  .cc.c-miss .code, .cc.c-bad .code { color: var(--red); font-family: var(--sans); font-weight: 700; }
  .cc.c-lv .code, .cc.c-lvp .code, .cc.c-run .code { color: var(--ind2); font-family: var(--sans); font-weight: 700; }
  .cc .dn { font-size: 11.5px; }
  .cc.today .dn { padding: 0 4px; align-self: center; }
  .cc.wk { padding: 4px 3px; align-items: center; }
  .cc.wk b { font-size: 10.5px; }
  .cc.wk small { display: none; }
  .msum { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .msum > div { padding: 8px 10px; }
  .msum dd { font-size: 14px; }
  .sheet { top: auto; left: 0; width: auto; max-height: 88vh; border-radius: 14px 14px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ladder { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .steps li { grid-template-columns: 22px minmax(0, 1fr); }
  .steps li > span { grid-column: 2; }
  .seg span { font-size: 13px; padding: 9px 2px; }
  .reqs .acts .btn { flex: 1; }
  .close-st .btn { width: 100%; }
  .grid-wrap { max-height: none; }
  .nums dd { font-size: 15px; }
  .hbars li { grid-template-columns: 50px 1fr 46px; }
  #toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .tbl th, .tbl td { padding: 8px 10px; }
}
@media (max-width: 380px) {
  .seg span small { display: none; }
}
