/* ISE-AX 통합운영시스템 프로토타입 — 디자인 시스템 (서울에너지공사 CI) */
:root {
  /* 서울에너지공사 CI: 주조 그린 #217907/#74C658 (i-se.co.kr CSS 실측), 로고 액센트 #61CBEA/#B2D234/#F36F21.
     변수명 --kdhc는 내부 식별자(사용처 22곳)라 유지하고 값만 교체 */
  --kdhc: #217907;          /* SE 다크그린 (주조) */
  --kdhc-dark: #17560a;
  --navy: #0f1b2d;
  --navy-2: #16263c;
  --navy-3: #1e3350;
  --blue: #2563eb;
  --teal: #0e9f8e;
  --green: #16a34a;
  --amber: #f59e0b;
  --red: #dc2626;
  --purple: #7c3aed;
  --slate: #64748b;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #eef2f7;
  --bg: #f4f6fa;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.05);
  --shadow-lg: 0 8px 30px rgba(15,23,42,.12);
  --r: 12px;
  --sidebar-w: 256px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Pretendard',
    'Malgun Gothic', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c6d0dd; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #aab7c7; }

/* ── 레이아웃 ───────────────────────────────────── */
#app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy) 0%, #0b1422 100%);
  color: #cdd7e4; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.brand {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 34px;
  background: linear-gradient(135deg, var(--kdhc), #74c658);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 12px rgba(33,121,7,.4);
}
.brand .t1 { font-size: 13px; font-weight: 800; color: #fff; letter-spacing: .2px; }
.brand .t2 { font-size: 10.5px; color: #8aa0bb; margin-top: 1px; }
.nav { flex: 1; overflow-y: auto; padding: 8px 8px 24px; }
.nav::-webkit-scrollbar-thumb { background: #2a3a52; }
.nav-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: #5d7390; padding: 14px 12px 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: 8px;
  cursor: pointer; color: #b8c5d6; font-size: 12.5px; font-weight: 500; margin: 1px 0;
  transition: background .12s, color .12s; white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(33,121,7,.22), rgba(33,121,7,.05)); color: #fff; box-shadow: inset 2px 0 0 var(--kdhc); }
.nav-item .ico { width: 17px; text-align: center; flex: 0 0 17px; opacity: .9; font-size: 13px; }
.nav-item .badge-mini { margin-left: auto; font-size: 9.5px; background: rgba(255,255,255,.12); padding: 1px 6px; border-radius: 9px; color: #d6e0ec; }

/* 통합운영 메뉴 트리 — 대그룹[+] → 중그룹[+] → 요구사항 */
.nav-grp, .nav-sub { display: flex; align-items: center; gap: 7px; cursor: pointer; color: #b8c5d6; font-weight: 500; white-space: nowrap; border-radius: 8px; transition: background .12s, color .12s; margin: 1px 0; }
.nav-grp { padding: 7px 10px; font-size: 12.5px; }
.nav-sub { padding: 5px 10px 5px 20px; font-size: 11.5px; color: #9fb0c4; }
.nav-grp:hover, .nav-sub:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-grp .gico { opacity: .65; font-size: 12px; flex: 0 0 auto; }
.nav-grp .gname, .nav-sub .sname { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.twist { display: inline-block; width: 10px; font-size: 9px; transition: transform .12s; opacity: .65; flex: 0 0 auto; }
.nav-grp.open > .twist, .nav-sub.open > .twist { transform: rotate(90deg); }
.nav-cnt { font-size: 9.5px; background: rgba(255,255,255,.1); padding: 1px 6px; border-radius: 9px; color: #cdd8e6; flex: 0 0 auto; }
.nav-leaf { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 32px; border-radius: 7px; cursor: pointer; color: #90a2b8; font-size: 11px; white-space: nowrap; margin: 1px 0; }
.nav-leaf:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-leaf.active, .nav-item.active { background: linear-gradient(90deg, rgba(33,121,7,.22), rgba(33,121,7,.05)); color: #fff; box-shadow: inset 2px 0 0 var(--kdhc); }
.nav-leaf .lid { font-family: ui-monospace, monospace; font-size: 9.5px; opacity: .6; flex: 0 0 auto; }
.nav-leaf .lnm { overflow: hidden; text-overflow: ellipsis; }
.nav-leaf.nav-hub { color: #cbd5e1; font-weight: 600; padding-left: 20px; }
.nav-leaf.nav-hub .lid { opacity: .9; }
/* 라벨 클릭=화면, twist=펼치기 */
.nav .twist[data-toggle] { cursor: pointer; }
.nav-grp .gname[data-go], .nav-sub .sname[data-go] { cursor: pointer; }
.nav-grp .gname[data-go]:hover, .nav-sub .sname[data-go]:hover { text-decoration: underline; }
.gname.active, .sname.active { color: #fff; font-weight: 700; }
.nav-grp:has(.gname.active), .nav-sub:has(.sname.active) { background: linear-gradient(90deg, rgba(33,121,7,.22), rgba(33,121,7,.05)); box-shadow: inset 2px 0 0 var(--kdhc); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 20px; position: sticky; top: 0; z-index: 30;
}
.crumb { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; white-space: nowrap; }
.crumb b { color: var(--ink); font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; }
.crumb-seg { color: inherit; text-decoration: none; white-space: nowrap; }
a.crumb-seg { color: var(--muted); font-weight: 500; }
a.crumb-seg:hover { text-decoration: underline; color: var(--ink); }
.crumb-cur { overflow: hidden; text-overflow: ellipsis; }
.crumb-sep { opacity: .45; font-weight: 400; flex: 0 0 auto; }
.topbar .spacer { flex: 1; }
.zone-pills { display: flex; gap: 6px; }
.zone-pill { font-size: 11px; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); display: flex; align-items: center; gap: 5px; }
.zone-pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.env-badge { font-size: 10.5px; font-weight: 800; letter-spacing: .5px; color: #fff; background: var(--green); padding: 3px 8px; border-radius: 5px; }
.clock { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.user-chip .av { width: 28px; height: 28px; border-radius: 50%; background: var(--navy-3); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 11px; }

.content { padding: 18px 22px 60px; max-width: 1640px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 19px; margin: 0; font-weight: 800; letter-spacing: -.2px; }
.page-head .sub { color: var(--muted); font-size: 12.5px; }
.page-head .rfp-tags { margin-left: auto; display: flex; gap: 5px; flex-wrap: wrap; }
/* FB-0038: rfp-tags·?버튼 이중 auto 마진으로 태그가 중간에 뜨던 문제 — ?는 태그 옆에 밀착, 태그 없을 때만 우측 정렬 */
.page-head .head-help { margin-left: 6px; }
.page-head:not(:has(.rfp-tags)) .head-help { margin-left: auto; }

/* ── 그리드 유틸 ─────────────────────────────────── */
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g6 { grid-template-columns: repeat(6, 1fr); }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
@media (max-width: 1200px){ .g4{grid-template-columns:repeat(2,1fr);} .g6{grid-template-columns:repeat(3,1fr);} .g3{grid-template-columns:1fr 1fr;} }

/* ── 카드 ───────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 8px; padding: 12px 15px; border-bottom: 1px solid var(--line-2); }
/* FB-0080: 제목·버튼은 항상 1줄 유지(축소 금지), 세부설명(hint)만 남는 공간에서 줄바꿈되도록 흡수 */
.card-h h3 { margin: 0; font-size: 13.5px; font-weight: 700; white-space: nowrap; flex: 0 0 auto; }
.card-h .hint { font-size: 11px; color: var(--muted); flex: 1 1 auto; min-width: 0; }
.card-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; flex: 0 0 auto; flex-wrap: nowrap; }
.card-b { padding: 14px 15px; }
.card-b.tight { padding: 8px 10px; }
/* FB-0174: 내부 콘텐츠를 직접 담는 raw .card(card-b 미사용)용 패딩 — U.card와 동일 여백 */
.card-pad { padding: 14px 15px; }

/* KPI */
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi .label { font-size: 11.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 25px; font-weight: 800; margin-top: 6px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kpi .val .u { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.kpi .delta { font-size: 11.5px; font-weight: 700; margin-top: 3px; }
.kpi .delta.up { color: var(--green); }
.kpi .delta.down { color: var(--red); }
.kpi .delta.flat { color: var(--muted); }
.kpi .spark { position: absolute; right: 10px; bottom: 8px; opacity: .85; }
.kpi .accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }

/* 배지/상태 */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; line-height: 1.6; white-space: nowrap; }
.badge.gray { background: #eef1f5; color: #475569; }
.badge.blue { background: #e0ecff; color: #1d4ed8; }
.badge.green { background: #dcfce7; color: #15803d; }
.badge.amber { background: #fef3c7; color: #b45309; }
.badge.red { background: #fee2e2; color: #b91c1c; }
.badge.teal { background: #ccfbf1; color: #0f766e; }
.badge.purple { background: #ede9fe; color: #6d28d9; }
.badge.kdhc { background: #ffe8dd; color: var(--kdhc-dark); }
.dot-st { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.tag { display: inline-block; font-size: 10px; font-weight: 700; font-family: ui-monospace, Menlo, monospace; padding: 2px 6px; border-radius: 5px; background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.tag.rfp { background: #fff1ea; color: var(--kdhc-dark); border-color: #ffd9c6; cursor: pointer; }
.tag.rfp:hover { background: #ffe2d2; }

/* 테이블 */
.tbl-wrap { overflow: auto; border-radius: 8px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
table.tbl th { text-align: left; font-weight: 700; color: #56657a; background: #f7f9fc; padding: 8px 11px; border-bottom: 1px solid var(--line); position: sticky; top: 0; white-space: nowrap; font-size: 11.5px; }
table.tbl td { padding: 7px 11px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.tbl tr:hover td { background: #fafcff; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl.zebra tbody tr:nth-child(even) td { background: #fbfcfe; }
/* FB-0029: 선택 행 하일라이트 — zebra·hover의 td 배경보다 우선(동일 특이도·후순위), 밝은 글자색으로 대비 확보 */
table.tbl tbody tr[data-sel] td,
table.tbl.zebra tbody tr[data-sel] td,
table.tbl tbody tr[data-sel]:hover td { background: #1e3a5f; color: #f1f5f9; }
table.tbl tbody tr[data-sel] td code, table.tbl tbody tr[data-sel] td b { color: #dbeafe; }

/* 탭 */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 8px 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--kdhc); border-bottom-color: var(--kdhc); }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.subtab { padding: 5px 11px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); cursor: pointer; background: #fff; }
.subtab.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ── grouphub 고급 탭 (pill segment 스타일) ───────────────────── */
.ghtabs {
  display: flex; gap: 4px; padding: 4px;
  background: #eef2f7; border-radius: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.ghtab {
  padding: 8px 16px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); cursor: pointer;
  border-radius: 9px; border: none; background: transparent;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s;
  position: relative; line-height: 1.4;
}
.ghtab:hover { color: var(--ink); background: rgba(255,255,255,0.6); }
.ghtab.active {
  color: var(--kdhc); background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10), 0 0 0 1px rgba(14,116,144,0.12);
}
.ghtab.active::before {
  content: ''; position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 55%; height: 2.5px;
  background: linear-gradient(90deg, var(--kdhc) 0%, #22d3ee 100%);
  border-radius: 0 0 4px 4px;
}
/* grouphub 그룹 이동 바 */
.ghgroupbar { display: flex; gap: 5px; flex-wrap: wrap; }
.ghgroupbar-item {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; font-size: 12px; font-weight: 600;
  color: var(--muted); text-decoration: none;
  border-radius: 8px; background: #fff;
  border: 1px solid var(--line);
  transition: color 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.ghgroupbar-item:hover {
  color: var(--ink); border-color: var(--kdhc);
  background: rgba(14,116,144,0.04);
}
.ghgroupbar-item.active {
  color: #fff; background: var(--kdhc); border-color: var(--kdhc);
  box-shadow: 0 2px 8px rgba(14,116,144,0.28);
}

/* 버튼 */
.btn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; }
.btn:hover { background: #f8fafc; }
.btn.primary { background: var(--kdhc); color: #fff; border-color: var(--kdhc); }
.btn.primary:hover { background: var(--kdhc-dark); }
.btn.ghost { border-color: transparent; background: #f1f5f9; }
.btn.sm { padding: 4px 9px; font-size: 11px; }

/* 진행바/게이지 */
.pbar { height: 7px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.pbar > span { display: block; height: 100%; border-radius: 6px; }

/* 스텝퍼 (상태머신/워크플로) */
.stepper { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; }
.step .node { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; border: 2px solid var(--line); color: var(--muted); background: #fff; }
.step.done .node { background: var(--green); border-color: var(--green); color: #fff; }
.step.active .node { background: var(--kdhc); border-color: var(--kdhc); color: #fff; box-shadow: 0 0 0 4px rgba(33,121,7,.15); }
.step .lbl { font-size: 11.5px; font-weight: 600; }
.step.todo .lbl { color: var(--muted); }
.step .bar { width: 34px; height: 2px; background: var(--line); margin: 0 4px; }
.step.done .bar { background: var(--green); }

/* 다이어그램 (아키텍처/망분리/DB) */
.diagram { display: flex; flex-direction: column; gap: 14px; }
.zone { border: 1.5px dashed #cbd5e1; border-radius: 12px; padding: 12px 14px; position: relative; }
.zone .zlabel { position: absolute; top: -10px; left: 14px; background: #fff; padding: 0 8px; font-size: 11px; font-weight: 700; }
.node-box { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; box-shadow: var(--shadow); font-size: 11.5px; }
.node-box .nt { font-weight: 700; font-size: 12px; }
.node-box .nd { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.node-box .pill { font-size: 9.5px; padding: 1px 6px; border-radius: 10px; background: #eef2f7; color: #475569; margin-top: 5px; display: inline-block; }
.layer-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.layer-row .lc { width: 50px; flex: 0 0 50px; text-align: center; font-family: ui-monospace, monospace; font-weight: 700; font-size: 11px; padding: 4px; border-radius: 6px; color: #fff; }

/* 차트 */
.chart svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--ink-2); }
.legend .li { display: flex; align-items: center; gap: 5px; }
.legend .sw { width: 11px; height: 11px; border-radius: 3px; }

/* 리스트/메타 */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }
.alarm-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 12px; }
.note { font-size: 11.5px; color: var(--muted); }
.callout { background: #fff8f3; border: 1px solid #ffd9c6; border-left: 3px solid var(--kdhc); border-radius: 8px; padding: 10px 13px; font-size: 12px; color: #7a3f1d; }

.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 14px; max-width: 640px; width: 100%; max-height: 80vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal-h { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-b { padding: 16px 18px; }
.x { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 18px; }

.filterbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.inp, select.inp { font-size: 12px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: none; background: #fff; padding: 6px 12px; font-size: 12px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button.active { background: var(--ink); color: #fff; }

/* ── ERD 모델링 UI ─────────────────────────────── */
.erd-wrap { display: grid; grid-template-columns: 220px 1fr 280px; gap: 12px; align-items: start; }
.erd-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.erd-areas { display: flex; gap: 5px; flex-wrap: wrap; }
.erd-areachip { font-size: 10.5px; padding: 3px 8px; border-radius: 20px; border: 1px solid var(--line); cursor: pointer; user-select: none; display: flex; align-items: center; gap: 5px; background:#fff; }
.erd-areachip .sw { width: 9px; height: 9px; border-radius: 50%; }
.erd-areachip.off { opacity: .4; text-decoration: line-through; }
.erd-canvas { position: relative; overflow: hidden; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; height: 800px; cursor: grab;
  background-image: radial-gradient(#dde3ed 1px, transparent 1px); background-size: 28px 28px; }
.erd-canvas.panning { cursor: grabbing; }
.erd-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
.erd-lane-hdr { position:absolute; pointer-events:none; border-radius:8px; display:flex; align-items:center; justify-content:center; }
.erd-lane-hdr span { font-size:10.5px; font-weight:800; letter-spacing:.3px; }
.erd-inner { position: relative; }
.erd-svg { position: absolute; top: 0; left: 0; pointer-events: none; overflow: visible; }
/* 줌/네비 컨트롤 */
.erd-zoom { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.erd-zoom button { border: none; background: #fff; width: 30px; height: 28px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.erd-zoom button:hover { background: #f1f5f9; }
.erd-zoom .zpct { width: 52px; text-align: center; font-size: 11.5px; font-variant-numeric: tabular-nums; border-left: 1px solid var(--line); border-right: 1px solid var(--line); height: 28px; line-height: 28px; cursor: pointer; }
.erd-minimap { position: absolute; right: 12px; bottom: 12px; width: 200px; height: 138px; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; z-index: 6; }
.erd-minimap svg { display: block; cursor: pointer; }
.erd-minimap .mm-vp { fill: rgba(33,121,7,.14); stroke: var(--kdhc); stroke-width: 1.5; }
.erd-full { position: fixed; inset: 0; z-index: 2000; background: #fff; padding: 12px 16px; overflow: auto; }
.erd-full .erd-canvas { height: calc(100vh - 96px); }
.erd-full .erd-wrap { grid-template-columns: 220px 1fr 280px; }
.erd-entity .pkdiv { border-top: 1px dashed #cbd5e1; margin: 3px 6px; }
.erd-entity { position: absolute; width: 206px; background: #fff; border: 1.5px solid #cbd5e1; border-radius: 9px; box-shadow: 0 3px 10px rgba(15,23,42,.12); font-size: 11px; z-index: 2; }
.erd-entity.sel { border-color: var(--kdhc); box-shadow: 0 0 0 3px rgba(33,121,7,.22); z-index: 5; }
.erd-entity .eh { padding: 6px 9px; border-radius: 8px 8px 0 0; color: #fff; cursor: move; display: flex; flex-direction: column; gap: 1px; }
.erd-entity .eh .l { font-weight: 800; font-size: 11.5px; }
.erd-entity .eh .n { font-size: 9.5px; opacity: .85; font-family: ui-monospace, Menlo, monospace; }
.erd-entity .eb { padding: 3px 0; }
.erd-col2 { display: flex; align-items: center; gap: 6px; padding: 2px 9px; }
.erd-col2:hover { background: #f1f5f9; }
.erd-col2 .k { width: 18px; font-size: 8.5px; font-weight: 800; color: #b45309; text-align: center; }
.erd-col2 .k.pk { color: #b45309; }
.erd-col2 .k.fk { color: #2563eb; }
.erd-col2 .cn { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; color: #334155; }
.erd-col2 .cn.pkk { font-weight: 700; text-decoration: underline; }
.erd-col2 .ct { font-size: 9.5px; color: #94a3b8; }
.erd-side { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; position: sticky; top: 70px; max-height: 660px; overflow: auto; box-shadow: var(--shadow); }
.erd-side h4 { margin: 0 0 8px; font-size: 13px; }
.erd-side .fld { margin-bottom: 8px; }
.erd-side .fld label { font-size: 10.5px; color: var(--muted); display: block; margin-bottom: 2px; }
.erd-side .inp, .erd-side select.inp { width: 100%; font-size: 11.5px; padding: 4px 7px; }
.erd-colrow { display: grid; grid-template-columns: 1fr auto; gap: 4px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line-2); }
.erd-colrow .crn { font-family: ui-monospace, monospace; font-size: 11px; }
.erd-colrow .crt { font-size: 9.5px; color: var(--muted); }
.erd-colrow .flags { display: flex; gap: 3px; }
.erd-mini { font-size: 9px; padding: 1px 4px; border-radius: 4px; border: 1px solid var(--line); cursor: pointer; background:#fff; color:#64748b; }
.erd-mini.on { background: var(--kdhc); color: #fff; border-color: var(--kdhc); }
/* DA# 컬럼 표기 — nn(필수)=파란색, opt(선택)=회색 */
.erd-col2 .k.nn { color: #2563eb; }
.erd-col2 .k.opt { color: #94a3b8; }
/* Browser Tree (DA# 스타일 좌측 탐색기) */
.erd-browser { background:#fff; border:1px solid var(--line); border-radius:10px; position:sticky; top:70px; max-height:780px; overflow:hidden; display:flex; flex-direction:column; box-shadow:var(--shadow); font-size:11.5px; }
.erd-browser-head { padding:8px 10px 7px; border-bottom:1px solid var(--line); font-weight:700; font-size:11px; color:#0e2040; background:#f8fafc; border-radius:10px 10px 0 0; letter-spacing:.2px; }
.erd-browser-body { flex:1; overflow-y:auto; }
.erd-btree-area { border-bottom:1px solid var(--line-2); }
.erd-btree-ahdr { padding:5px 8px; font-size:10.5px; cursor:pointer; display:flex; align-items:center; gap:4px; user-select:none; background:#fafafa; }
.erd-btree-ahdr:hover { background:#f1f5f9; }
.erd-btree-ent { padding:3px 8px 3px 18px; font-size:10.5px; cursor:pointer; color:#475569; display:flex; align-items:center; gap:5px; }
.erd-btree-ent:hover { background:#f1f5f9; color:#0e2040; }
.erd-btree-ent.sel { background:rgba(33,121,7,.08); color:var(--kdhc); font-weight:600; }
.erd-btree-dot { width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.ddl-pre { background: #0f1b2d; color: #cdd7e4; padding: 14px 16px; border-radius: 10px; overflow: auto; font-size: 11.5px; line-height: 1.6; max-height: 620px; font-family: ui-monospace, Menlo, monospace; }
.ddl-pre .kw { color: #ff8a5c; font-weight: 700; }
.ddl-pre .cm { color: #6b8299; }
.ddl-pre .ty { color: #7dd3fc; }
@media (max-width: 1100px) { .erd-wrap { grid-template-columns: 1fr; } .erd-browser { max-height: 260px; } }

/* 제안 협업(collab) 폼 */
textarea.inp { font-size: 12px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font-family: inherit; resize: vertical; box-sizing: border-box; }
.form-col { display: flex; flex-direction: column; gap: 9px; }
.form-col label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.form-row { display: flex; gap: 8px; align-items: center; }
.tight-ul { margin: 3px 0 0; padding-left: 16px; font-size: 11.5px; line-height: 1.6; color: var(--ink); }
.tight-ul li { margin: 1px 0; }
.chip { font-size: 11px; padding: 4px 11px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink-2); cursor: pointer; transition: all .12s; }
.chip:hover { border-color: var(--kdhc); }
.chip.on { background: var(--kdhc); color: #fff; border-color: var(--kdhc); font-weight: 600; }
.grid-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.grid-table th, .grid-table td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.grid-table th { color: var(--ink-2); font-weight: 600; background: #f8fafc; white-space: nowrap; }
.grid-table input.inp { font-size: 11px; padding: 3px 6px; }
.grid-table tfoot td { border-top: 2px solid var(--line); border-bottom: none; }

/* ── 모바일 최적화 ───────────────────────────────── */
.nav-toggle { display: none; }
.nav-backdrop { display: none; }
.mobile-bottomnav { display: none; }   /* 데스크톱에서 숨김 */
@media (max-width: 980px) { .g4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 820px) {
  /* 사이드바 → 오프캔버스 드로어 */
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink); flex: 0 0 auto; touch-action: manipulation; }
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; z-index: 200; width: 84vw; max-width: 300px; flex-basis: 84vw; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 12px 44px rgba(0,0,0,.45); }
  body.nav-open .sidebar { transform: translateX(0); }
  .nav-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 150; }
  body.nav-open .nav-backdrop { display: block; }
  body.nav-open { overflow: hidden; }
  /* 메인·상단바 */
  .main { width: 100%; }
  .topbar { padding: 0 12px; gap: 10px; height: 52px; }
  .topbar .zone-pills, .topbar .clock, .topbar .env-badge { display: none; }
  .crumb b { font-size: 13px; }
  /* 모바일 breadcrumb: 중간 경로 숨기고 🏠 › 현재 화면만 한 줄 표시 (감김 방지) */
  .crumb { flex: 1; min-width: 0; }
  .crumb-seg:not(.crumb-cur), .crumb-sep { display: none; }
  .crumb-cur { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-chip span:not(.av) { display: none; }
  .content { padding: 12px 12px 72px; }  /* 하단 nav 높이(56px) + 여유 */
  /* 그리드 1열 (클래스 + 인라인 grid-template-columns 모두) */
  .g2, .g3, .g4, .g6 { grid-template-columns: 1fr; }
  .grid[style*="columns"], .grid[style*="grid-template"] { grid-template-columns: 1fr !important; }
  .grid { gap: 10px; }
  /* 헤더·표·폼 */
  .page-head { gap: 8px; margin-bottom: 12px; }
  .page-head h1 { font-size: 17px; }
  .page-head .rfp-tags { margin-left: 0; }
  .filterbar, .form-row, .form-col { flex-wrap: wrap; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .card-b, .modal-b { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl-wrap, .erd-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* 모달 풀폭 */
  .modal { max-width: 100%; max-height: 90vh; }
  .modal-bg { padding: 8px; }
  /* 탭 가로 스크롤 */
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab { white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
  /* 터치 타깃 44px (WCAG 2.1 AA) */
  .btn { min-height: 44px; touch-action: manipulation; }
  button, [data-go], [data-toggle], [data-star] { touch-action: manipulation; }
  .nav-leaf { padding: 9px 10px 9px 32px; }  /* 세로 9px = 약 44px 높이 */
  .nav-grp { padding: 10px 10px; }
  .nav-sub { padding: 8px 10px 8px 20px; }
  #fb-fab { right: 12px; bottom: 68px; }      /* 하단 nav 위로 올림 */
  /* ERD — 모바일에서 높이 제한 */
  .erd-full .erd-canvas { max-height: 60vh !important; }
  /* 하단 퀵-네비바 */
  .mobile-bottomnav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 120;
    background: var(--navy-2, #1a2744);
    border-top: 1px solid rgba(255,255,255,.1);
    height: 56px;
    justify-content: space-around;
    align-items: stretch;
    padding: 0;
    box-shadow: 0 -4px 16px rgba(0,0,0,.28);
  }
  .mobile-bottomnav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: #7a94b0; text-decoration: none;
    font-size: 10px; font-weight: 500; flex: 1;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent;
    border-radius: 0; transition: color .12s, background .12s;
  }
  .mobile-bottomnav a:active { background: rgba(255,255,255,.06); }
  .mobile-bottomnav a.bn-active { color: var(--kdhc, #217907); }
  .mobile-bottomnav a .bn-ico { font-size: 19px; line-height: 1; }
  .mobile-bottomnav a.bn-menu { cursor: pointer; }
}
@media (max-width: 480px) {
  .page-head h1 { font-size: 15px; }
  .page-head .sub { font-size: 11px; }
  .content { padding: 10px 10px 72px; }
  .kpi-val { font-size: 22px; }
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes slideRight { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
