/* AUSFAHRT 검색기 웹 — v23 톤 차용 */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Malgun Gothic', '맑은 고딕', system-ui, sans-serif;
  background: #f4f5f7;
  color: #1f2937;
  font-size: 14px;
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

h1 { margin: 0; font-size: 20px; color: #6b7280; font-weight: 500; }
h1 .subtitle { color: #111827; font-weight: 700; margin-left: 8px; }
.version { color: #9ca3af; font-size: 11px; }

.search-bar {
  padding: 18px 24px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-bar input {
  flex: 1;
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
}

.search-bar input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px #dbeafe; }

.htmx-indicator { color: #9ca3af; font-size: 12px; opacity: 0; transition: opacity 0.2s; }
.htmx-request .htmx-indicator { opacity: 1; }

main { padding: 18px 24px; max-width: 1400px; margin: 0 auto; }

.hint, .empty {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
  font-size: 14px;
}

.result-summary {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #4b5563;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 4px;
  background: #dbeafe;
  color: #1e40af;
  font-weight: 600;
}
.tag.fail { background: #fee2e2; color: #991b1b; }
.count { color: #6b7280; font-size: 12px; }

.esa-card {
  background: #fff;
  padding: 16px 20px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 14px;
}
.esa-code { font-family: 'Consolas', monospace; font-size: 18px; font-weight: 700; }
.esa-name { color: #1f2937; margin-top: 4px; }
.esa-meta { color: #6b7280; font-size: 12px; margin-top: 4px; }

.vehicle {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.vehicle-head {
  padding: 12px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.vehicle-title { display: flex; gap: 10px; align-items: baseline; }
.vehicle-title .maker { font-weight: 700; color: #111827; font-size: 15px; }
.vehicle-title .series { color: #374151; font-size: 14px; }
.vehicle-title .model { color: #6b7280; font-size: 13px; }

.vehicle-meta { display: flex; gap: 10px; color: #6b7280; font-size: 12px; }
.vehicle-meta .number {
  background: #fef3c7; color: #92400e;
  padding: 2px 6px; border-radius: 3px; font-weight: 600;
}

.parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1px;
  background: #e5e7eb;
}

.part {
  background: #fff;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.part.empty { background: #fafbfc; }

.part-label {
  font-size: 11px;
  color: #6b7280;
}
.part-code {
  font-family: 'Consolas', monospace;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}
.part.empty .part-code { color: #d1d5db; }

.part-stock { margin-top: 2px; }
.stock {
  display: inline-block;
  padding: 1px 6px;
  font-size: 11px;
  border-radius: 3px;
}
.stock.pending { background: #fef3c7; color: #78350f; }
.stock.unreg { background: #f3f4f6; color: #9ca3af; }
.stock.none { color: #d1d5db; }

.vehicle-foot {
  padding: 10px 16px;
  background: #fafbfc;
  border-top: 1px solid #e5e7eb;
  font-size: 12px;
}
.meta-row { display: flex; gap: 12px; padding: 2px 0; }
.meta-label { color: #9ca3af; min-width: 80px; }
.meta-val { color: #374151; }
.meta-val.mono { font-family: 'Consolas', monospace; }
.stock.zero { background: #fee2e2; color: #991b1b; }
.stock.low { background: #fef3c7; color: #92400e; font-weight: 600; }
.stock.ok { background: #d1fae5; color: #065f46; font-weight: 600; }

/* VAG 브레이크 매칭 배지 */
.brake-src { margin-top: 2px; }
.brake-badge { font-size: 11px; padding: 1px 6px; border-radius: 8px; }
.brake-badge.direct { background: #dcfce7; color: #166534; }
.brake-badge.borrow { background: #fef3c7; color: #92400e; }
.brake-badge.multi  { background: #fef3c7; color: #92400e; }
/* 조건부 사양(M Sport/M Performance 근거뿐) 표기 — 원문은 title 툴팁.
   ★실제 검색화면은 admin.css 를 로드한다(여기는 동기화용 사본). */
.brake-badge.cond-warn { background: #dc2626; color: #fff; font-weight: 700;
                         margin-left: 4px; cursor: help; }
.pick-one { font-size: 10px; color: #6b7280; margin-left: 4px; }
.unit-qty { font-size: 10px; color: #6b7280; font-weight: 600; margin-left: 2px; }