/* 낙찰·매매사례 분석 Web — 컴팩트 업무용 UI */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f4f6f8; --panel: #fff; --line: #d9dee3; --txt: #222;
  --sub: #667; --accent: #1a6fc4; --accent2: #0d8a4f; --warn: #c0392b;
}
body {
  font-family: "Malgun Gothic", "맑은 고딕", sans-serif;
  font-size: 13px; color: var(--txt); background: var(--bg);
}
button {
  font: inherit; padding: 5px 12px; border: 1px solid var(--line);
  border-radius: 4px; background: #fff; cursor: pointer;
}
button:hover { background: #eef3f8; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #135a9f; }
button.run { background: var(--accent2); border-color: var(--accent2); color: #fff; font-weight: bold; }
button.run:hover { background: #0a6e3f; }
input[type=text], input[type=password], select, textarea {
  font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bcd6ef; }

/* ---- 로그인 오버레이 ---- */
#loginOverlay {
  position: fixed; inset: 0; background: #2c3e50; z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
#loginOverlay .box {
  background: #fff; padding: 36px 44px; border-radius: 10px; text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.4); min-width: 320px;
}
#loginOverlay h1 { font-size: 18px; margin-bottom: 6px; }
#loginOverlay p { color: var(--sub); margin-bottom: 18px; font-size: 12px; }
#loginOverlay input { width: 100%; margin-bottom: 10px; padding: 9px; }
#loginOverlay button { width: 100%; padding: 9px; }
#loginErr { color: var(--warn); font-size: 12px; margin-top: 10px; min-height: 16px; }

/* ---- 헤더 ---- */
header {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 8px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
header .title { font-weight: bold; font-size: 15px; margin-right: 8px; }
header .a1 { display: flex; align-items: center; gap: 6px; }
header input { width: 130px; }
#a1Status { font-size: 12px; padding: 3px 10px; border-radius: 10px; background: #eee; }
#a1Status.ok { background: #d9f2e4; color: #0a6e3f; }
#a1Status.starting { background: #fdf3d7; color: #8a6d1a; }
#a1Status.fail { background: #fde3df; color: var(--warn); }
header .right { margin-left: auto; color: var(--sub); font-size: 12px; display:flex; gap:10px; align-items:center; }

/* ---- 탭 ---- */
nav.tabs { display: flex; gap: 4px; padding: 8px 14px 0; }
nav.tabs button {
  border-radius: 6px 6px 0 0; border-bottom: none; padding: 7px 18px; background: #e6eaee;
}
nav.tabs button.active { background: #fff; font-weight: bold; color: var(--accent); }
main { padding: 0 14px 14px; }
.tabpane { display: none; background: var(--panel); border: 1px solid var(--line); border-radius: 0 6px 6px 6px; padding: 10px; }
.tabpane.active { display: block; }

.panel { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; background: #fff; }
.panel > .cap {
  padding: 5px 10px; font-weight: bold; background: #f0f3f6;
  border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0;
  display: flex; align-items: center; gap: 8px; font-size: 12.5px;
}
.panel > .cap .sub { font-weight: normal; color: var(--sub); }
.panel > .body { padding: 8px 10px; }

/* ---- DD 트리 + 본건 ---- */
#ddWrap { display: flex; gap: 8px; }
#ddPanel { flex: 1 1 auto; min-width: 0; }
#subjectPanel { flex: 0 0 300px; }
#ddTable-wrap, .tbl-wrap { overflow: auto; }
#ddTable-wrap { max-height: 218px; }
table.grid { border-collapse: collapse; width: 100%; white-space: nowrap; }
table.grid th, table.grid td {
  border: 1px solid #e3e7ec; padding: 3px 7px; font-size: 12px; text-align: left;
}
table.grid th { background: #f6f8fa; position: sticky; top: 0; z-index: 1; }
table.grid td.num { text-align: right; }
table.grid tr.click { cursor: pointer; }
table.grid tr.click:hover { background: #eef5fd; }
table.grid tr.sel { background: #dcebfb; }
table.grid tr.marked td { background: #ececec; color: #999; }
table.grid tr.jibun td { color: #567; background: #fafcff; }
#subjectPanel dl { font-size: 12px; }
#subjectPanel dt { float: left; width: 88px; color: var(--sub); clear: left; padding: 1px 0; }
#subjectPanel dd { margin-left: 92px; padding: 1px 0; word-break: break-all; min-height: 15px; }

/* ---- 검색/결과 ---- */
.searchbar { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.searchbar input[type=text] { flex: 1 1 300px; }
#resultsWrap { max-height: 300px; }
.pagebar { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.pagebar .info { color: var(--sub); font-size: 12px; }
.pagebar .mid { margin: 0 auto; }

/* ---- 선택 목록 ---- */
#selWrap { max-height: 220px; }

/* ---- 매매사례 ---- */
.salesRow {
  display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap;
}
.salesRow .idx { width: 52px; color: var(--sub); }
.salesRow input.addr { flex: 1 1 320px; }
.salesRow .pdfname { color: var(--sub); font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* ---- 로그/파일 ---- */
#bottomWrap { display: flex; gap: 8px; margin-top: 8px; }
#logPanel { flex: 1 1 auto; min-width: 0; }
#log {
  height: 150px; overflow: auto; font: 11.5px/1.5 Consolas, monospace;
  background: #1d2429; color: #cfe3d8; padding: 8px; border-radius: 0 0 6px 6px;
  white-space: pre-wrap; word-break: break-all;
}
#filesPanel { flex: 0 0 360px; }
#filesList { max-height: 150px; overflow: auto; font-size: 12px; }
#filesList a { color: var(--accent); text-decoration: none; }
#filesList a:hover { text-decoration: underline; }
#filesList .meta { color: var(--sub); margin-left: 6px; }
#jobsLine { font-size: 12px; color: var(--sub); padding: 4px 2px; }
.job-running { color: #8a6d1a; }
.job-done { color: #0a6e3f; }
.job-error { color: var(--warn); }

/* ---- 모달 ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; display: none; align-items: center; justify-content: center; }
.modal-bg.show { display: flex; }
.modal { background: #fff; border-radius: 8px; padding: 18px; min-width: 420px; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.modal h3 { margin-bottom: 10px; font-size: 14px; }
.modal textarea { width: 100%; height: 160px; }
.modal .btns { margin-top: 10px; display: flex; gap: 8px; justify-content: flex-end; }
