/* BidSense 공유 스타일 — 전 화면 공통 (화면작성규칙_프로젝트_v1.md P4)
   이 파일 수정은 공통 G2(별도 작업 + 전 화면 재캡처) — 목업 저작 중 고치지 않는다. */

@font-face {
  font-family: 'Pretendard';
  font-weight: 400;
  font-display: swap;
  src: local('Pretendard Regular'), local('Pretendard');
}

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #1a1d21;
  --text-muted: #6b7280;
  --primary: #2563eb;
  --primary-bg: #eff4ff;
  --ok: #16a34a;
  --ok-bg: #ecfdf3;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --warn-border: #fcd9a4;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --sidebar-bg: #1f2937;
  --sidebar-fg: #e5e7eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Pretendard', -apple-system, 'Malgun Gothic', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* ── 셸 (P2: 단일 역할이라 사이드바 한 벌) ───────────────── */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 208px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  padding: 20px 0;
}
.sidebar .brand {
  font-size: 17px;
  font-weight: 700;
  padding: 0 20px 18px;
  letter-spacing: -0.3px;
}
.sidebar .nav-group { margin-bottom: 18px; }
.sidebar .nav-group-label {
  font-size: 11px;
  color: #9ca3af;
  padding: 0 20px 6px;
  letter-spacing: 0.5px;
}
.sidebar a {
  display: block;
  padding: 8px 20px;
  color: var(--sidebar-fg);
  text-decoration: none;
  font-size: 13.5px;
}
.sidebar a:hover { background: rgba(255, 255, 255, 0.06); }
.sidebar a.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.main { flex: 1; padding: 24px 28px; min-width: 0; }

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.page-head h1 { font-size: 21px; margin: 0; letter-spacing: -0.4px; }
.page-head .sub { color: var(--text-muted); font-size: 13px; }

/* ── 카드·패널 ────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
}
.card + .card { margin-top: 14px; }

/* ── 배치 상태 줄 (FN-018) ────────────────────────────── */
.batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.batch-bar.has-fail { background: var(--warn-bg); border-color: #fcd9a4; }
.batch-bar .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); flex-shrink: 0;
}
.batch-bar.has-fail .dot { background: var(--warn); }
.batch-bar .spacer { flex: 1; }

/* ── 테이블 ──────────────────────────────────────────── */
table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.list td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.list tr:last-child td { border-bottom: none; }
table.list tr:hover td { background: #fafbfc; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.title-cell a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.title-cell a:hover { color: var(--primary); text-decoration: underline; }
.title-cell .meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── 판정 배지 (RULE-001 3단계 — 색만으로 구분하지 않고 기호 병기) ── */
.verdict {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.verdict.cond { background: var(--warn-bg); color: var(--warn); }
.verdict.no { background: var(--danger-bg); color: var(--danger); }
.verdict.none { background: #f3f4f6; color: var(--text-muted); }

/* ── 일반 배지·태그 ──────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11.5px;
  background: var(--primary-bg);
  color: var(--primary);
  white-space: nowrap;
}
.tag.plain { background: #f3f4f6; color: var(--text-muted); }
.tag.fix { background: var(--warn-bg); color: var(--warn); }

.state {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.state.watch { color: var(--primary); font-weight: 600; }
.state.drop { color: var(--text-muted); text-decoration: line-through; }

/* 마감 임박 */
.dday { font-weight: 600; }
.dday.near { color: var(--danger); }

/* ── 필터 바 ─────────────────────────────────────────── */
.filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.chip {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
}
.chip.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ── 폼 ──────────────────────────────────────────────── */
input[type="text"], input[type="search"], input[type="password"],
input[type="date"], input[type="email"], input[type="number"],
select, textarea {
  font-family: inherit;
  font-size: 13.5px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
textarea { width: 100%; resize: vertical; }
.btn {
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--text);
}
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ── 빈 상태 (RULE-016: 입력 3종이 비어도 오류 없이 안내) ── */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty .big { font-size: 15px; color: var(--text); margin-bottom: 6px; font-weight: 600; }

/* ── 콜아웃 마커 (목업 전용 — 캡처 시 좌표 기준점) ────── */
[data-callout] { position: relative; }

/* ── 툴팁 ────────────────────────────────────────────
   브라우저 기본 title은 1초쯤 늦게 뜨고 스타일이 없다. 삭제처럼
   되돌리기 어려운 버튼은 누르기 전에 무엇이 지워지는지 바로 보여야 한다. */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 5px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s;
  pointer-events: none;    /* 툴팁이 마우스를 가로채면 깜빡인다 */
  z-index: 30;
}
[data-tip]::before {       /* 꼬리 */
  content: "";
  position: absolute;
  bottom: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1f2937;
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s;
  pointer-events: none;
  z-index: 30;
}
[data-tip]:hover::after,
[data-tip]:hover::before,
[data-tip]:focus-visible::after,
[data-tip]:focus-visible::before { opacity: 1; visibility: visible; }

/* 위쪽에 자리가 없을 때 — 아래로 띄운다 */
[data-tip].tip-down::after {
  bottom: auto;
  top: calc(100% + 6px);
}
[data-tip].tip-down::before {
  bottom: auto;
  top: calc(100% + 1px);
  border-top-color: transparent;
  border-bottom-color: #1f2937;
}
