/* ============================================================
   DrawingDetailPanel — SEDMS 원본 ddp-* 프리픽스 이식
   Hono SSR + 클라이언트 JS에서 동일 렌더링
   ============================================================ */

/* 우측 패널 컨테이너(부모는 #xrx-right-body) */
.ddp-wrap {
  display: flex; flex-direction: column; gap: 14px;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, system-ui, sans-serif;
  color: #1f2937;
  padding: 14px 14px 18px;
}

/* 빈 상태 */
.ddp-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; padding: 40px 16px; text-align: center; color: #94a3b8;
}
.ddp-empty-icon { font-size: 38px; margin-bottom: 10px; }
.ddp-empty p { margin: 0; font-size: 13px; line-height: 1.55; }

/* ── 헤더 ── */
.ddp-header {
  padding: 12px 14px 13px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f9 100%);
  border: 1px solid #e2e8f0;
}
.ddp-header-main {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.ddp-dwg-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px; font-weight: 700; color: #0f172a;
  background: #ffffff; padding: 3px 8px; border-radius: 6px;
  border: 1px solid #cbd5e1;
}
.ddp-status {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  letter-spacing: -.01em;
  border: 1px solid transparent;
}
.ddp-status--planned       { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.ddp-status--not_submitted { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.ddp-status--submitted     { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.ddp-status--received      { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.ddp-status--under_review  { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.ddp-status--completed     { background: #ecfdf5; color: #065f46; border-color: #6ee7b7; }
.ddp-status--superseded    { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.ddp-status--withdrawn     { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.ddp-title {
  margin-top: 8px;
  font-size: 13.5px; font-weight: 600;
  color: #0f172a;
  line-height: 1.45;
  word-break: break-word;
}

/* ── 메타 테이블 ── */
.ddp-meta {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}
.ddp-meta th,
.ddp-meta td {
  padding: 7px 10px;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
  vertical-align: top;
  text-align: left;
}
.ddp-meta tr:last-child th,
.ddp-meta tr:last-child td { border-bottom: none; }
.ddp-meta th:last-child,
.ddp-meta td:last-child { border-right: none; }
.ddp-meta th {
  width: 70px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}
.ddp-meta td { color: #1f2937; }
.ddp-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.ddp-comment-badge {
  display: inline-block;
  background: #ef4444; color: #fff;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
}

/* ── 섹션 공통 ── */
.ddp-section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px 12px;
}
.ddp-section-title {
  font-size: 12.5px; font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e5e7eb;
}

/* ── PDF 영역 ── */
.ddp-pdf-wrap {
  width: 100%; height: 220px;
  border: 1px solid #e5e7eb; border-radius: 6px; overflow: hidden;
  background: #f8fafc;
}
.ddp-pdf-iframe { width: 100%; height: 100%; border: none; }
.ddp-pdf-placeholder {
  padding: 14px 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  color: #475569;
  text-align: center;
  line-height: 1.6;
}
.ddp-pdf-open {
  margin-top: 8px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px;
  background: #2f5baa; color: #fff;
  border: none; border-radius: 5px;
  cursor: pointer;
  font-size: 12px; font-weight: 600;
}
.ddp-pdf-open:hover { background: #244a8d; }
.ddp-pdf-open iconify-icon { font-size: 13px; }

/* ── 개정 이력 리스트 ── */
.ddp-rev-list { display: flex; flex-direction: column; gap: 4px; }
.ddp-rev-row {
  display: grid;
  grid-template-columns: 60px 1fr 90px;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.ddp-rev-row:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}
.ddp-rev-label {
  font-family: ui-monospace, monospace;
  font-weight: 700; color: #1e40af;
  font-size: 11.5px;
}
.ddp-rev-file {
  font-family: ui-monospace, monospace;
  font-size: 11.5px; color: #475569;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ddp-rev-date {
  font-size: 11px; color: #94a3b8;
  font-family: ui-monospace, monospace;
  text-align: right;
}

/* ── 연결 BOM ── */
.ddp-bom-list { display: flex; flex-direction: column; gap: 4px; }
.ddp-bom-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 8px; align-items: center;
  padding: 5px 8px;
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 5px;
  font-size: 11.5px;
}
.ddp-bom-code {
  font-family: ui-monospace, monospace;
  font-weight: 700; color: #92400e;
}
.ddp-bom-name { color: #1f2937; }
.ddp-bom-unlink {
  width: 20px; height: 20px;
  border: none; background: #fee2e2; color: #b91c1c;
  border-radius: 4px; cursor: pointer; font-weight: 700;
}
.ddp-bom-unlink:hover { background: #fecaca; }
.ddp-bom-empty {
  padding: 8px 10px;
  background: #f8fafc; border: 1px dashed #cbd5e1;
  border-radius: 5px;
  color: #94a3b8; font-size: 11.5px; text-align: center;
}
.ddp-bom-add { margin-top: 8px; }
.ddp-bom-search {
  width: 100%;
  padding: 6px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 12px;
  background: #f8fafc;
}
.ddp-bom-search:disabled { color: #94a3b8; cursor: not-allowed; }

/* ── 액션 푸터 ── */
.ddp-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding-top: 4px;
}
.ddp-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px;
  background: #ffffff; color: #334155;
  border: 1px solid #cbd5e1; border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px; font-weight: 600;
  transition: background .12s, border-color .12s;
}
.ddp-btn:hover { background: #f1f5f9; border-color: #94a3b8; }
.ddp-btn.primary {
  background: #2f5baa; color: #fff; border-color: #2f5baa;
}
.ddp-btn.primary:hover { background: #244a8d; border-color: #244a8d; }
.ddp-btn iconify-icon { font-size: 14px; }

/* ============================================================
   행 전체 하이라이트 (사용자 명령: "리스트 클릭하면 전체셀이 하이라이트")
   ============================================================ */
tr.xg-row-on > .xg-cell,
tr.xg-row-on > .xg-row-header {
  background: #dbeafe !important; /* 부드러운 파란 */
}
tr.xg-row-active > .xg-cell {
  background: #bfdbfe !important; /* 활성 행은 한 톤 진하게 */
}
tr.xg-row-active > .xg-row-header {
  background: #93c5fd !important;
  color: #ffffff;
  font-weight: 700;
}
.xg-cell.xg-row-hilite {
  /* 행 모드일 때 outline 제거 — 행 전체에 같은 배경을 깐다 */
  outline: none;
}
.xg-cell.xg-active {
  /* 활성 셀(현재 포커스)은 항상 굵은 테두리 */
  outline: 2px solid #2f5baa;
  outline-offset: -2px;
  z-index: 1;
}

/* 우측 패널 스크롤 */
#xrx-right-body { overflow-y: auto; }

/* ============================================================
   Bulk Intake Modal — 도면 일괄 등록·리비전·배포
   ============================================================ */
.bki-modal { position: fixed; inset: 0; z-index: 8000; }
.bki-modal.hidden { display: none; }
.bki-backdrop {
  position: absolute; inset: 0;
  background: rgba(11,18,32,.55);
  backdrop-filter: blur(2px);
}
.bki-dialog {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 92vw; max-width: 980px; max-height: 86vh;
  background: #fff; border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0,0,0,.32);
  display: flex; flex-direction: column;
  overflow: hidden;
  font-family: 'Pretendard Variable', Pretendard, system-ui, sans-serif;
}
.bki-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f9 100%);
}
.bki-head h3 { margin: 0 0 4px; font-size: 16px; color: #0f172a; }
.bki-sub { margin: 0; font-size: 12.5px; color: #64748b; }
.bki-close {
  background: none; border: none; font-size: 22px; line-height: 1;
  cursor: pointer; color: #64748b; padding: 4px 10px; border-radius: 6px;
}
.bki-close:hover { background: #e2e8f0; color: #0f172a; }

.bki-body { flex: 1; overflow-y: auto; padding: 16px 20px; }

.bki-dropzone {
  border: 2px dashed #94a3b8;
  border-radius: 10px;
  background: #f8fafc;
  padding: 22px 16px;
  text-align: center;
  transition: background .15s, border-color .15s;
}
.bki-dropzone.drag-over {
  border-color: #2f5baa;
  background: #eff6ff;
}
.bki-drop-icon { font-size: 38px; margin-bottom: 6px; }
.bki-drop-msg { font-size: 13px; color: #334155; line-height: 1.5; }
.bki-drop-msg strong { color: #0f172a; }
.bki-drop-msg small { color: #64748b; }
.bki-drop-btns { margin-top: 10px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.bki-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: #ffffff; color: #334155;
  border: 1px solid #cbd5e1; border-radius: 6px;
  cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
  transition: background .12s, border-color .12s;
}
.bki-btn:hover { background: #f1f5f9; border-color: #94a3b8; }
.bki-btn:disabled { opacity: .5; cursor: not-allowed; }
.bki-btn.primary { background: #2f5baa; color: #fff; border-color: #2f5baa; }
.bki-btn.primary:hover:not(:disabled) { background: #244a8d; }
.bki-btn.ghost { background: #fefce8; color: #92400e; border-color: #fde68a; }
.bki-btn.ghost:hover:not(:disabled) { background: #fef3c7; }

.bki-summary {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin: 14px 0 10px;
}
.bki-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
}
.bki-pill.bki-ok   { background: #ecfdf5; color: #065f46; border-color: #6ee7b7; }
.bki-pill.bki-warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.bki-pill.bki-amb  { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.bki-pill.bki-bad  { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.bki-list { display: flex; flex-direction: column; gap: 6px; }
.bki-empty { padding: 18px; text-align: center; color: #94a3b8; font-size: 12.5px; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 6px; }
.bki-card {
  border: 1px solid #e5e7eb; border-radius: 7px;
  background: #ffffff; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.bki-card.bki-st-ok { border-left: 4px solid #10b981; }
.bki-card.bki-st-warn { border-left: 4px solid #f59e0b; }
.bki-card.bki-st-amb { border-left: 4px solid #8b5cf6; background: #fbfaff; }
.bki-card.bki-st-bad { border-left: 4px solid #ef4444; background: #fef9f9; }

.bki-card-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; flex-wrap: wrap; }
.bki-card-meta { color: #475569; font-size: 11.5px; }
.bki-st {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  background: #f1f5f9; color: #334155;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.bki-st-ok   .bki-st { background: #ecfdf5; color: #065f46; }
.bki-st-warn .bki-st { background: #fffbeb; color: #b45309; }
.bki-st-amb  .bki-st { background: #f5f3ff; color: #6d28d9; }
.bki-st-bad  .bki-st { background: #fef2f2; color: #b91c1c; }
.bki-fn { font-family: ui-monospace, monospace; font-size: 12px; color: #0f172a; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bki-sz { color: #94a3b8; font-family: ui-monospace, monospace; font-size: 11px; }
.bki-mono { font-family: ui-monospace, monospace; }
.bki-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 6px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 4px;
  color: #334155; font-size: 11px;
}
.bki-pick {
  padding: 3px 6px; border: 1px solid #cbd5e1; border-radius: 4px;
  font-size: 11.5px; background: #fff;
}
.bki-issues { margin-top: 4px; padding: 4px 8px; background: #fef9c3; border-radius: 4px; }
.bki-issue { font-size: 11px; color: #713f12; line-height: 1.5; }

.bki-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
}
.bki-foot-info { font-size: 12.5px; color: #475569; }
.bki-foot-actions { display: flex; gap: 8px; }

/* 컨텍스트 메뉴(우클릭) — 단순화 */
.xg-ctx-menu .xg-ctx-item { font: inherit; }

/* 도면 종류 탭 옆 액션 버튼 (일괄 등록 / 행 추가) */
.xrx-tab-btn {
  display: inline-flex; align-items: center; gap: 4px;
  margin-right: 4px;
  padding: 5px 12px;
  background: #2f5baa; color: #fff;
  border: 1px solid #2f5baa; border-radius: 5px;
  cursor: pointer;
  font-size: 12.5px; font-weight: 600;
  transition: background .12s, border-color .12s;
}
.xrx-tab-btn:hover { background: #244a8d; border-color: #244a8d; }
.xrx-tab-btn + .xrx-tab-btn { background:#ffffff; color:#2f5baa; border-color:#2f5baa; }
.xrx-tab-btn + .xrx-tab-btn:hover { background:#eff6ff; }

/* 전역 드롭 오버레이 (페이지에 PDF 드래그 시 표시) */
#xrx-global-drop-overlay {
  position: fixed; inset: 0; z-index: 7000;
  background: rgba(47,91,170,0.18);
  border: 4px dashed #2f5baa;
  display: none;
  align-items: center; justify-content: center;
  pointer-events: none;
  color: #1e3a8a; font-size: 22px; font-weight: 700;
  letter-spacing: -.01em;
  text-shadow: 0 1px 2px rgba(255,255,255,.6);
}
#xrx-global-drop-overlay.on { display: flex; }
#xrx-global-drop-overlay .gdo-card {
  background: rgba(255,255,255,.95);
  border-radius: 16px;
  padding: 26px 36px;
  box-shadow: 0 20px 48px rgba(0,0,0,.25);
  text-align: center;
}
#xrx-global-drop-overlay .gdo-icon { font-size: 56px; display: block; margin-bottom: 8px; }
#xrx-global-drop-overlay .gdo-sub { font-size: 13px; color: #475569; font-weight: 500; margin-top: 4px; }

/* ============ SEDMS Drawing Domain Modal (.dgd-*) ============ */
.dgd-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
  z-index: 9000; display: flex; align-items: center; justify-content: center;
}
.dgd-backdrop.hidden { display: none; }
.dgd-dialog {
  background: #fff; border-radius: 12px;
  width: min(960px, 96vw); max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,.32);
  overflow: hidden;
}
.dgd-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.dgd-title { font-size: 16px; font-weight: 700; color: #0f172a; }
.dgd-x {
  background: transparent; border: 0; font-size: 24px; line-height: 1;
  color: #64748b; cursor: pointer; padding: 2px 8px; border-radius: 6px;
}
.dgd-x:hover { background: #e2e8f0; color: #0f172a; }
.dgd-body { padding: 18px 20px; overflow: auto; flex: 1; }
.dgd-foot {
  padding: 12px 20px; border-top: 1px solid #e2e8f0;
  display: flex; gap: 10px; justify-content: flex-end;
  background: #f8fafc;
}
.dgd-btn {
  padding: 8px 16px; border-radius: 8px; font-weight: 600;
  font-size: 13px; cursor: pointer; border: 1px solid transparent;
  transition: all .12s;
}
.dgd-btn.primary { background: #2563eb; color: #fff; border-color: #1d4ed8; }
.dgd-btn.primary:hover { background: #1d4ed8; }
.dgd-btn.ghost { background: #fff; color: #475569; border-color: #cbd5e1; }
.dgd-btn.ghost:hover { background: #f1f5f9; }
.dgd-btn.danger { background: #fff; color: #dc2626; border-color: #fca5a5; }
.dgd-btn.danger:hover { background: #fef2f2; }
.dgd-empty {
  text-align: center; padding: 36px 16px; color: #94a3b8;
  font-size: 13px;
}

/* form */
.dgd-form { display: flex; flex-direction: column; gap: 12px; }
.dgd-field { display: flex; flex-direction: column; gap: 4px; }
.dgd-field > span { font-size: 12px; font-weight: 600; color: #475569; }
.dgd-field > input,
.dgd-field > select,
.dgd-field > textarea {
  padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px;
  font: inherit; color: #0f172a; background: #fff;
}
.dgd-field > input:focus,
.dgd-field > select:focus,
.dgd-field > textarea:focus { border-color: #2563eb; outline: 2px solid #93c5fd; outline-offset: 0; }
.dgd-field > input[readonly] { background: #f1f5f9; color: #64748b; }

/* meta */
.dgd-meta {
  display: flex; flex-wrap: wrap; gap: 12px 18px;
  padding: 10px 12px; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: 12.5px; color: #334155;
}
.dgd-meta b { color: #0f172a; font-weight: 600; margin-right: 4px; }

/* targets */
.dgd-targets {
  border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 10px 12px;
}
.dgd-targets legend { padding: 0 6px; font-size: 12px; color: #475569; font-weight: 600; }
.dgd-target-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.dgd-target {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 8px;
  align-items: center;
  padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 6px;
  cursor: pointer; font-size: 12.5px;
}
.dgd-target:has(input:checked) { background: #eff6ff; border-color: #93c5fd; }
.dgd-target input { margin: 0; }
.dgd-tname { font-weight: 600; color: #0f172a; }
.dgd-temail { color: #64748b; font-size: 11.5px; grid-column: 2; }
.dgd-tkind {
  font-size: 10.5px; padding: 1px 6px; border-radius: 999px;
  background: #e2e8f0; color: #475569; font-weight: 600;
}

/* table */
.dgd-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dgd-table thead th {
  text-align: left; padding: 8px 10px;
  background: #f1f5f9; color: #334155; font-weight: 600;
  border-bottom: 1px solid #cbd5e1; position: sticky; top: 0;
}
.dgd-table thead th.num { text-align: right; }
.dgd-table tbody td {
  padding: 8px 10px; border-bottom: 1px solid #f1f5f9; color: #1e293b;
  vertical-align: middle;
}
.dgd-table tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
.dgd-table tbody tr:hover { background: #f8fafc; }
.dgd-table tbody td.actions { white-space: nowrap; }
.dgd-mini {
  padding: 4px 10px; font-size: 11.5px; font-weight: 600;
  background: #fff; color: #2563eb; border: 1px solid #93c5fd;
  border-radius: 6px; cursor: pointer; margin-right: 4px;
}
.dgd-mini:hover { background: #eff6ff; }

.dgd-rev-label {
  display: inline-block; padding: 2px 8px;
  background: #1e293b; color: #fff; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.dgd-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.dgd-pill.st-registered { background: #e2e8f0; color: #475569; }
.dgd-pill.st-distributed { background: #dcfce7; color: #15803d; }
.dgd-pill.st-approved { background: #dbeafe; color: #1d4ed8; }
.dgd-pill.st-rejected { background: #fee2e2; color: #b91c1c; }
.dgd-pill.st-pending,
.dgd-pill.st-review { background: #fef3c7; color: #b45309; }

/* ============ STEP4: 리본 숨김 토글 ============ */
.xrx-ribbon-toggle {
  position: absolute; top: 8px; right: 12px;
  z-index: 100;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; font-size: 11.5px; font-weight: 600;
  background: rgba(255, 255, 255, 0.9); color: #475569;
  border: 1px solid #cbd5e1; border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: all .15s;
}
.xrx-ribbon-toggle:hover { background: #fff; color: #2563eb; border-color: #93c5fd; }
.xrx-ribbon-toggle-icon { font-size: 13px; line-height: 1; }
.xrx-ribbon-collapsed .xrx-ribbon-host { display: none !important; }
.xrx-ribbon-collapsed .xrx-body { margin-top: 0; }

/* 2026-06-02 좌측 도면분류 사이드바 너비 확대 (마스터 요구: "이 쪽 창 조금 늘려")
   200px → 240px. MAKER 탭 라벨 잘림 방지. 데스크탑 한정(모바일 반응형 보존).
   기존 grid-template-columns 출처 우선순위를 확실히 이기기 위해 id 셀렉터 + !important. */
@media (min-width: 1024px) {
  #xrx-root .xrx-body { grid-template-columns: 240px 1fr 320px !important; }
}

/* === R2: SEDMS Shell→Real fill === */
.sf-topbar{display:flex;align-items:center;gap:8px;padding:8px 12px;background:#0f1623;border-bottom:1px solid #1d2a3d;flex-wrap:wrap}
.sf-topbar .sf-inp,.sf-topbar .sf-btn,.sf-topbar .sf-sep{font-size:12px}
.sf-inp{background:#0a1220;border:1px solid #2a3a55;color:#e6eefb;padding:6px 10px;border-radius:6px;outline:none}
.sf-inp:focus{border-color:#3b82f6}
.sf-search-inp{min-width:280px;flex:0 1 360px}
.sf-search-btn{background:#1e3a8a;color:#fff;border:1px solid #1e3a8a;padding:6px 12px;border-radius:6px;cursor:pointer}
.sf-btn{background:#1c2735;color:#d6e4f7;border:1px solid #2c3a52;padding:6px 12px;border-radius:6px;cursor:pointer;display:inline-flex;align-items:center;gap:4px;position:relative}
.sf-btn:hover{background:#243246;border-color:#3b82f6}
.sf-btn-primary{background:#1e3a8a;color:#fff;border-color:#1e3a8a}
.sf-sep{width:1px;height:18px;background:#2a3a55;margin:0 4px}
.sf-bell{padding:6px 10px}
.sf-badge{background:#ef4444;color:#fff;font-size:10px;padding:1px 5px;border-radius:8px;margin-left:4px;font-weight:700;min-width:14px;text-align:center;line-height:1.4}
.sf-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.65);z-index:9999;display:flex;align-items:center;justify-content:center;padding:24px}
.sf-dialog{background:#0f1623;border:1px solid #2a3a55;border-radius:10px;color:#e6eefb;min-width:560px;max-width:900px;width:80vw;max-height:88vh;display:flex;flex-direction:column;box-shadow:0 20px 60px rgba(0,0,0,.6)}
.sf-head{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid #1d2a3d}
.sf-head strong{font-size:15px}
.sf-x{background:transparent;border:0;color:#9ab;font-size:18px;cursor:pointer;padding:2px 8px;border-radius:4px}
.sf-x:hover{background:#1c2735;color:#fff}
.sf-body{padding:16px 18px;overflow:auto;flex:1}
.sf-foot{padding:12px 18px;border-top:1px solid #1d2a3d;display:flex;gap:8px;justify-content:flex-end}
.sf-hint{color:#9ab;font-size:12px;margin:0 0 12px}
.sf-empty{color:#7b8aa3;font-size:12px;text-align:center;padding:24px}
.sf-h4{font-size:13px;color:#9cf;margin:18px 0 8px;border-bottom:1px solid #1d2a3d;padding-bottom:6px}
.sf-tbl{width:100%;border-collapse:collapse;font-size:12px}
.sf-tbl th,.sf-tbl td{border:1px solid #1d2a3d;padding:6px 9px;text-align:left}
.sf-tbl th{background:#152033;color:#9cf;font-weight:600}
.sf-tbl tr:hover td{background:#152033}
.sf-mono{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:11px}
.sf-act{color:#fbbf24;font-weight:600}
.sf-cb{text-align:center}
.sf-cb input{transform:scale(1.2);cursor:pointer;accent-color:#3b82f6}
.sf-sel{background:#0a1220;border:1px solid #2a3a55;color:#e6eefb;padding:4px 8px;border-radius:4px;font-size:12px}
.sf-mtbl td:last-child{width:120px}

/* RBAC matrix */
.sf-rbac .sf-tbl tbody td.sf-act{background:#0a1220;color:#cdd;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:11px}

/* Notifications */
.sf-notif-list{display:flex;flex-direction:column;gap:6px}
.sf-notif-row{display:flex;gap:10px;padding:10px 12px;background:#152033;border:1px solid #1d2a3d;border-radius:6px;cursor:pointer;align-items:flex-start}
.sf-notif-row:hover{border-color:#3b82f6}
.sf-notif-row.sf-read{opacity:.55}
.sf-notif-kind{font-size:10px;font-weight:700;padding:3px 8px;border-radius:4px;text-transform:uppercase;letter-spacing:.5px;flex:0 0 auto;height:fit-content}
.sf-k-distribution{background:#1e3a8a;color:#fff}
.sf-k-review{background:#7c2d12;color:#fff}
.sf-k-rbac{background:#581c87;color:#fff}
.sf-notif-main{flex:1}
.sf-notif-main strong{display:block;font-size:13px;color:#fff;margin-bottom:2px}
.sf-notif-body{font-size:12px;color:#cbd5e1;margin-bottom:4px}
.sf-notif-main time{font-size:10px;color:#7b8aa3;font-family:ui-monospace,Menlo,Consolas,monospace}

/* Folder tree */
.sf-tree-ul{list-style:none;margin:0;padding:0}
.sf-tree-root{border:1px solid #1d2a3d;border-radius:6px;background:#0a1220;padding:6px;max-height:300px;overflow:auto}
.sf-tree-row{display:flex;gap:6px;align-items:center;padding:4px 6px;border-radius:4px;font-size:12px;cursor:pointer}
.sf-tree-row:hover{background:#152033}
.sf-tree-ico{flex:0 0 18px}
.sf-tree-name{flex:1;color:#e6eefb}
.sf-tree-cnt{color:#7b8aa3;font-size:10px;font-family:ui-monospace,Menlo,Consolas,monospace}
.sf-folder-form{display:flex;gap:8px;align-items:center;margin-top:8px;flex-wrap:wrap}
.sf-folder-form label{color:#9ab;font-size:11px}
.sf-side-folder-group{margin-top:12px;padding-top:10px;border-top:1px dashed #2a3a55}
.sf-side-folder-title{font-size:11px;color:#9cf;padding:4px 6px;font-weight:600}
.sf-tree-side{max-height:260px}

/* Upload toast */
.sf-upload-toast{position:fixed;bottom:24px;right:24px;background:#0f1623;border:1px solid #3b82f6;border-radius:8px;padding:12px 16px;color:#e6eefb;min-width:280px;box-shadow:0 8px 24px rgba(0,0,0,.5);z-index:9998}
.sf-up-name{font-size:12px;margin-bottom:6px;font-family:ui-monospace,Menlo,Consolas,monospace}
.sf-up-bar{height:8px;background:#1c2735;border-radius:4px;overflow:hidden}
.sf-up-fill{display:block;height:100%;background:linear-gradient(90deg,#3b82f6,#22d3ee);transition:width .25s}
.sf-up-pct{font-size:10px;color:#9cf;margin-top:4px;text-align:right;font-family:ui-monospace,Menlo,Consolas,monospace}

.sf-extra{color:#7b8aa3;font-size:10px}

/* ============================================================================
 * R3 모듈 스타일 — RevGrid / Attachments / Multi / EditFlow
 * ========================================================================== */

/* ---------- rev-inline dots (Agent1) ---------- */
.rev-inline { display:flex; flex-wrap:wrap; gap:6px; align-items:center; padding:4px 0; }
.rev-dot { width:10px; height:10px; border-radius:50%; display:inline-block; box-shadow:0 0 0 1px rgba(0,0,0,.1); }
.rev-label { font-size:11px; color:#374151; font-weight:600; margin-right:4px; }
.rev-empty { color:#9ca3af; font-size:12px; }

/* ---------- rev-timeline (Agent1) ---------- */
.rev-timeline { display:flex; flex-direction:column; gap:8px; padding:4px 0; }
.rev-timeline.empty { color:#9ca3af; padding:14px; text-align:center; background:#f9fafb; border-radius:8px; }
.rev-tl-item { display:grid; grid-template-columns:18px 1fr; gap:8px; align-items:flex-start; }
.rev-tl-dot { width:12px; height:12px; border-radius:50%; margin-top:6px; box-shadow:0 0 0 2px #fff,0 0 0 3px rgba(0,0,0,.1); }
.rev-tl-card { border:1px solid #e5e7eb; border-radius:8px; padding:8px 10px; background:#fff; }
.rev-tl-head { display:flex; justify-content:space-between; align-items:center; font-size:13px; margin-bottom:4px; }
.rev-tl-status { font-size:11px; font-weight:600; }
.rev-tl-row { display:flex; gap:8px; font-size:11px; color:#374151; }
.rev-tl-row span { width:36px; color:#6b7280; }
.rev-tl-conn { width:2px; height:6px; background:#e5e7eb; margin-left:5px; }
.rev-tl-item.unreg .rev-tl-card { background:#f9fafb; opacity:.85; }

/* ---------- 격자 (Agent1) ---------- */
.ddp-grid { display:grid; grid-template-columns:1fr; gap:0; border:1px solid #e5e7eb; border-radius:8px; overflow:hidden; background:#fff; }
.ddp-grid.empty { padding:14px; color:#9ca3af; text-align:center; }
.ddp-grid-row { display:grid; grid-template-columns:90px 1fr; border-top:1px solid #f3f4f6; }
.ddp-grid-row:first-child { border-top:none; }
.ddp-grid-key { background:#f9fafb; padding:6px 10px; font-size:11px; color:#6b7280; font-weight:600; border-right:1px solid #f3f4f6; }
.ddp-grid-val { padding:6px 10px; font-size:12px; color:#111827; display:flex; justify-content:space-between; align-items:center; }
.ddp-grid-row.editable .ddp-grid-val { cursor:pointer; }
.ddp-grid-row.editable .ddp-grid-val:hover { background:#fef3c7; }
.ddp-grid-row.locked .ddp-grid-val { background:#f3f4f6; color:#6b7280; }
.ddp-grid-row .val-icon { opacity:.5; font-size:10px; }
.ddp-grid-input { width:100%; border:1px solid #2563eb; border-radius:4px; padding:3px 6px; font-size:12px; }
.ddp-grid-val.saved { background:#d1fae5 !important; transition:background .3s; }

/* ---------- distribution card (Agent1) ---------- */
.tx-list { display:flex; flex-direction:column; gap:6px; }
.tx-empty { color:#9ca3af; padding:10px; text-align:center; font-size:12px; }
.tx-row { display:grid; grid-template-columns:48px 1fr 48px; gap:8px; padding:8px; border:1px solid #e5e7eb; border-radius:8px; background:#fff; }
.tx-purpose { color:#fff; font-weight:700; font-size:11px; border-radius:6px; display:flex; align-items:center; justify-content:center; }
.tx-info { display:flex; flex-direction:column; gap:2px; min-width:0; }
.tx-title { font-size:12px; font-weight:600; color:#111827; }
.tx-sub { font-size:11px; color:#6b7280; }
.tx-meta { font-size:10px; color:#9ca3af; }
.tx-rev { font-size:11px; color:#374151; font-weight:600; align-self:center; text-align:right; }

/* ---------- section helper ---------- */
.ddp-section { margin-bottom:14px; padding:8px 4px; }
.ddp-section .ddp-h { font-size:12px; color:#374151; font-weight:700; margin:0 0 6px 0; }
.ddp-actions { display:flex; gap:6px; }
.ddp-btn { padding:6px 10px; border:1px solid #d1d5db; background:#fff; border-radius:6px; font-size:12px; cursor:pointer; }
.ddp-btn:hover { background:#f3f4f6; }

/* ---------- attachments (Agent2) ---------- */
.att-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:8px; }
.att-empty { padding:14px; text-align:center; color:#9ca3af; font-size:12px; background:#f9fafb; border-radius:8px; }
.att-card { border:1px solid #e5e7eb; border-radius:8px; padding:8px; background:#fff; cursor:pointer; user-select:none; transition:transform .1s, box-shadow .1s; }
.att-card:hover { box-shadow:0 2px 6px rgba(0,0,0,.08); transform:translateY(-1px); }
.att-card:focus { outline:2px solid #2563eb; }
.att-icon { font-size:28px; text-align:center; margin-bottom:4px; }
.att-name { font-size:11px; color:#111827; font-weight:600; text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-bottom:3px; }
.att-meta { display:flex; justify-content:space-between; font-size:10px; color:#6b7280; }
.att-foot { display:flex; justify-content:space-between; align-items:center; margin-top:4px; font-size:10px; }
.att-kind { color:#fff; padding:1px 6px; border-radius:4px; font-weight:600; }
.att-size { color:#9ca3af; }
.drop-on { outline:2px dashed #2563eb; outline-offset:4px; background:#eff6ff; }
.att-hint { color:#9ca3af; font-size:11px; margin-top:6px; padding:6px; background:#f9fafb; border-radius:6px; }
.att-actions { display:flex; gap:6px; margin-top:8px; flex-wrap:wrap; }
.att-actions button { padding:5px 10px; border:1px solid #d1d5db; background:#fff; border-radius:6px; font-size:11px; cursor:pointer; }
.att-actions button:hover { background:#f3f4f6; }
.att-toast { position:fixed; bottom:24px; right:24px; padding:10px 16px; background:#111827; color:#fff; border-radius:8px; font-size:12px; box-shadow:0 4px 12px rgba(0,0,0,.3); z-index:9999; transition:opacity .3s; }
.att-toast.success { background:#16a34a; }
.att-toast.error { background:#dc2626; }

/* ---------- multitenancy (Agent3) ---------- */
.sf-multi-menu, .sf-edit-menu { display:flex; gap:6px; padding:6px 8px; background:#f9fafb; border-bottom:1px solid #e5e7eb; flex-wrap:wrap; }
.sf-mbtn { padding:5px 10px; border:1px solid #d1d5db; background:#fff; border-radius:6px; font-size:12px; cursor:pointer; }
.sf-mbtn:hover { background:#eff6ff; border-color:#2563eb; color:#2563eb; }
.sf-dialog.wide { width:760px; max-width:95vw; }
.sf-form-row { display:flex; gap:6px; margin:6px 0; align-items:center; }
.sf-form-row input, .sf-form-row select { padding:6px; border:1px solid #d1d5db; border-radius:6px; font-size:12px; flex:1; }
.sf-mini { padding:3px 8px; font-size:11px; border:1px solid #d1d5db; background:#fff; border-radius:4px; cursor:pointer; }
.sf-mini:hover { background:#fee2e2; color:#dc2626; }
.sf-tv-result { margin:10px 0; padding:10px; background:#eff6ff; border-radius:8px; font-size:12px; }
.sf-tv-result ul { margin:6px 0 0 18px; }
.sf-tv-tenants { padding:8px; background:#f9fafb; border-radius:8px; }
.sf-tv-tenants ul { margin:4px 0 0 18px; font-size:12px; }
.sf-xl-log { margin-top:8px; padding:8px; background:#f9fafb; border-radius:6px; font-size:12px; min-height:24px; }
.sf-xl-log .ok { color:#16a34a; }
.sf-xl-log .err { color:#dc2626; }
.sf-btn { padding:6px 12px; border:1px solid #d1d5db; background:#fff; border-radius:6px; font-size:12px; cursor:pointer; text-decoration:none; color:#111827; display:inline-block; }
.sf-btn:hover { background:#eff6ff; border-color:#2563eb; }

/* ---------- editflow (Agent4) ---------- */
.sf-fr-preview { margin:10px 0; max-height:300px; overflow:auto; }
.conf { padding:1px 6px; border-radius:4px; font-size:10px; font-weight:600; margin-left:4px; }
.conf.high { background:#d1fae5; color:#065f46; }
.conf.medium { background:#fef3c7; color:#92400e; }
.conf.low { background:#fee2e2; color:#991b1b; }
.conf.resolved { background:#dbeafe; color:#1e40af; }
tr.dragging { opacity:.5; }
tr.drop-over { background:#eff6ff; }
