/* ───────── CNK ERP — 디자인 토큰 ───────── */
:root {
  --navy-900: #081a3d; --navy-800: #0c2452; --navy-700: #12306a; --navy-600: #1b3f86;
  --pri: #2f6bff; --pri-600: #2457e0; --pri-50: #eef3ff; --pri-100: #dbe6ff;
  --bg: #f3f5fa; --card: #ffffff; --line: #e5e9f2; --line-2: #eef1f7;
  --txt: #141c2e; --txt-2: #4a5468; --txt-3: #8a93a6;
  --red: #e5484d; --red-50: #fdeeee; --green: #12a150; --green-50: #e6f6ed;
  --orange: #e2850b; --orange-50: #fdf3e3; --purple: #7c5ce6; --purple-50: #f1edfd; --gray-50: #f1f3f7;
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --sh-1: 0 1px 2px rgba(16, 28, 56, .05), 0 1px 3px rgba(16, 28, 56, .06);
  --sh-2: 0 8px 24px rgba(16, 28, 56, .08), 0 2px 6px rgba(16, 28, 56, .05);
  --sh-3: 0 24px 64px rgba(8, 20, 50, .28);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --side-w: 252px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--txt); }
body { font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; letter-spacing: -.01em; }
.hide { display: none !important; }
a { color: var(--pri); text-decoration: none; }
.num, td.n, .kpi-v { font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ───────── 로그인 ───────── */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-brand { position: relative; overflow: hidden; color: #fff; padding: 56px;
  background: radial-gradient(1200px 600px at -10% -20%, #1f4fb8 0%, transparent 60%), linear-gradient(160deg, var(--navy-700), var(--navy-900));
  display: flex; flex-direction: column; justify-content: space-between; }
.login-brand .lg { width: 168px; color: #fff; animation: fadeUp .8s var(--ease) both; }
.login-brand .lg .lg-box { stroke: rgba(255,255,255,.45); }
.login-brand h1 { font-size: 34px; line-height: 1.3; margin: 0 0 12px; font-weight: 700; letter-spacing: -.02em; animation: fadeUp .8s .1s var(--ease) both; }
.login-brand p { opacity: .7; margin: 0; animation: fadeUp .8s .2s var(--ease) both; }
.login-brand .deco { position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%; }
.login-brand .deco::after { content: ""; position: absolute; inset: 60px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.login-side { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 380px; animation: fadeUp .6s .15s var(--ease) both; }
.login-card h2 { font-size: 24px; margin: 0 0 6px; }
.login-card .sub { color: var(--txt-3); margin: 0 0 28px; }
.login-card .lg-m { display: none; width: 120px; color: var(--navy-800); margin-bottom: 28px; }
.login-card .btn { width: 100%; height: 48px; margin-top: 8px; font-size: 15px; }

/* ───────── 앱 레이아웃 ───────── */
.app { display: flex; min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 30; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%); color: #c9d4ee; }
.side-logo { padding: 26px 24px 18px; display: flex; align-items: center; gap: 12px; }
.side-logo .lg { width: 78px; color: #fff; }
.side-logo .lg .lg-box { stroke: rgba(255,255,255,.4); }
.side-logo .tt { font-size: 12px; line-height: 1.35; color: #9fb0d6; border-left: 1px solid rgba(255,255,255,.15); padding-left: 12px; }
.side-logo .tt b { display: block; color: #fff; font-size: 14px; font-weight: 700; }
.btn-quick { margin: 6px 18px 18px; height: 44px; border: 0; border-radius: 10px; cursor: pointer; color: #fff; font: inherit; font-weight: 700; font-size: 14px;
  background: linear-gradient(180deg, #3d78ff, var(--pri-600)); box-shadow: 0 6px 18px rgba(47,107,255,.35), inset 0 1px 0 rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center; gap: 8px; position: relative; overflow: hidden; transition: transform .15s, box-shadow .2s; }
.btn-quick:hover { box-shadow: 0 8px 24px rgba(47,107,255,.5), inset 0 1px 0 rgba(255,255,255,.2); }
.menu { flex: 1; overflow-y: auto; padding: 0 12px 16px; }
.menu-g { font-size: 11.5px; font-weight: 600; color: #6f83b3; padding: 16px 12px 6px; letter-spacing: .02em; }
.menu a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin: 2px 0; border-radius: 9px;
  color: #c3cee8; font-size: 14px; transition: background .2s, color .2s, transform .2s var(--ease); }
.menu a:hover { background: rgba(255,255,255,.06); color: #fff; transform: translateX(2px); }
.menu a.on { background: rgba(255,255,255,.12); color: #fff; font-weight: 700; }
.menu a.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #6d9bff;
  animation: growY .3s var(--ease); }
.menu a .i { opacity: .85; }
.side-foot { padding: 14px 18px 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.side-foot .av { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.12); display: grid; place-items: center; color: #fff; font-weight: 700; }
.side-foot .em { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9fb0d6; }
.side-foot button { background: none; border: 0; color: #9fb0d6; cursor: pointer; padding: 6px; border-radius: 6px; }
.side-foot button:hover { color: #fff; background: rgba(255,255,255,.08); }

.body { flex: 1; min-width: 0; margin-left: var(--side-w); }
.head { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 32px; background: rgba(243,245,250,.85); backdrop-filter: blur(10px); }
.crumb { font-size: 22px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.crumb .g { color: var(--txt-3); font-weight: 600; }
.crumb .sep { color: #c3c9d6; font-weight: 400; }
.head-r { display: flex; align-items: center; gap: 10px; color: var(--txt-3); font-size: 13px; }
.chip-date { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; display: flex; gap: 6px; align-items: center; }
#view { padding: 4px 32px 48px; }
.page { animation: pageIn .38s var(--ease) both; }

.mtop, .bnav, .scrim { display: none; }

/* ───────── 카드 / KPI ───────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card + .card, .card + .sec, .kpis + .card { margin-top: 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-h .muted { font-size: 12.5px; }
.card-b { padding: 18px 20px; }
.sec { margin-top: 20px; }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 16px; }
.grid2 > .card + .card { margin-top: 0; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px;
  box-shadow: var(--sh-1); transition: transform .25s var(--ease), box-shadow .25s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.kpi-l { display: flex; align-items: center; gap: 8px; color: var(--txt-2); font-size: 13px; font-weight: 600; }
.kpi-l .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--pri-50); color: var(--pri); }
.kpi-l .ico.red { background: var(--red-50); color: var(--red); } .kpi-l .ico.green { background: var(--green-50); color: var(--green); }
.kpi-l .ico.orange { background: var(--orange-50); color: var(--orange); } .kpi-l .ico.purple { background: var(--purple-50); color: var(--purple); }
.kpi-v { font-size: 26px; font-weight: 800; margin-top: 12px; letter-spacing: -.03em; white-space: nowrap; }
.kpi-v small { font-size: 15px; font-weight: 600; color: var(--txt-3); margin-left: 2px; }
.kpi-s { color: var(--txt-3); font-size: 12.5px; margin-top: 2px; }
.kpi.accent { background: linear-gradient(135deg, var(--navy-700), var(--navy-900)); border-color: transparent; color: #fff; }
.kpi.accent .kpi-l { color: #b9c7e8; } .kpi.accent .kpi-s { color: #8fa3d0; } .kpi.accent .kpi-l .ico { background: rgba(255,255,255,.12); color: #fff; }
.kpi.accent::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; border: 1px solid rgba(255,255,255,.1); }

/* ───────── 필터 바 ───────── */
.filter { padding: 14px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.filter .fl { font-size: 12px; color: var(--txt-3); font-weight: 600; }
.range { display: flex; align-items: center; gap: 6px; }
.range input { width: 142px; }
.months { display: flex; gap: 4px; flex-wrap: wrap; }
.mchip { border: 1px solid var(--line); background: var(--card); color: var(--txt-2); height: 32px; min-width: 40px; padding: 0 10px; border-radius: 8px;
  font: inherit; font-size: 12.5px; cursor: pointer; transition: all .18s var(--ease); position: relative; overflow: hidden; }
.mchip:hover { border-color: var(--pri); color: var(--pri); }
.mchip.on { background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 700; box-shadow: 0 4px 12px rgba(47,107,255,.3); }
.mchip:disabled { opacity: .35; cursor: default; }
.filter .sp { flex: 1; }
.filter select, .filter .search { width: auto; min-width: 150px; }

/* ───────── 폼 ───────── */
input, select, textarea { font: inherit; font-size: 14px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--txt); width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px rgba(47,107,255,.15); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--pri); }
input[type=file] { padding: 8px; height: auto; }
.form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.form .full { grid-column: 1 / -1; }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--txt-2); }
.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--txt); cursor: pointer; }
.preview { grid-column: 1 / -1; border-radius: 10px; padding: 14px 16px; background: var(--pri-50); border: 1px solid var(--pri-100); color: var(--txt-2);
  font-size: 13px; line-height: 1.8; transition: all .2s; }
.preview b { color: var(--txt); font-size: 15px; }
.preview .big { font-size: 20px; font-weight: 800; color: var(--navy-700); }
.preview .warn { color: var(--orange); font-weight: 600; }

.btn { height: 40px; padding: 0 16px; border-radius: 9px; border: 1px solid transparent; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; position: relative; overflow: hidden; white-space: nowrap;
  background: var(--pri); color: #fff; box-shadow: 0 2px 6px rgba(47,107,255,.25); transition: transform .12s, background .2s, box-shadow .2s; }
.btn:hover { background: var(--pri-600); }
.btn:active, .btn-quick:active, .mchip:active, .qcard:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.navy { background: var(--navy-700); box-shadow: 0 2px 6px rgba(12,36,82,.25); } .btn.navy:hover { background: var(--navy-800); }
.btn.ghost { background: #fff; color: var(--txt-2); border-color: var(--line); box-shadow: none; } .btn.ghost:hover { border-color: #cfd6e4; background: #fafbfd; }
.btn.danger { background: #fff; color: var(--red); border-color: #f4c7c9; box-shadow: none; } .btn.danger:hover { background: var(--red-50); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--txt-3); cursor: pointer; display: inline-grid; place-items: center;
  transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--red-50); color: var(--red); }
.icon-btn svg.i { width: 16px; height: 16px; }
.rip { position: absolute; border-radius: 50%; pointer-events: none; background: rgba(255,255,255,.45); transform: scale(0); animation: rip .55s ease-out forwards; }
.btn.ghost .rip, .mchip .rip, .qcard .rip { background: rgba(47,107,255,.18); }

/* ───────── 태그 ───────── */
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; white-space: nowrap;
  background: var(--gray-50); color: var(--txt-2); }
.tag + .tag { margin-left: 4px; }
.tag.red { background: var(--red-50); color: var(--red); } .tag.blue { background: var(--pri-50); color: var(--pri); }
.tag.green { background: var(--green-50); color: var(--green); } .tag.orange { background: var(--orange-50); color: var(--orange); }
.tag.purple { background: var(--purple-50); color: var(--purple); } .tag.navy { background: var(--navy-700); color: #fff; }
.red { color: var(--red); } .green { color: var(--green); } .orange { color: var(--orange); } .muted { color: var(--txt-3); }

/* ───────── 표 ───────── */
.tbl-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.grid th { position: sticky; top: 0; background: #f7f9fc; color: var(--txt-3); font-weight: 600; font-size: 12.5px; text-align: left; padding: 11px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.grid th.n, table.grid td.n { text-align: right; }
table.grid td.c, table.grid th.c { text-align: center; }
table.grid tbody tr { transition: background .15s; animation: rowIn .35s var(--ease) both; animation-delay: calc(min(var(--i, 0), 20) * 18ms); }
table.grid tbody tr:hover { background: #f7f9ff; }
table.grid tbody tr.click { cursor: pointer; }
table.grid tbody tr.sub td { background: #fbfcfe; color: var(--txt-3); }
table.grid tfoot td { padding: 13px 14px; font-weight: 800; background: #f7f9fc; border-top: 1px solid var(--line); white-space: nowrap; }
td .strong { font-weight: 700; }
td .s { display: block; font-size: 12px; color: var(--txt-3); }
.empty { padding: 48px 20px; text-align: center; color: var(--txt-3); }
.empty svg.i { width: 36px; height: 36px; opacity: .4; display: block; margin: 0 auto 10px; }

/* 진행 바 */
.bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #5b8cff, var(--pri)); transform-origin: left;
  animation: barIn .9s var(--ease) both; }
.bar i.done { background: linear-gradient(90deg, #34c47a, var(--green)); }
.bar.mini { height: 6px; width: 90px; display: inline-block; vertical-align: middle; }
.prog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.prog { padding: 18px 20px; }
.prog .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.prog .nm { font-weight: 700; font-size: 15px; } .prog .sp { color: var(--txt-3); font-size: 12.5px; }
.prog .pct { font-size: 22px; font-weight: 800; color: var(--pri); }
.prog .pct.done { color: var(--green); }
.prog .bar { margin: 14px 0 12px; }
.prog .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prog .st { background: #f7f9fc; border-radius: 9px; padding: 8px 10px; }
.prog .st .l { font-size: 11.5px; color: var(--txt-3); } .prog .st .v { font-weight: 700; font-size: 13.5px; }

/* 차트 */
.chart { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding: 10px 6px 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart .b { width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #8fb0ff, #cddcff); transform-origin: bottom;
  animation: growY .8s var(--ease) both; position: relative; }
.chart .col.cur .b { background: linear-gradient(180deg, var(--pri), #6c97ff); box-shadow: 0 6px 16px rgba(47,107,255,.3); }
.chart .v { font-size: 11.5px; font-weight: 700; color: var(--txt-2); }
.chart .m { font-size: 12px; color: var(--txt-3); }

/* 리스트 (대시보드 사이드) */
.lst .row { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--line-2); }
.lst .row:last-child { border-bottom: 0; }
.lst .row .m { flex: 1; min-width: 0; } .lst .row .t { font-weight: 600; } .lst .row .s { font-size: 12px; color: var(--txt-3); }
.lst .row .a { font-weight: 800; text-align: right; white-space: nowrap; }

/* 탭 */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; position: relative; }
.tabs button { background: none; border: 0; font: inherit; font-size: 14px; color: var(--txt-3); padding: 10px 16px; cursor: pointer; position: relative; font-weight: 600; }
.tabs button.on { color: var(--navy-700); }
.tabs button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--navy-700); border-radius: 2px; animation: growX .3s var(--ease); }

/* ───────── 모달 ───────── */
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(8,18,42,.45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 24px;
  animation: fade .2s ease both; }
.modal { width: 100%; max-width: 720px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: #fff; border-radius: 18px;
  box-shadow: var(--sh-3); overflow: hidden; animation: pop .32s var(--ease) both; }
.modal.sm { max-width: 520px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; background: linear-gradient(90deg, var(--navy-700), var(--navy-800)); color: #fff; }
.modal-h h3 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.modal-h .back { background: rgba(255,255,255,.12); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.modal-h .x { background: none; border: 0; color: #c9d4ee; cursor: pointer; padding: 6px; border-radius: 8px; } .modal-h .x:hover { background: rgba(255,255,255,.1); color: #fff; }
.modal-b { padding: 22px; overflow-y: auto; }
.modal-f { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; justify-content: center; gap: 10px; background: #fafbfd; }
.modal-f .btn { min-width: 110px; }
.modal-bg.out { animation: fadeOut .18s ease both; } .modal-bg.out .modal { animation: popOut .18s ease both; }
.step-in { animation: slideIn .3s var(--ease) both; }

.qgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.qcard { position: relative; overflow: hidden; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 18px; cursor: pointer;
  font: inherit; color: var(--txt); transition: border-color .2s, box-shadow .25s, transform .25s var(--ease); animation: fadeUp .4s var(--ease) both; }
.qcard:nth-child(2) { animation-delay: .05s; } .qcard:nth-child(3) { animation-delay: .1s; } .qcard:nth-child(4) { animation-delay: .15s; }
.qcard:hover { border-color: var(--pri); box-shadow: 0 10px 28px rgba(47,107,255,.14); transform: translateY(-3px); }
.qcard .tg { margin-bottom: 14px; }
.qcard .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--pri-50); color: var(--navy-700); margin-bottom: 10px; }
.qcard .ic svg.i { width: 24px; height: 24px; }
.qcard .t { font-size: 17px; font-weight: 800; }
.qcard .d { font-size: 12.5px; color: var(--txt-3); margin-top: 2px; }
.qcard .go { position: absolute; right: 16px; bottom: 16px; color: var(--pri); opacity: 0; transform: translateX(-6px); transition: all .25s var(--ease); }
.qcard:hover .go { opacity: 1; transform: none; }
.notice { margin-top: 16px; background: #f6f8fc; border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: var(--txt-3); line-height: 1.7; }

/* 토스트 */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 80; transform: translateX(-50%); min-width: 260px; max-width: calc(100vw - 32px);
  padding: 13px 18px; border-radius: 12px; background: var(--navy-900); color: #fff; font-size: 14px; box-shadow: var(--sh-3);
  display: flex; align-items: center; gap: 10px; animation: toastIn .35s var(--ease) both; }
.toast.err { background: #b42318; }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; flex: none; } .toast.err .dot { background: #fff; }

.loading { padding: 80px 0; display: grid; place-items: center; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--pri-100); border-top-color: var(--pri); animation: spin .8s linear infinite; }
pre.log { margin: 0; white-space: pre-wrap; font-size: 12.5px; color: var(--txt-2); min-height: 20px; font-family: ui-monospace, Consolas, monospace; }

/* ───────── 애니메이션 ───────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes popOut { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes barIn { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rip { to { transform: scale(2.6); opacity: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideRight { from { transform: translateX(-100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; } }

/* ───────── 태블릿 ───────── */
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(2, 1fr); } .grid2 { grid-template-columns: 1fr; } }

/* ───────── 모바일 (1024px 미만) ───────── */
@media (max-width: 1023px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-card .lg-m { display: block; }

  .side { transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--sh-3); width: 280px; }
  .side.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(8,18,42,.4); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .scrim.open { opacity: 1; pointer-events: auto; }
  .body { margin-left: 0; }
  .mtop { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between; height: 56px; padding: 0 8px;
    background: linear-gradient(90deg, var(--navy-800), var(--navy-900)); color: #fff; padding-top: env(safe-area-inset-top); }
  .mtop .lg { width: 58px; color: #fff; } .mtop .lg .lg-box { stroke: rgba(255,255,255,.4); }
  .mtop button { background: none; border: 0; color: #fff; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; border-radius: 10px; }
  .mtop svg.i { width: 22px; height: 22px; }
  .head { position: static; padding: 18px 16px 10px; background: none; backdrop-filter: none; }
  .crumb { font-size: 19px; } .crumb .g, .crumb .sep { display: none; }
  .head-r { display: none; }
  #view { padding: 0 16px 24px; }

  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 14px; border-radius: 14px; } .kpi-v { font-size: 19px; margin-top: 10px; } .kpi-v small { font-size: 12px; }
  .kpi-l { font-size: 12px; } .kpi-l .ico { width: 26px; height: 26px; }
  .card-h { padding: 14px 16px; } .card-b { padding: 16px; }
  .filter { padding: 12px 14px; }
  .filter .range { width: 100%; } .range input { flex: 1; width: auto; }
  .months { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .mchip { flex: none; }
  .filter select, .filter .search { flex: 1; min-width: 0; }
  .filter .sp { display: none; }

  /* 표 → 카드 */
  table.grid thead { display: none; }
  table.grid, table.grid tbody, table.grid tfoot { display: block; }
  table.grid tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
  table.grid td { display: block; padding: 0; border: 0; white-space: normal; }
  table.grid td[data-m="title"] { grid-column: 1; font-weight: 700; font-size: 14.5px; }
  table.grid td[data-m="amt"] { grid-column: 2; grid-row: 1; text-align: right; font-weight: 800; font-size: 15px; }
  table.grid td[data-m="sub"] { grid-column: 1 / -1; font-size: 12.5px; color: var(--txt-3); }
  table.grid td[data-m="act"] { grid-column: 2; grid-row: 2; text-align: right; }
  table.grid td[data-m="hide"] { display: none; }
  table.grid tfoot tr { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 14px 16px; background: #f7f9fc; }
  table.grid tfoot td { padding: 0; border: 0; background: none; }
  table.grid tfoot td:empty { display: none; }
  table.grid tfoot td[data-l]::before { content: attr(data-l) " "; font-weight: 500; color: var(--txt-3); font-size: 12px; }

  .form { grid-template-columns: 1fr 1fr; gap: 12px; }
  .modal-bg { padding: 0; place-items: end stretch; }
  .modal, .modal.sm { max-width: none; max-height: 92vh; border-radius: 20px 20px 0 0; animation: sheetIn .35s var(--ease) both; }
  .modal-bg.out .modal { animation: sheetOut .2s ease both; }
  .modal-f { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .modal-f .btn { flex: 1; }
  .qgrid { gap: 10px; } .qcard { padding: 14px; } .qcard .t { font-size: 15px; } .qcard .ic { width: 40px; height: 40px; }
  .chart { height: 160px; gap: 8px; } .chart .v { font-size: 10px; }
  .prog-grid { grid-template-columns: 1fr; }

  .bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bnav a, .bnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--txt-3);
    background: none; border: 0; font-family: inherit; cursor: pointer; padding: 4px 0; transition: color .2s; }
  .bnav .on { color: var(--navy-700); font-weight: 700; }
  .bnav svg.i { width: 22px; height: 22px; transition: transform .25s var(--ease); }
  .bnav .on svg.i { transform: translateY(-1px) scale(1.08); }
  .bnav .fab { flex: none; width: 54px; height: 54px; margin: -22px 8px 0; border-radius: 50%; color: #fff; justify-content: center;
    background: linear-gradient(180deg, #3d78ff, var(--pri-600)); box-shadow: 0 8px 20px rgba(47,107,255,.45); position: relative; overflow: hidden; }
  .bnav .fab svg.i { width: 26px; height: 26px; stroke-width: 2.2; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetOut { to { transform: translateY(100%); } }
@media (max-width: 380px) { .form { grid-template-columns: 1fr; } .kpi-v { font-size: 17px; } }

/* PC 에서는 모바일 카드 전용 셀 숨김 */
@media (min-width: 1024px) { .mo, .mo-i { display: none !important; } }
