/* ============================================================
   weCar 사전검수 — Design System v2
   HeyDealer 스타일 참고, weCar 브랜드 컬러 적용
   Mobile-First Responsive
   ============================================================ */

/* ── 브랜드 컬러 & 디자인 토큰 ──────────────────────────── */
:root {
  --primary:        #c41e3a;
  --primary-hover:  #a8172f;
  --primary-light:  #fff0f2;
  --primary-ring:   rgba(196,30,58,.18);

  --dark-nav:       #16181c;
  --surface:        #f4f6f8;
  --card:           #ffffff;
  --border:         #e5e8ed;
  --border-subtle:  rgba(0,0,0,.06);

  --text-strong:    #111317;
  --text-base:      #2d3340;
  --text-muted:     #6b7484;
  --text-light:     #9aa0af;

  --radius-xs:  4px;
  --radius-sm:  8px;
  --radius:     12px;
  --radius-lg:  16px;
  --radius-xl:  20px;

  --shadow-xs:  0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:  0 2px 6px rgba(0,0,0,.07);
  --shadow:     0 4px 16px rgba(0,0,0,.08);
  --shadow-md:  0 8px 28px rgba(0,0,0,.10);

  --transition: all .18s ease;
}

/* ── 기본 리셋 & 타이포그래피 ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: "Pretendard Variable", "Pretendard", -apple-system,
               BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR",
               Roboto, sans-serif;
  background: var(--surface);
  color: var(--text-base);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1,h2,h3,h4,h5,h6 {
  color: var(--text-strong);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── 내비게이션 ─────────────────────────────────────────── */
.navbar-wecar {
  background: var(--dark-nav) !important;
  padding: 0;
  min-height: 56px;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
  position: sticky;
  top: 0;
  z-index: 1030;
}
.navbar-wecar .container-fluid { padding: 0 1rem; }

.navbar-wecar .navbar-brand {
  padding: 0.6rem 0;
  margin-right: 1.5rem;
}
.navbar-wecar .navbar-brand img {
  height: 32px;
  width: auto;
}

.navbar-wecar .nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,.78) !important;
  padding: 0.45rem 0.7rem !important;
  border-radius: var(--radius-xs);
  transition: var(--transition);
  white-space: nowrap;
}
.navbar-wecar .nav-link:hover,
.navbar-wecar .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,.1);
}

.navbar-wecar .navbar-text {
  color: rgba(255,255,255,.55);
  font-size: 0.8125rem;
  margin-right: 0.75rem;
}

.navbar-wecar .btn-outline-light {
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.9rem;
}

.navbar-toggler { border: none; padding: 0.4rem; }
.navbar-toggler:focus { box-shadow: none; }

/* ── 메인 레이아웃 ──────────────────────────────────────── */
main.container {
  max-width: 1400px;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

@media (max-width: 767px) {
  main.container { padding: 1rem 0.75rem 2.5rem; }
}

/* ── 플래시 메세지 ──────────────────────────────────────── */
.alert {
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.75rem 1rem;
}

/* ── 버튼 ─────────────────────────────────────────────── */
.btn {
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  min-height: 40px;
}
.btn-sm { min-height: 32px; font-size: 0.8125rem; }
.btn-lg { min-height: 52px; font-size: 1rem; }

/* weCar 브랜드 버튼 */
.btn-wecar {
  background: var(--primary);
  color: #fff !important;
  border: none;
  box-shadow: 0 2px 8px rgba(196,30,58,.25);
}
.btn-wecar:hover, .btn-wecar:focus-visible {
  background: var(--primary-hover);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(196,30,58,.35);
  transform: translateY(-1px);
}
.btn-wecar:active { transform: none; box-shadow: none; }
.btn-wecar:focus { box-shadow: 0 0 0 3px var(--primary-ring); }

/* 아웃라인 버튼 */
.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* ── 카드 ─────────────────────────────────────────────── */
.card, .card-modern {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: box-shadow .2s;
}
.card-modern:hover { box-shadow: var(--shadow-sm); }
.card .card-header {
  background: #f8f9fb;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius) var(--radius) 0 0;
}

/* ── 대시보드 통계 카드 ──────────────────────────────────── */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 1.5rem;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 0.375rem;
}
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1;
  letter-spacing: -0.03em;
}

