/* =============================================
   dealer.css — 딜러 대시보드 전용 스타일
   공통 style.css와 충돌 방지: 클래스명 d- 접두사 사용
   ============================================= */

/* ── 레이아웃 ─────────────────────────────── */
.dealer-wrap {
  display: flex;
  min-height: calc(100vh - 64px);
  background: #f9fafb;
}

.dealer-side {
  width: 200px;
  min-height: 100%;
  background: white;
  border-right: 1px solid #f0f0f0;
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.dealer-logo {
  font-size: 15px;
  font-weight: 800;
  padding: 0 8px 4px;
  color: #111827;
}

.dealer-name {
  font-size: 12px;
  color: #9ca3af;
  padding: 0 8px 14px;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 4px;
}

.dealer-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dnav-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  transition: background 0.15s;
  font-family: 'Noto Sans KR', sans-serif;
}
.dnav-btn:hover  { background: #f9fafb; color: #374151; }
.dnav-btn.active { background: #eff6ff; color: #4a9eff; font-weight: 600; }

.dealer-main {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

.dealer-section { max-width: 960px; }

.dealer-h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 20px;
  color: #111827;
}

.dealer-h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
  color: #374151;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-head .dealer-h2 { margin: 0; }

/* ── 통계 카드 ────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.stat-card {
  background: white;
  border: 1px solid #f0f0f0;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-label {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}

.stat-val {
  font-size: 30px;
  font-weight: 800;
  color: #111827;
}
.stat-val small {
  font-size: 13px;
  font-weight: 400;
  margin-left: 2px;
  color: #9ca3af;
}
.c-teal-val  { color: #0f766e; }
.c-amber-val { color: #d97706; }

/* ── 견적 목록 (홈) ───────────────────────── */
.quote-list { display: flex; flex-direction: column; gap: 10px; }

.quote-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: white;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 12px 16px;
  flex-wrap: wrap;
}

.quote-car  { font-weight: 700; min-width: 120px; font-size: 14px; }
.quote-info { flex: 1; display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: #374151; }
.quote-price { color: #4a9eff; font-weight: 600; }

/* ── 차량 테이블 ──────────────────────────── */
.car-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid #f0f0f0; }

.d-car-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: white;
}
.d-car-table th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 12px;
  color: #9ca3af;
  border-bottom: 1px solid #f3f4f6;
  white-space: nowrap;
}
.d-car-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f9fafb;
  color: #374151;
}
.d-car-table tr:last-child td { border-bottom: none; }
.d-car-table tr:hover td { background: #fafafa; }

/* ── 견적 카드 ────────────────────────────── */
.quote-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.quote-card {
  background: white;
  border: 1px solid #f0f0f0;
  border-radius: 14px;
  padding: 18px;
}

.qc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.qc-car   { font-weight: 700; font-size: 14px; }
.qc-body  { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #374151; margin-bottom: 14px; }
.qc-actions { display: flex; gap: 8px; }

/* ── 지도 영역 ────────────────────────────── */
.map-placeholder {
  background: white;
  border: 1px solid #f0f0f0;
  border-radius: 14px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.map-overlay-text { text-align: center; }

.location-list { display: flex; flex-direction: column; gap: 10px; }

.loc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 12px 16px;
}

.loc-pin {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.loc-pin.available   { background: #10b981; }
.loc-pin.rented      { background: #3b82f6; }
.loc-pin.maintenance { background: #f59e0b; }

/* ── 딜러 모달 ────────────────────────────── */
.d-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.d-modal-box {
  background: white;
  border-radius: 16px;
  padding: 28px;
  width: 500px;
  max-width: 94vw;
  max-height: 88vh;
  overflow-y: auto;
}

.d-modal-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 20px;
  color: #111827;
}

.d-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.d-form-field { display: flex; flex-direction: column; gap: 5px; }
.d-form-field label { font-size: 12px; color: #6b7280; font-weight: 500; }
.d-form-field input,
.d-form-field select {
  padding: 9px 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  color: #111827;
  font-family: 'Noto Sans KR', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.d-form-field input:focus,
.d-form-field select:focus { border-color: #4a9eff; }

.d-form-full { grid-column: 1 / -1; }

.d-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ── 공통 버튼 (d- 접두사로 style.css와 분리) */
.d-btn-primary {
  background: #111827;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  transition: opacity 0.15s;
}
.d-btn-primary:hover { opacity: 0.8; }

.d-btn-outline {
  background: white;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  cursor: pointer;
  color: #374151;
  font-family: 'Noto Sans KR', sans-serif;
  text-decoration: none;
  transition: background 0.15s;
}
.d-btn-outline:hover { background: #f9fafb; }

.d-btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }

.d-btn-danger {
  background: white;
  border: 1.5px solid #fecaca;
  color: #dc2626;
}
.d-btn-danger:hover { background: #fef2f2; }

/* ── 배지 ────────────────────────────────── */
.d-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
}
.d-badge-pending     { background: #fef3c7; color: #d97706; }
.d-badge-accepted    { background: #dcfce7; color: #16a34a; }
.d-badge-rejected    { background: #fee2e2; color: #dc2626; }
.d-badge-available   { background: #dcfce7; color: #16a34a; }
.d-badge-rented      { background: #dbeafe; color: #2563eb; }
.d-badge-maintenance { background: #fef3c7; color: #d97706; }

/* ── 헤더 딜러 버튼 ───────────────────────── */
.btn-dealer-center {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #4a9eff;
  color: white !important;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn-dealer-center:hover { opacity: 0.85; }

/* ── 유틸 ────────────────────────────────── */
.loading-spin { padding: 60px; text-align: center; color: #9ca3af; font-size: 14px; }
.empty-msg    { color: #9ca3af; padding: 40px 0; text-align: center; font-size: 14px; line-height: 1.8; }
.muted        { color: #9ca3af; }

/* ── 반응형 ──────────────────────────────── */
@media (max-width: 768px) {
  .dealer-wrap { flex-direction: column; }
  .dealer-side {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid #f0f0f0;
  }
  .dealer-nav { flex-direction: row; flex-wrap: wrap; }
  .dnav-btn   { width: auto; font-size: 12px; padding: 8px 10px; }
  .dealer-main { padding: 16px; }
  .d-form-grid { grid-template-columns: 1fr; }
  .stat-grid  { grid-template-columns: repeat(2, 1fr); }
}

/* =============================================
   dealer.css v2 추가 스타일 — 입점사 대시보드 고도화
   ============================================= */

/* ── 오늘의 현황 카운터 ─────────────────────── */
.today-counter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.today-counter-card {
  background: white;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.today-counter-card:hover {
  border-color: #4a9eff;
  box-shadow: 0 2px 8px rgba(27,94,191,0.1);
}

.today-counter-val {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}

.today-counter-label {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}

/* ── 스케줄 목록 ─────────────────────────────── */
.schedule-list { display: flex; flex-direction: column; gap: 8px; }

.schedule-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  padding: 12px 16px;
  transition: border-color 0.15s;
}
.schedule-row:hover { border-color: #d1d5db; }
.schedule-row.schedule-urgent { border-left: 3px solid #f59e0b; background: #fffbeb; }

.schedule-icon { font-size: 20px; flex-shrink: 0; }

.schedule-info { flex: 1; }
.schedule-title { font-size: 14px; font-weight: 600; color: #111827; }
.schedule-sub   { font-size: 12px; color: #9ca3af; margin-top: 2px; }

.schedule-date {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

/* ── 필터 버튼 ────────────────────────────────── */
.d-filter-btn {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid #e4e4e7;
  background: white;
  color: #374151;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 500;
  transition: all 0.15s;
}
.d-filter-btn:hover  { background: #f4f4f5; }
.d-filter-btn.active { background: #4a9eff; color: white; border-color: #4a9eff; }

/* ── 정산 요약 카드 ───────────────────────────── */
.settlement-summary {
  background: white;
  border: 1px solid #f0f0f0;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  max-width: 480px;
}

.settlement-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f9fafb;
  font-size: 14px;
}
.settlement-row span  { color: #6b7280; }
.settlement-row strong { font-weight: 600; color: #111827; }

.settlement-total {
  border-bottom: 2px solid #111827;
  margin-top: 4px;
  padding-top: 12px;
}
.settlement-total strong { font-size: 18px; }

.settlement-status {
  text-align: right;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
}

/* ── 반응형 ──────────────────────────────────── */
@media (max-width: 768px) {
  .today-counter-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .today-counter-card { padding: 12px 6px; }
  .today-counter-val  { font-size: 22px; }
}
@media (max-width: 480px) {
  .today-counter-grid { grid-template-columns: repeat(4, 1fr); }
  .today-counter-val  { font-size: 18px; }
}

/* =============================================
   시동 제어 탭 스타일
   ============================================= */

.engine-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border: 1px solid #f0f0f0;
  border-radius: 14px;
  padding: 18px 22px;
  gap: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.engine-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.engine-car-info { flex: 1; }
.engine-car-name {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
}
.engine-car-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.engine-control {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.engine-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.engine-status.engine-on  { background: #dcfce7; color: #16a34a; }
.engine-status.engine-off { background: #f4f4f5; color: #71717a; }

.engine-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.engine-on  .engine-status-dot { background: #16a34a; animation: pulse-green 1.5s infinite; }
.engine-off .engine-status-dot { background: #9ca3af; }

@keyframes pulse-green {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.3); }
}

.engine-toggle-btn {
  padding: 9px 20px;
  border-radius: 10px;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  transition: all 0.15s;
  white-space: nowrap;
}
.engine-btn-off {
  background: #16a34a;
  color: white;
}
.engine-btn-off:hover { background: #15803d; transform: scale(1.03); }

.engine-btn-on {
  background: #dc2626;
  color: white;
}
.engine-btn-on:hover { background: #b91c1c; transform: scale(1.03); }

@media (max-width: 600px) {
  .engine-card    { flex-direction: column; align-items: flex-start; }
  .engine-control { width: 100%; justify-content: space-between; }
}

/* 시동 차단/해제 버튼 */
.engine-btn-block {
  background: #dc2626;
  color: white;
}
.engine-btn-block:hover { background: #b91c1c; transform: scale(1.03); }

.engine-btn-release {
  background: #16a34a;
  color: white;
}
.engine-btn-release:hover { background: #15803d; transform: scale(1.03); }

/* 차량번호 배지 */
.car-number-badge {
  background: #0d1b2a;
  color: white;
  padding: 3px 8px;
  border-radius: 5px;
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

/* 차량 목록 행 hover */
.d-car-table tbody tr:hover { background: #f8faff; }

/* ── 메뉴 그룹 레이블 */
.dnav-group-label {
  font-size: 10px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 16px 4px;
  margin-top: 4px;
}
