/* ═══════════════════════════════════════════════════════════════
   OpenMES 노션형 에디터 전역 스타일 — AstralLab ERP notion-content.css 이식(2026-09-23).
   슬래시 메뉴·버블 툴바는 body 에 붙으므로 전역이어야 한다.
   ═══════════════════════════════════════════════════════════════ */
.notion-editor { width: 100%; min-width: 0; }
.notion-editor.boxed { border: 1px solid #e3e6ef; border-radius: 10px; background: #fff; padding: 4px 6px 8px; }
.tiptap-surface { background: #fff; cursor: text; min-height: 320px; }

/* ── 본문 타이포그래피 (읽기/편집 공통) ── */
.markdown-body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; color: #1e293b; }
.markdown-body h1 { font-size: 1.8em; margin: 20px 0 12px; font-weight: 700; color: #1e3a8a; border-bottom: 1px solid #e2e8f0; padding-bottom: 0.3em; }
.markdown-body h2 { font-size: 1.4em; margin: 20px 0 12px; font-weight: 600; color: #2563eb; border-bottom: 1px solid #f1f5f9; padding-bottom: 0.3em; }
.markdown-body h3 { font-size: 1.15em; margin: 18px 0 10px; font-weight: 600; color: #3b82f6; }
.markdown-body p { margin: 0 0 12px; color: #334155; }
.markdown-body blockquote { color: #475569; border-left: 0.25em solid #3b82f6; background: #f8fafc; margin: 12px 0; padding: 8px 16px; border-radius: 4px; }
.markdown-body code { padding: 0.2em 0.4em; margin: 0; font-size: 85%; white-space: break-spaces; background-color: #f1f5f9; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.markdown-body pre { padding: 16px; overflow: auto; font-size: 85%; line-height: 1.45; background-color: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0; }
.markdown-body pre code { padding: 0; margin: 0; background: transparent; font-size: inherit; white-space: pre; }
.markdown-body ul, .markdown-body ol { padding-left: 2em; margin: 0 0 12px; }
.markdown-body li { margin-top: 0.25em; }
.markdown-body table { border-spacing: 0; border-collapse: collapse; margin: 0 0 12px; width: 100%; }
.markdown-body table th, .markdown-body table td { padding: 6px 10px; border: 1px solid #e2e8f0; }
.markdown-body table th { font-weight: 600; background-color: #f8fafc; color: #1e293b; }
.markdown-body table tr:nth-child(2n) { background-color: #f8fafc; }
.markdown-body hr { border: 0; border-top: 1px solid #e2e8f0; margin: 16px 0; }
.markdown-body img { max-width: 100%; border-radius: 6px; margin: 8px 0; }
.markdown-body a { color: #2563eb; }

/* ── '/' 슬래시 명령 메뉴 ── */
.slash-menu { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 10px 30px rgba(30,40,90,0.18); padding: 6px; width: 260px; max-height: 320px; overflow-y: auto; }
.slash-item { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: transparent; cursor: pointer; padding: 7px 9px; border-radius: 7px; text-align: left; }
.slash-item.is-selected { background: #eef2ff; }
.slash-item .slash-ico { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; color: #4f46e5; background: #f1f5f9; border-radius: 6px; flex: 0 0 auto; }
.slash-item .slash-txt { display: flex; flex-direction: column; line-height: 1.25; }
.slash-item .slash-txt b { font-size: 0.9rem; color: #1e293b; }
.slash-item .slash-txt small { font-size: 0.72rem; color: #94a3b8; }
.slash-empty { padding: 10px; color: #94a3b8; font-size: 0.85rem; text-align: center; }

/* ── 편집 영역 ── */
.tiptap-editor.ProseMirror { outline: none !important; box-shadow: none !important; min-height: 300px; padding: 10px 8px 60px; font-size: 14.5px; line-height: 1.7; }
.tiptap-editor.ProseMirror:focus, .tiptap-editor.ProseMirror:focus-visible { outline: none !important; box-shadow: none !important; border: none !important; }
.tiptap-editor p.is-empty::before { content: attr(data-placeholder); color: #b6bccb; float: left; height: 0; pointer-events: none; }
.tiptap-editor ul[data-type="taskList"] { list-style: none; padding-left: 0.2em; }
.tiptap-editor ul[data-type="taskList"] li { display: flex; align-items: flex-start; gap: 8px; }
.tiptap-editor ul[data-type="taskList"] li > label { margin-top: 4px; }
.tiptap-editor ul[data-type="taskList"] li > div { flex: 1; }
.tiptap-editor .ProseMirror-selectednode { outline: 2px solid #c7d2fe; border-radius: 8px; }
.tiptap-editor .wiki-figure.ProseMirror-selectednode { outline: none; }
.tiptap-editor .wiki-figure.ProseMirror-selectednode img.wiki-img { box-shadow: 0 0 0 2px #c7d2fe; }

/* ── 버블(선택 서식) 툴바 ── */
.ne-bubble-toolbar { display: flex; align-items: center; gap: 2px; background: #1f2937; color: #fff; border-radius: 8px; padding: 3px 5px; box-shadow: 0 6px 20px rgba(0,0,0,0.28); }
.ne-bubble-toolbar button { border: 0; background: transparent; color: #fff; width: 28px; height: 26px; border-radius: 5px; font-size: 12px; cursor: pointer; }
.ne-bubble-toolbar button:hover { background: rgba(255,255,255,.14); }
.ne-bubble-toolbar button.is-active { background: #4f46e5; }

/* ── 코드 블록 ── */
.cb-wrap { position: relative; margin: 12px 0; border: 1px solid #e5e8ef; border-radius: 10px; background: #f8fafc; overflow: hidden; }
.cb-bar { display: flex; justify-content: flex-end; align-items: center; padding: 5px 8px; background: #eef1f6; border-bottom: 1px solid #e5e8ef; }
.cb-lang { font-size: 0.75rem; color: #475569; background: #fff; border: 1px solid #d7dbe6; border-radius: 6px; padding: 2px 6px; cursor: pointer; outline: none; }
.cb-wrap pre { margin: 0; padding: 12px 14px; background: transparent; border: none; overflow-x: auto; }
.cb-wrap pre code { background: transparent; padding: 0; font-size: 0.85rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
/* highlight.js github 유사 최소 테마 */
.hljs-comment, .hljs-quote { color: #6a737d; } .hljs-keyword, .hljs-selector-tag, .hljs-subst { color: #d73a49; }
.hljs-number, .hljs-literal, .hljs-variable, .hljs-template-variable, .hljs-tag .hljs-attr { color: #005cc5; }
.hljs-string, .hljs-doctag { color: #032f62; } .hljs-title, .hljs-section, .hljs-selector-id { color: #6f42c1; }
.hljs-type, .hljs-class .hljs-title { color: #e36209; } .hljs-attribute, .hljs-name, .hljs-tag { color: #22863a; }
.hljs-built_in, .hljs-builtin-name { color: #005cc5; } .hljs-meta { color: #735c0f; }

/* ── 파일 첨부 카드 ── */
.file-attach { display: flex; align-items: center; gap: 10px; margin: 8px 0; padding: 10px 12px; border: 1px solid #e5e8ef; border-radius: 10px; background: #f8fafc; text-decoration: none; color: #1e293b; cursor: pointer; transition: background .15s, border-color .15s; }
.file-attach:hover { background: #eef2ff; border-color: #c7d2fe; }
.file-attach .fa-ico { color: #6366f1; font-size: 22px; }
.file-attach .fa-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.file-attach .fa-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-attach .fa-size { font-size: 0.75rem; color: #94a3b8; }
.file-attach .fa-dl { color: #94a3b8; font-size: 16px; }
.file-attach:hover .fa-dl { color: #6366f1; }

/* ── 이미지 + 캡션 ── */
.wiki-figure { margin: 12px 0; display: flex; flex-direction: column; align-items: flex-start; }
.wiki-figure img.wiki-img { max-width: 100%; border-radius: 8px; display: block; }
.wiki-figcap { margin-top: 6px; font-size: 0.82rem; color: #64748b; outline: none; min-width: 140px; max-width: 100%; line-height: 1.5; padding: 3px 8px; border-radius: 6px; cursor: text; }
.wiki-figcap:empty::before { content: attr(data-placeholder); color: #9aa3b5; }
.wiki-figure .wiki-figcap:empty { opacity: 0; transition: opacity .15s, background .15s; }
.wiki-figure:hover .wiki-figcap:empty { opacity: 1; background: #f1f5f9; }
.wiki-figcap:focus { opacity: 1 !important; background: #f8fafc; }

/* ── 선언형 화면 'list' 섹션(결과 기록 카드 목록) + 더보기 팝업 ── */
.sh-list { display: flex; flex-direction: column; gap: 8px; }
.sh-list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.sh-list-empty { color: #8a94a3; font-size: 13px; padding: 18px 6px; text-align: center; border: 1px dashed #dfe3ea; border-radius: 8px; }
.sh-card { border: 1px solid #e3e7ec; border-radius: 10px; background: #fff; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; transition: box-shadow .12s, border-color .12s; }
.sh-card:hover { border-color: #c7d2fe; box-shadow: 0 2px 8px rgba(30,40,90,.08); }
.sh-card.is-new { border-style: dashed; }
.sh-card-body { flex: 1; min-width: 0; }
.sh-card-title { font-weight: 600; font-size: 14px; color: #1f2733; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-card-title.is-empty { color: #9aa3b0; font-weight: 500; }
.sh-card-meta { display: flex; gap: 12px; margin-top: 4px; font-size: 12px; color: #6b7684; }
.sh-card-meta i { margin-right: 4px; color: #9aa3b0; }
.sh-card-badge { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #eef2ff; color: #4338ca; margin-left: 6px; }
.sh-card-more { flex: 0 0 auto; height: 28px; padding: 0 10px; border: 1px solid #d5d9e0; border-radius: 6px; background: #fff; color: #1b6ec2; font-size: 12.5px; cursor: pointer; }
.sh-card-more:hover { background: #eef4fb; }
.ne-modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 10500; display: flex; align-items: center; justify-content: center; }
.ne-modal { width: min(1100px, 94vw); max-height: 92vh; background: #fff; border-radius: 12px; box-shadow: 0 18px 60px rgba(0,0,0,.3); display: flex; flex-direction: column; overflow: hidden; }
.ne-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid #e3e7ec; font-weight: 700; font-size: 15px; color: #1f2733; }
.ne-modal-head .ne-close { border: 0; background: transparent; font-size: 18px; color: #6b7684; cursor: pointer; }
.ne-modal-body { flex: 1; overflow: auto; padding: 14px 18px; }
.ne-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; margin-bottom: 12px; }
.ne-fields label { display: block; font-size: 12px; color: #5b6675; margin-bottom: 3px; }
.ne-fields input[type="text"], .ne-fields input[type="date"], .ne-fields textarea { width: 100%; border: 1px solid #d5d9e0; border-radius: 6px; padding: 5px 8px; font-size: 13.5px; }
.ne-fields .ne-check { display: flex; align-items: center; gap: 6px; padding-top: 22px; font-size: 13px; }
.ne-modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 18px; border-top: 1px solid #e3e7ec; background: #f8fafc; }
.ne-modal-foot .ne-meta { margin-right: auto; font-size: 12px; color: #6b7684; }
.ne-btn { height: 32px; padding: 0 14px; border-radius: 6px; border: 1px solid #d5d9e0; background: #fff; color: #1f2733; font-size: 13px; cursor: pointer; }
.ne-btn.primary { background: #1b6ec2; border-color: #1b6ec2; color: #fff; font-weight: 600; }
.ne-btn.danger { color: #d64545; }
.ne-btn:disabled { opacity: .5; cursor: default; }