/* ── 테이블 ─────────────────────────────────────────────── */
.table-modern {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.table-modern thead th {
  background: #f1f4f8;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table-modern tbody td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-color: var(--border-subtle);
  font-size: 0.9rem;
}
.table-modern tbody tr { transition: background .12s; }
.table-modern tbody tr:hover { background: #f8fafc; }

/* 일반 테이블 */
.table thead th {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}
.table tbody td { font-size: 0.875rem; vertical-align: middle; }

/* ── 배지 ─────────────────────────────────────────────── */
.badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 0.3em 0.7em;
}

/* 상태 배지 커스텀 */
.status-badge-requested  { background:#e8f4fd; color:#1976d2; border:1px solid #bbdefb; }
.status-badge-inprogress { background:#fff8e1; color:#f57c00; border:1px solid #ffe082; }
.status-badge-completed  { background:#e8f5e9; color:#2e7d32; border:1px solid #a5d6a7; }

/* ── 폼 요소 ─────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

/* 모바일에서 터치 영역 확보 */
@media (max-width: 767px) {
  .form-control, .form-select, .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .form-control-sm, .form-select-sm { min-height: 38px; }
}

/* ── 로그인/회원가입 ─────────────────────────────────────── */
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.auth-card .card-body { padding: 2.5rem; }
.auth-card .logo-wrap { margin-bottom: 1.75rem; }
.auth-card .logo-wrap img { height: 44px; width: auto; }

@media (max-width: 575px) {
  .auth-card .card-body { padding: 1.75rem 1.25rem; }
}

/* ── 페이지 제목 ─────────────────────────────────────────── */
.page-title {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-strong);
  margin-bottom: 1.25rem;
}

/* ── 평가진행 카드 레이아웃 (모바일/태블릿) ─────────────── */
.insp-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  margin-bottom: 1rem;
  overflow: hidden;
}
.insp-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: #f8f9fb;
  border-bottom: 1px solid var(--border);
}
.insp-card-code {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2em 0.6em;
  white-space: nowrap;
}
.insp-card-title { font-weight: 700; font-size: 0.95rem; color: var(--text-strong); }
.insp-card-sub   { font-size: 0.8rem; color: var(--text-muted); }
.insp-card-body  { padding: 1rem; }
.insp-card-body .mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2em 0.6em;
}

/* 샘플 이미지 */
.sample-thumb {
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: zoom-in;
}
.sample-thumb-sm {
  max-width: 120px;
  max-height: 88px;
  object-fit: contain;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  cursor: zoom-in;
}

/* 업로드 미리보기 */
.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.photo-grid img {
  height: 72px;
  width: 72px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

/* ── 섹션 구분선 ─────────────────────────────────────────── */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ── 모달 ─────────────────────────────────────────────── */
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
}
.modal-footer { border-top: 1px solid var(--border); }
.modal-title { font-weight: 700; font-size: 1rem; }

/* ── 반응형 테이블 → 카드 (general) ─────────────────────── */
@media (max-width: 767px) {
  .table-to-cards thead { display: none; }
  .table-to-cards tbody tr {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    padding: 0.25rem 0;
    box-shadow: var(--shadow-xs);
  }
  .table-to-cards tbody tr td {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border: none;
    font-size: 0.875rem;
  }
  .table-to-cards tbody tr td::before {
    content: attr(data-label);
    min-width: 72px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
    padding-top: 2px;
    flex-shrink: 0;
  }
  .table-to-cards tbody tr td:last-child { border-bottom: none; }
}

/* ── 스크롤바 개선 ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
