/* 플로우업 브랜드: Ink #0B0F1A · Flow Blue #2E5BFF · Sky #19C2FF(기호 전용) */
:root {
  --ink: #0B0F1A;
  --ink-2: #151B2C;
  --ink-3: #232B42;
  --blue: #2E5BFF;
  --blue-600: #2149E0;
  --blue-50: #EEF2FF;
  --blue-100: #DCE4FF;
  --sky: #19C2FF;
  --bg: #F4F6FB;
  --surface: #FFFFFF;
  --line: #E4E8F1;
  --line-2: #EEF1F7;
  --text: #0B0F1A;
  --text-2: #424B61;
  --muted: #6B7489;
  --good: #138A4C;   --good-bg: #E6F6EC;
  --warn: #B26A00;   --warn-bg: #FFF4E0;
  --bad: #D2353B;    --bad-bg: #FDECEC;
  --c1: #2E5BFF; --c2: #E8851F; --c3: #12A594; --c4: #8B5CF6;
  --d-hr: #8B5CF6; --d-fin: #2E5BFF; --d-ga: #12A594; --d-biz: #E8851F;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11,15,26,.04), 0 4px 16px rgba(11,15,26,.04);
  font-family: 'Pretendard Variable', Pretendard, 'Malgun Gothic', 'Apple SD Gothic Neo', system-ui, sans-serif;
  color: var(--text);
  font-feature-settings: 'tnum';
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- 사이드바 ----------
   화면에 고정되어 본문이 아무리 길어도 잘리지 않는다. 메뉴가 창 높이보다 길면 메뉴 부분만 부드럽게 스크롤된다. */
:root { --side-w: 244px; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 20;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0B0F1A 0%, #0D1220 60%, #0F1526 100%);
  border-right: 1px solid #161C2C; color: #AEB7CC;
}
.brand-area { padding: 22px 20px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { display: block; }
.brand img { height: 26px; display: block; }
.brand-sub { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; color: #8FA4FF; background: rgba(46,91,255,.14); border: 1px solid rgba(46,91,255,.28); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
nav {
  flex: 1; min-height: 0; overflow-y: auto; padding: 4px 12px 16px;
  display: flex; flex-direction: column; gap: 1px;
  scrollbar-width: thin; scrollbar-color: #2A3350 transparent;
}
.nav-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
nav::-webkit-scrollbar { width: 6px; }
nav::-webkit-scrollbar-thumb { background: #2A3350; border-radius: 6px; }
.nav-group { font-size: 10.5px; color: #525C76; padding: 14px 10px 5px; font-weight: 700; letter-spacing: .12em; }
.nav-group:first-child { padding-top: 4px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 9px;
  color: #AEB7CC; font-weight: 500; font-size: 13.5px; transition: background .15s, color .15s;
}
.nav-item svg { width: 17px; height: 17px; flex: none; color: #6F7891; transition: color .15s; }
.nav-item:hover { background: rgba(255,255,255,.045); color: #fff; }
.nav-item:hover svg { color: #C9D1E4; }
.nav-item.active { background: linear-gradient(90deg, rgba(46,91,255,.26), rgba(46,91,255,.07)); color: #fff; font-weight: 600; }
.nav-item.active svg { color: #7C9BFF; }
.nav-item.active::before { content: ''; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); }
.nav-item .badge-dot { margin-left: auto; background: rgba(210,53,59,.18); color: #FF8A8E; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.sidebar-foot { padding: 12px; border-top: 1px solid #161C2C; }
.foot-card { background: rgba(255,255,255,.035); border: 1px solid #1B2236; border-radius: 12px; padding: 4px 12px; }
.foot-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.foot-row + .foot-row { border-top: 1px solid #1B2236; }
.foot-row .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(46,91,255,.14); color: #7C9BFF; flex: none; }
.foot-row .ic svg { width: 15px; height: 15px; }
.foot-row .k { font-size: 11px; color: #6F7891; line-height: 1.3; }
.foot-row .v { font-size: 12.5px; color: #E6EAF5; font-weight: 600; line-height: 1.35; }
.foot-row .dday { margin-left: auto; font-size: 11px; font-weight: 700; color: #8FA4FF; }
/* 낮은 창에서는 간격을 줄여 메뉴가 한눈에 들어오게 */
@media (max-height: 760px) {
  .brand-area { padding: 16px 20px 10px; }
  .nav-group { padding: 9px 10px 3px; }
  .nav-item { padding: 5px 10px; }
  .foot-row { padding: 5px 0; }
  .foot-row .ic { width: 24px; height: 24px; }
}

/* ---------- 본문 ---------- */
main { margin-left: var(--side-w); min-width: 0; padding: 28px 36px 60px; }
.loading { color: var(--muted); padding: 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 860px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } .sidebar { position: static; width: auto; } nav { -webkit-mask-image: none; mask-image: none; flex-direction: row; flex-wrap: wrap; gap: 4px; } .nav-group { display: none; } .nav-item.active::before { display: none; } main { margin-left: 0; padding: 20px 16px 40px; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-head .sub { color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; font-size: 13px; }
.divider { height: 1px; background: var(--line-2); margin: 14px 0; }

/* 히어로 */
.hero {
  background: var(--ink); color: #fff; border-radius: 18px; padding: 24px 28px; display: flex; gap: 24px;
  align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; position: relative; overflow: hidden;
}
.hero::after { content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(46,91,255,.55), rgba(46,91,255,0) 70%); }
.hero h2 { font-size: 22px; font-weight: 700; }
.hero p { margin: 6px 0 0; color: #AEB8D0; }
.hero-stats { display: flex; gap: 12px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero-stat { background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: 12px; padding: 12px 16px; min-width: 150px; }
.hero-stat .k { font-size: 12px; color: #8F9AB5; }
.hero-stat .v { font-size: 20px; font-weight: 700; margin-top: 2px; }
.hero-stat .v small { font-size: 12px; color: #8F9AB5; font-weight: 500; margin-left: 4px; }
.hero-stat a { color: #8FB0FF; font-size: 12px; }

/* KPI */
.kpi { position: relative; }
.kpi .label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.kpi .value small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.kpi .delta { font-size: 12px; margin-top: 2px; }
.kpi .spark { margin-top: 10px; height: 36px; }
.up { color: var(--good); } .down { color: var(--bad); } .flat { color: var(--muted); }

/* 버튼·입력 */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2);
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: #C9D2E6; background: #FAFBFE; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-600); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--blue-50); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.input, select.input, textarea.input {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 11px; width: 100%; outline: none; transition: border .15s, box-shadow .15s;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,91,255,.15); }
textarea.input { resize: vertical; min-height: 70px; line-height: 1.6; }
.input.num-in { text-align: right; font-variant-numeric: tabular-nums; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.input:disabled, select.input:disabled, textarea.input:disabled { background: #F2F4F8; color: var(--muted); cursor: not-allowed; }
.input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(210,53,59,.12); }
.field-error { color: var(--bad); font-size: 12px; font-weight: 600; }
.linklike { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.linklike:hover .t { color: var(--blue); }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 9px 12px; font-size: 13px; line-height: 1.5; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 140px; }

.seg { display: inline-flex; background: #E9EDF6; border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(11,15,26,.1); }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #EEF1F7; color: var(--text-2); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.chip.blue { background: var(--blue-50); color: var(--blue-600); }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.ink { background: var(--ink); color: #fff; }

/* 표 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFBFE; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl tr.group td { background: #F7F9FD; font-weight: 700; font-size: 13px; }
.tbl .input { padding: 6px 9px; border-radius: 8px; }
.tbl tfoot td { font-weight: 700; border-top: 1px solid var(--line); }

/* 진행 막대 */
.bar { height: 8px; background: #EBEFF7; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.bar.over > i { background: var(--bad); }
.stack-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; background: #EBEFF7; }
.stack-bar i { display: block; height: 100%; }

/* 리스트 */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.list-item:last-child { border-bottom: 0; }
.list-item .t { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.date-badge { flex: none; width: 46px; text-align: center; border-radius: 10px; background: var(--blue-50); color: var(--blue-600); padding: 5px 0; line-height: 1.15; }
.date-badge b { display: block; font-size: 16px; }
.date-badge span { font-size: 11px; }
.date-badge.over { background: var(--bad-bg); color: var(--bad); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.avatar.b { background: var(--blue); }

/* 칸반 */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 4px; }
.col { background: #EBEEF6; border-radius: 14px; padding: 10px; min-height: 300px; }
.col.drag-over { outline: 2px dashed var(--blue); outline-offset: -4px; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; font-weight: 700; }
.col-head .count { color: var(--muted); font-weight: 600; font-size: 12px; }
.tcard { background: #fff; border-radius: 11px; padding: 11px 12px; margin-bottom: 8px; border: 1px solid var(--line); cursor: grab; box-shadow: 0 1px 2px rgba(11,15,26,.04); }
.tcard:hover { border-color: #C9D2E6; }
.tcard .tt { font-weight: 600; font-size: 13px; line-height: 1.45; }
.tcard .meta { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.tcard.dragging { opacity: .5; }
.tcard .domain-line { height: 3px; border-radius: 3px; width: 28px; margin-bottom: 8px; }

/* 모달 */
.modal-bg { position: fixed; inset: 0; background: rgba(11,15,26,.45); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 22px; box-shadow: 0 20px 60px rgba(11,15,26,.3); }
.modal h3 { font-size: 17px; margin-bottom: 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* 토스트 */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 500; box-shadow: 0 8px 24px rgba(11,15,26,.25); animation: pop .2s ease-out; }
.toast.err { background: var(--bad); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 차트 */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: #EDF0F6; stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-size: 11px; }
.chart .zero-line { stroke: #C9D0DE; stroke-width: 1; }
.chart .guide { stroke: #9AA4BA; stroke-width: 1; stroke-dasharray: 3 3; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.line { height: 3px; border-radius: 2px; width: 14px; }
.chart-tip { position: fixed; z-index: 90; background: var(--ink); color: #fff; border-radius: 10px; padding: 8px 11px; font-size: 12px; pointer-events: none; box-shadow: 0 8px 24px rgba(11,15,26,.3); min-width: 120px; }
.chart-tip .h { color: #9FAAC4; margin-bottom: 4px; font-weight: 600; }
.chart-tip .r { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.chart-tip .r i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }

/* 지표 입력 */
.metric-row { display: grid; grid-template-columns: 1.4fr 1fr 0.9fr 0.8fr; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.metric-row:last-child { border-bottom: 0; }
.metric-row .name { font-weight: 600; }
.metric-row .name small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.metric-row .prev { color: var(--muted); font-size: 12px; text-align: right; }
.metric-row .chg { font-size: 12px; text-align: right; }
.cat-head { display: flex; align-items: center; gap: 10px; }
.cat-head .sw { width: 10px; height: 22px; border-radius: 4px; }
.progress-ring { font-weight: 700; }

/* 드롭존 */
.dropzone { display: block; border: 2px dashed #C9D2E6; border-radius: 14px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: all .15s; background: #FAFBFE; }
.dropzone:hover, .dropzone.over { border-color: var(--blue); background: var(--blue-50); color: var(--blue-600); }

/* 달력 */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal .dow { background: #FAFBFE; text-align: center; font-size: 12px; color: var(--muted); padding: 7px 0; font-weight: 600; }
.cal .day { background: #fff; min-height: 96px; padding: 6px; font-size: 12px; }
.cal .day.out { background: #FAFBFD; color: #B3BACB; }
.cal .day.today .dn { background: var(--blue); color: #fff; border-radius: 999px; padding: 0 7px; }
.cal .dn { font-weight: 700; display: inline-block; margin-bottom: 4px; }
.cal .ev, .cal-legend .ev { display: block; border-radius: 5px; padding: 1px 6px; margin-bottom: 3px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--blue-50); color: var(--blue-600); }
.cal .ev.task, .cal-legend .ev.task { background: #F1ECFF; color: #6A42D8; }
.cal .ev.legal, .cal-legend .ev.legal { background: #E3F6F3; color: #0C7A6D; }
.cal .ev.over { background: var(--bad-bg); color: var(--bad); }
.cal .ev.done { text-decoration: line-through; opacity: .6; }

/* ---------- 보고서(종이) ---------- */
.paper { background: #fff; max-width: 900px; margin: 0 auto; border-radius: 6px; box-shadow: 0 2px 30px rgba(11,15,26,.08); padding: 48px 56px; border: 1px solid var(--line); }
.paper .rep-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid var(--ink); padding-bottom: 16px; margin-bottom: 22px; }
.paper .rep-head img { height: 30px; }
.paper .rep-title { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-top: 14px; }
.paper .rep-meta { text-align: right; font-size: 12px; color: var(--text-2); line-height: 1.8; }
.paper .rep-meta b { color: var(--text); }
.paper h2.sec { font-size: 16px; font-weight: 800; margin: 28px 0 12px; display: flex; align-items: center; gap: 8px; }
.paper h2.sec::before { content: ''; width: 4px; height: 16px; background: var(--blue); border-radius: 2px; }
.paper .summary { background: var(--blue-50); border-radius: 12px; padding: 16px 20px; }
.paper .summary ul { margin: 0; padding-left: 18px; }
.paper .summary li { margin: 3px 0; }
.paper .editable { border: 1px dashed transparent; border-radius: 8px; padding: 8px 10px; min-height: 40px; white-space: pre-wrap; outline: none; transition: border .15s, background .15s; }
.paper .editable:hover { border-color: #C9D2E6; }
.paper .editable:focus { border-color: var(--blue); background: #FBFCFF; }
.paper .editable:empty::before { content: attr(data-ph); color: #A2AAC0; }
.paper .kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.paper .kpis .k { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.paper .kpis .k .l { font-size: 12px; color: var(--muted); }
.paper .kpis .k .v { font-size: 19px; font-weight: 800; margin-top: 2px; }
.paper .kpis .k .d { font-size: 11px; }
.paper .tbl th { background: #F3F5FA; color: var(--text-2); }
.paper .tbl td, .paper .tbl th { padding: 7px 9px; font-size: 13px; }
.paper .check { font-size: 13px; letter-spacing: .02em; white-space: nowrap; }
.paper .foot { margin-top: 36px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; }
.report-tools { max-width: 900px; margin: 0 auto 16px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; display: block; }
  .sidebar, .report-tools, .page-head, #toast, .no-print { display: none !important; }
  main { padding: 0; margin-left: 0; }
  .paper { box-shadow: none; border: 0; padding: 0; max-width: none; }
  .paper .editable { border: 0; padding: 0; }
  .paper .editable:empty { display: none; }
  .paper h2.sec { break-after: avoid; }
  .paper table, .paper .kpis, .chart { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.metric-grid { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
@media (max-width: 860px) { .metric-grid { grid-template-columns: 1fr; } }
.tbl td.nm { white-space: nowrap; }
.cal-legend { display: flex; gap: 10px; align-items: center; }
.cal-legend .ev { display: inline-block; }

/* ---------- 로그인·사용자·알림 ---------- */
body.logged-out .sidebar { display: none; }
body.logged-out main { margin-left: 0; }
.login-wrap { position: fixed; inset: 0; z-index: 40; overflow-y: auto; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 70% 20%, rgba(46,91,255,.12), transparent 55%), var(--bg); }
.login-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px rgba(11,15,26,.10); padding: 36px 32px; display: flex; flex-direction: column; gap: 14px; text-align: center; align-items: stretch; }
.login-card img { align-self: center; }
.login-card h1 { font-size: 20px; color: var(--muted); font-weight: 600; margin-top: -4px; }
.login-card p { margin: 6px 0; color: var(--text-2); line-height: 1.7; }
.login-card small { color: var(--muted); font-size: 11.5px; }
.login-card .btn { padding: 11px 14px; font-size: 14px; }

.me-row { display: flex; align-items: center; gap: 4px; padding: 0 0 8px; }
.me-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: transparent; border: 0; border-radius: 10px; color: inherit; padding: 6px; cursor: pointer; text-align: left; }
.me-btn:hover, .me-btn[aria-expanded="true"] { background: rgba(255,255,255,.06); }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xl { width: 72px; height: 72px; font-size: 22px; }
.account-pop { position: fixed; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(11,15,26,.25); z-index: 60; padding: 6px; color: var(--text); }
.account-pop .ap-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; }
.account-pop .ap-head > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.account-pop .ap-head small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-pop hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 0; }
.account-pop [role="menuitem"] { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.account-pop [role="menuitem"]:hover, .account-pop [role="menuitem"]:focus-visible { background: #F2F5FB; outline: none; }
.profile-photo { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.me-row .avatar { width: 32px; height: 32px; background: #1B2236; }
.me-row .avatar.b { background: var(--blue); }
.me-txt { flex: 1; min-width: 0; font-size: 12.5px; color: #C9D1E4; line-height: 1.4; }
.me-txt b { color: #fff; }
.me-txt small { font-size: 11px; color: #8F9AB5; }
.bell { position: relative; width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; color: #AEB7CC; background: transparent; border: 0; cursor: pointer; }
.bell:hover { background: rgba(255,255,255,.06); color: #fff; }
.bell svg { width: 18px; height: 18px; }
.bell i { position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 10px; font-style: normal; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.notes-pop { position: fixed; left: calc(var(--side-w) + 10px); bottom: 16px; width: 360px; max-height: 70vh; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px rgba(11,15,26,.25); z-index: 60; display: flex; flex-direction: column; overflow: hidden; }
.np-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.np-list { overflow-y: auto; }
.np-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); color: var(--text); }
.np-item:hover { background: #F7F9FD; }
.np-item.unread { background: var(--blue-50); }
.np-item span { font-size: 12.5px; color: var(--text-2); }
.np-item small { font-size: 11px; color: var(--muted); }

/* ---------- 전자 결재 ---------- */
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #F7F9FD; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.form-pick { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: all .15s; }
.form-pick:hover { border-color: var(--blue); background: var(--blue-50); }
.form-pick b { font-size: 13.5px; }
.form-pick span { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.modal:has(.form-grid) { width: min(640px, 100%); }
.static-text { white-space: pre-wrap; background: #F7F9FD; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.75; color: var(--text-2); }
.items-tbl td { padding: 4px 6px; }
.items-tbl .input { padding: 6px 8px; font-size: 13px; }
.line-flow { display: flex; flex-direction: column; align-items: stretch; }
.lf-step { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.lf-step small { color: var(--muted); }
.lf-arrow { text-align: center; color: var(--muted); font-size: 12px; line-height: 18px; }

.approval-paper .ap-top { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.approval-paper .ap-code { letter-spacing: .02em; }
.approval-paper .ap-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin: 18px 0 6px; }
.approval-paper .ap-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.approval-paper .ap-meta { font-size: 12px; color: var(--text-2); margin-top: 6px; }
.approval-paper .ap-title { font-size: 16px; font-weight: 700; margin: 14px 0 12px; padding: 10px 14px; background: var(--blue-50); border-radius: 10px; }
.sign-box { border-collapse: collapse; }
.sign-box td { border: 1px solid #C9D0DE; width: 84px; text-align: center; padding: 0; vertical-align: top; }
.sign-box .sb-h { background: #F3F5FA; font-size: 11.5px; padding: 4px 0; border-bottom: 1px solid #C9D0DE; color: var(--text-2); }
.sign-box .sb-s { height: 56px; display: grid; place-items: center; }
.sign-box .sb-d { font-size: 10.5px; color: var(--muted); border-top: 1px dashed #DDE2EC; padding: 2px 0; min-height: 18px; }
.stamp { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; transform: rotate(-8deg); }
.stamp.ok { border: 2px solid #D2353B; color: #D2353B; }
.stamp.no { border: 2px solid #6B7489; color: #6B7489; }
/* 도장·서명 이미지: 결재 칸, 결재 창의 고르기, 프로필 설정의 목록. */
.seal-img { max-width: 72px; max-height: 50px; object-fit: contain; }
.seal-thumb { width: 64px; height: 44px; display: grid; place-items: center; flex: none; }
.seal-thumb .seal-img { max-width: 64px; max-height: 44px; }
.seal-thumb .stamp { width: 38px; height: 38px; font-size: 10px; }
.seal-picker { border: 1px solid var(--line, #DDE2EC); border-radius: 8px; padding: 8px 12px; margin: 12px 0; display: grid; gap: 6px; }
.seal-picker legend { font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.seal-option { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.seals-editor { margin-top: 18px; border-top: 1px solid var(--line, #DDE2EC); padding-top: 14px; }
.seals-editor h3 { margin: 0 0 4px; font-size: 14px; }
.seals-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.seals-list li { display: flex; align-items: center; gap: 8px; }
.seals-list .input { flex: 1; min-width: 0; }
.seals-add { gap: 8px; flex-wrap: wrap; }
.seals-add .input { flex: 1; min-width: 120px; }
.seals-add select.input { flex: none; min-width: 0; width: auto; }
.ap-fields th { width: 190px; background: #F7F9FD; color: var(--text-2); font-weight: 600; vertical-align: top; }
.ap-fields th, .ap-fields td { border: 1px solid var(--line); padding: 9px 12px; font-size: 13px; }
.ap-fields .sec-h { background: #EEF1F7; }
.tbl.inner th, .tbl.inner td { border: 0; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.ap-snapshot { border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-top: 12px; }
.ap-snapshot .rep-head { display: none; }
.ap-links { margin-top: 14px; font-size: 13px; }
.ap-links a { word-break: break-all; }
@media print { .ap-snapshot { border: 0; padding: 0; } }

/* 상신 전 확인 요약 */
.confirm-summary { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 12px; }
.confirm-summary dt { color: var(--muted); }
.confirm-summary dd { margin: 0; font-weight: 600; }

/* 스크롤 단서: 더 스크롤할 곳이 있는 쪽에 그림자를, 사이드바 아래에는 "메뉴 더 있음" 표시를 띄운다(ui/scroll-hint.ts) */
.scroll-hint { position: relative; min-width: 0; }
.scroll-hint::before, .scroll-hint::after { content: ''; position: absolute; pointer-events: none; opacity: 0; transition: opacity .2s; z-index: 2; }
.scroll-hint.x::before, .scroll-hint.x::after { top: 0; bottom: 4px; width: 28px; }
.scroll-hint.x::before { left: 0; background: linear-gradient(90deg, rgba(11,15,26,.16), transparent); border-radius: 14px 0 0 14px; }
.scroll-hint.x::after { right: 0; background: linear-gradient(270deg, rgba(11,15,26,.16), transparent); border-radius: 0 14px 14px 0; }
.scroll-hint.x[data-more-before]::before, .scroll-hint.x[data-more-after]::after { opacity: 1; }
.scroll-hint.y::before { left: 0; right: 0; top: 0; height: 18px; background: linear-gradient(180deg, #0D1220, transparent); }
.scroll-hint.y::after {
  content: '▾ 메뉴 더 있음'; left: 0; right: 0; bottom: 0; padding: 22px 0 6px; text-align: center;
  font-size: 11px; font-weight: 600; color: #8FA4FF; background: linear-gradient(180deg, transparent, #0E1424 60%);
}
.scroll-hint.y[data-more-before]::before, .scroll-hint.y[data-more-after]::after { opacity: 1; }
@media (max-width: 860px) { .scroll-hint.y::before, .scroll-hint.y::after { display: none; } }
.notify-push { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
