/* ==========================================================================
   CarView - Ultra High-End Responsive Design System (PC & Mobile Optimized)
   다크/라이트 테마, 글래스모피즘, 인쇄 최적화 및 고해상도 UI
   ========================================================================== */

/* 1. 디자인 토큰 및 CSS 커스텀 속성 */
:root {
  /* 라이트 테마 변수 (기본 팔레트) */
  --bg-body: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-elevated: #162238;
  --bg-card: rgba(17, 24, 39, 0.78);
  --bg-card-hover: rgba(22, 34, 56, 0.92);
  --bg-glass: rgba(17, 24, 39, 0.85);
  --bg-input: rgba(11, 15, 25, 0.85);
  --bg-pill: rgba(255, 255, 255, 0.06);

  /* 보더 & 구분선 */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-glow: rgba(59, 130, 246, 0.35);

  /* 텍스트 색상 */
  --text-main: #f9fafb;
  --text-sub: #9ca3af;
  --text-muted: #6b7280;
  --text-dim: #4b5563;

  /* 테마 액센트 컬러 */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);

  --gold: #f59e0b;
  --gold-gradient: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  
  --emerald: #10b981;
  --emerald-hover: #059669;
  --emerald-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);

  --purple: #8b5cf6;
  --purple-gradient: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);

  --rose: #f43f5e;
  --amber: #f59e0b;
  --cyan: #06b6d4;

  /* 그림자 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.45);
  --shadow-glow-gold: 0 0 24px rgba(245, 158, 11, 0.25);
  --shadow-glow-blue: 0 0 24px rgba(59, 130, 246, 0.25);

  /* 라운딩 */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;

  /* 전환 */
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.12s ease;

  /* 폰트 */
  --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  --font-numeric: 'Outfit', 'Pretendard', sans-serif;
}

/* 라이트 테마 오버라이드 */
[data-theme="light"] {
  --bg-body: #f4f6fb;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-glass: rgba(255, 255, 255, 0.92);
  --bg-input: #ffffff;
  --bg-pill: rgba(0, 0, 0, 0.05);

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.14);
  --border-glow: rgba(59, 130, 246, 0.3);

  --text-main: #0f172a;
  --text-sub: #475569;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.12);
}

/* 2. 전역 리셋 & 기본 세팅 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100%;
  width: 100%;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 숫자/금액 전용 타이포그래피 */
.kpi-value, .sum-val, .sum-val-total, .price-number, .unit-text, .tab-count, .table-price {
  font-family: var(--font-numeric);
  letter-spacing: -0.01em;
}

/* 3. 앰비언트 글로우 배경 */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
}

[data-theme="light"] .ambient-glow {
  opacity: 0.07;
}

.glow-top {
  top: -120px;
  right: -80px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, #3b82f6 0%, #8b5cf6 100%);
}

.glow-bottom {
  bottom: -150px;
  left: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #f59e0b 0%, #10b981 100%);
}

/* 4. 레이아웃 래퍼 */
.app-layout {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 90px; /* 모바일 하단바 여백 */
}

@media (min-width: 769px) {
  .app-layout {
    padding-bottom: 40px;
  }
}

/* 5. 상단 헤더 */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 20px;
  transition: var(--transition);
}

.header-container {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow-blue);
  flex-shrink: 0;
}

.brand-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title {
  font-family: var(--font-numeric);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 30%, #93c5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .brand-title {
  background: linear-gradient(135deg, #0f172a 30%, #1e40af 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--gold-gradient);
  color: #111827;
  letter-spacing: 0.05em;
}

.brand-desc {
  font-size: 0.82rem;
  color: var(--text-sub);
  margin-top: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 6. 공통 버튼 컴포넌트 */
.btn-primary, .btn-secondary, .btn-icon {
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  user-select: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
  font-size: 0.92rem;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.btn-secondary:hover {
  background: var(--border-medium);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-icon:hover {
  border-color: var(--border-medium);
  background: var(--border-medium);
}

/* 테마 토글 아이콘 제어 */
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* 7. 메인 콘텐츠 및 KPI 섹션 */
.app-main {
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
  flex: 1;
}

.kpi-section {
  margin-bottom: 24px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .kpi-card {
    padding: 10px 10px;
    border-radius: var(--radius-sm);
  }
  .kpi-card-header {
    margin-bottom: 6px;
  }
  .kpi-label {
    font-size: 0.72rem;
    line-height: 1.2;
  }
  .kpi-icon {
    width: 26px;
    height: 26px;
  }
  .kpi-icon svg {
    width: 14px;
    height: 14px;
  }
  .kpi-value-wrap {
    margin-bottom: 6px;
  }
  .kpi-value {
    font-size: 1.02rem;
    letter-spacing: -0.03em;
    white-space: nowrap;
    word-break: keep-all;
    line-height: 1.15;
  }
  .kpi-subtext {
    font-size: 0.7rem;
    margin-top: 2px;
    white-space: nowrap;
  }
  .kpi-half-profit-badge {
    font-size: 0.65rem;
    padding: 2px 5px;
    margin-top: 3px;
    white-space: nowrap;
  }
  .kpi-footer {
    padding-top: 6px;
    font-size: 0.68rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

/* 골드 하이라이트 카드 (총액) */
.kpi-card-highlight {
  border: 1px solid rgba(245, 158, 11, 0.4);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.08) 0%, var(--bg-card) 100%);
  box-shadow: var(--shadow-glow-gold);
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-label {
  font-size: 0.85rem;
  color: var(--text-sub);
  font-weight: 500;
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-gold { background: rgba(245, 158, 11, 0.15); color: var(--gold); }
.icon-blue { background: rgba(59, 130, 246, 0.15); color: var(--primary); }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }
.icon-purple { background: rgba(139, 92, 246, 0.15); color: var(--purple); }

.kpi-value-wrap {
  margin-bottom: 12px;
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-main);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.text-gradient-gold {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-emerald {
  color: var(--emerald) !important;
}

.kpi-subtext {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.kpi-half-profit-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  margin-top: 6px;
}

.kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-sub);
}

.kpi-badge {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-weight: 600;
}

.badge-primary {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

/* 8. 툴바 (검색, 필터, 정렬, 뷰 전환) */
.toolbar-section {
  margin-bottom: 24px;
}

.toolbar-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.search-input-wrap {
  position: relative;
  flex: 1 1 240px;
  min-width: 200px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 36px 0 40px;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 0.9rem;
}

/* 필터 탭 */
.filter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-sub);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.filter-tab:hover {
  background: var(--bg-pill);
  color: var(--text-main);
}

.filter-tab.active {
  background: var(--bg-surface-elevated);
  border-color: var(--border-medium);
  color: var(--text-main);
}

.tab-count {
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-pill);
  color: var(--text-muted);
}

.filter-tab.active .tab-count {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

/* 툴바 우측 제어부 */
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.select-wrap select {
  height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.select-wrap select:focus {
  border-color: var(--primary);
}

.view-switch-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.view-switch-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.view-switch-btn:hover:not(.active) {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.view-switch-btn.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}

.btn-text-muted {
  background: none;
  border: none;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  transition: var(--transition-fast);
}

.btn-text-muted:hover {
  color: var(--rose);
  background: rgba(244, 63, 94, 0.08);
}

/* 9. 차량 카드 그리드 (Card View) */
.vehicles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

@media (max-width: 480px) {
  .vehicles-grid {
    grid-template-columns: 1fr;
  }
}

.car-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.car-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

/* 카드 상단 헤더 */
.car-card-header {
  padding: 18px 20px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.015);
}

.car-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.car-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.car-name {
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* 상태 뱃지 */
.car-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.badge-hold { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-scrap { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-repair { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-sold { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }

.car-memo {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* 카드 헤더 액션 (수정/삭제 등) */
.car-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-card-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-card-action:hover {
  background: var(--bg-pill);
  color: var(--text-main);
}

.btn-card-action.btn-del:hover {
  color: var(--rose);
  background: rgba(244, 63, 94, 0.12);
}

/* 카드 바디 */
.car-card-body {
  padding: 16px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 차량 매입가 섹션 */
.base-price-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.base-price-label {
  font-size: 0.85rem;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 6px;
}

.base-price-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

/* 부대비용 상세 섹션 */
.expense-section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.expense-section-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-quick-add-expense {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

.btn-quick-add-expense:hover {
  background: rgba(59, 130, 246, 0.1);
}

/* 부대비용 아이템 태그/목록 */
.expense-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 40px;
}

.expense-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

.expense-row-item:hover {
  background: var(--bg-pill);
}

.expense-item-name {
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 6px;
}

.expense-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  display: inline-block;
}

.expense-item-val {
  font-family: var(--font-numeric);
  font-weight: 600;
  color: var(--emerald);
}

/* 비용 비율 바 */
.expense-ratio-bar-wrap {
  margin-top: 4px;
}

.ratio-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
}

.ratio-bar-base {
  background: var(--primary);
  height: 100%;
  transition: width 0.3s ease;
}

.ratio-bar-expense {
  background: var(--emerald);
  height: 100%;
  transition: width 0.3s ease;
}

.ratio-bar-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* 카드 하단 총합계 & 판매 순이익 (마진) */
.car-card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.025);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-total-label-wrap {
  display: flex;
  flex-direction: column;
}

.card-total-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.card-total-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.card-total-val-wrap {
  text-align: right;
}

.card-total-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1.15;
}

.card-total-korean {
  font-size: 0.76rem;
  color: var(--text-sub);
}

/* 판매금액 및 순이익 박스 */
.card-sale-profit-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sale-info-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sale-price-label {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.sale-price-val {
  font-family: var(--font-numeric);
  font-size: 1.05rem;
  font-weight: 700;
  color: #60a5fa;
}

.profit-info-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.profit-label {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.profit-badge-pill {
  font-family: var(--font-numeric);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.profit-pill-success {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.profit-pill-danger {
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.profit-pill-pending {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
}

.profit-half-pill {
  font-family: var(--font-numeric);
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  padding: 1px 7px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
}

.table-half-profit {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: #38bdf8;
  margin-top: 2px;
}

.sum-half {
  font-size: 0.74rem;
  font-weight: 700;
  color: #38bdf8;
  margin-top: 2px;
}

.text-blue {
  color: #60a5fa !important;
}

.highlight-sale {
  color: #60a5fa !important;
  font-weight: 700;
}

.badge-optional {
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* 10. 테이블 뷰 (PC 최적화 대형 표 형태) */
.table-container {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.vehicles-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.vehicles-table th, .vehicles-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.vehicles-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-sub);
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
}

.vehicles-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.text-right { text-align: right; }
.text-center { text-align: center; }

.highlight-col {
  font-weight: 700;
  color: var(--gold);
}

.table-expense-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 380px;
}

.table-expense-chip {
  font-size: 0.76rem;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-sub);
  white-space: nowrap;
}

.table-expense-chip strong {
  color: var(--emerald);
  font-weight: 600;
}

.vehicles-table tfoot td {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-main);
  border-top: 2px solid var(--border-medium);
}

/* 10-1. 목록형(컴팩트 리스트) 뷰 */
.vehicles-list-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.list-item-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  overflow: hidden;
}

.list-item-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: var(--shadow-md);
}

.list-item-card.is-expanded {
  border-color: var(--primary);
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.15);
}

.list-item-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
}

.list-item-header-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.list-item-main-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.list-item-index {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.list-item-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.list-item-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.list-item-metrics {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.list-metric-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 80px;
}

.list-metric-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.list-metric-val {
  font-size: 0.92rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
  white-space: nowrap;
}

.list-metric-profit {
  min-width: 110px;
}

.list-half-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 2px;
  white-space: nowrap;
}

.list-half-badge.positive {
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.list-half-badge.negative {
  color: var(--rose);
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.list-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.list-chevron {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  margin-left: 2px;
}

.list-item-card.is-expanded .list-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

/* 목록형 아코디언 드롭다운 (부대비용 및 상세) */
.list-item-detail {
  display: none;
  padding: 14px 16px 16px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  animation: fadeIn 0.2s ease-out;
}

.list-item-card.is-expanded .list-item-detail {
  display: block;
}

.list-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.list-detail-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.list-detail-box-title {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.list-detail-box-val {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.list-expense-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.list-expense-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.list-expense-chip strong {
  color: var(--emerald);
  font-weight: 700;
}

.list-detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}

/* 11. 빈 화면 (Empty State) */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  max-width: 520px;
  margin: 30px auto;
}

.empty-icon {
  color: var(--text-muted);
  margin-bottom: 14px;
}

.empty-title {
  font-size: 1.15rem;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 0.88rem;
  color: var(--text-sub);
  margin-bottom: 20px;
}

/* 12. 모바일 전용 하단 고정 바 & FAB */
.mobile-bottom-bar {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-summary-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    min-height: 44px;
  }

  .mobile-pill-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
  }

  .pill-divider { color: var(--border-medium); }

  .pill-total {
    font-family: var(--font-numeric);
    font-weight: 800;
    color: var(--gold);
  }

  .mobile-pill-sub {
    font-family: var(--font-numeric);
    font-size: 0.74rem;
    font-weight: 700;
    color: #38bdf8;
  }

  .mobile-fab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-full);
    padding: 10px 18px;
    font-size: 0.92rem;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.45);
    cursor: pointer;
  }

  /* 모바일 헤더 버튼 텍스트 숨김 (아이콘만 표시) */
  .btn-header .btn-text {
    display: none;
  }

  .btn-header {
    padding: 9px 12px;
  }
}

/* 13. 모달 (PC 팝업 & 모바일 바텀시트) */
.modal-drag-handle {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-box.modal-sm {
  max-width: 440px;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes bottomSheetSlide {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* 모바일 전용 UI 디테일 오버라이드 (640px 이하) */
@media (max-width: 640px) {
  /* 모바일 헤더 완벽 핏팅 (우측 삐져나감 방지) */
  .app-header {
    padding: 10px 12px;
  }

  .header-container {
    gap: 8px;
  }

  .header-brand {
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .brand-logo {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-xs);
  }

  .brand-logo svg {
    width: 18px;
    height: 18px;
  }

  .brand-title {
    font-size: 1.12rem;
  }

  .brand-badge {
    font-size: 0.65rem;
    padding: 1px 5px;
  }

  .brand-desc {
    display: none; /* 모바일 헤더 공간 확보를 위해 서브텍스트 숨김 */
  }

  .header-actions {
    gap: 6px;
    flex-shrink: 0;
  }

  /* 모바일에서는 상단 헤더의 중복 차량등록 버튼 숨김 (하단 플로팅 FAB로 일원화) */
  #btnOpenAddModal {
    display: none !important;
  }

  .btn-icon, .btn-header {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: var(--radius-full);
  }

  .btn-icon svg, .btn-header svg {
    width: 16px;
    height: 16px;
  }

  .app-main {
    padding: 14px 12px;
  }

  .toolbar-container {
    padding: 10px 12px;
    gap: 10px;
  }

  .toolbar-sub {
    flex-wrap: wrap;
    gap: 8px;
  }

  .toolbar-right {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-left: 0;
    gap: 8px;
  }

  .select-wrap {
    flex: 1;
    min-width: 0;
  }

  .select-wrap select {
    width: 100%;
    font-size: 0.8rem;
    height: 34px;
    padding: 0 8px;
  }

  .view-switch-group {
    display: inline-flex;
    flex-shrink: 0;
  }

  .view-switch-btn {
    height: 34px;
    padding: 0 8px;
    font-size: 0.74rem;
    gap: 4px;
  }

  .view-switch-btn svg {
    width: 13px;
    height: 13px;
  }

  /* 모바일 목록형 카드 최적화 */
  .list-item-header-row {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
    gap: 10px;
  }

  .list-item-main-info {
    justify-content: space-between;
    width: 100%;
  }

  .list-item-metrics {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
    background: var(--bg-input);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
  }

  .list-metric-col {
    min-width: auto;
    flex: 1;
    align-items: flex-start;
  }

  .list-metric-col:last-child {
    align-items: flex-end;
  }

  .list-metric-val {
    font-size: 0.84rem;
  }

  .list-detail-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .vehicles-grid {
    gap: 12px;
  }

  .car-card-header {
    padding: 14px 16px 10px;
  }

  .car-name {
    font-size: 1.15rem;
  }

  .car-card-body {
    padding: 12px 16px;
    gap: 10px;
  }

  .base-price-box {
    padding: 8px 12px;
  }

  .car-card-footer {
    padding: 14px 16px;
    gap: 10px;
  }

  .card-total-val {
    font-size: 1.15rem;
  }

  .card-sale-profit-box {
    padding: 8px 12px;
  }

  .sale-price-val {
    font-size: 0.95rem;
  }

  .profit-badge-pill {
    font-size: 0.8rem;
    padding: 2px 6px;
  }

  .profit-half-pill {
    font-size: 0.72rem;
    padding: 1px 5px;
  }

  /* 모바일 바텀시트 모달 스타일 */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-drag-handle {
    display: block;
    width: 42px;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    margin: 10px auto 2px;
  }

  [data-theme="light"] .modal-drag-handle {
    background: rgba(0, 0, 0, 0.2);
  }

  .modal-box {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    animation: bottomSheetSlide 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .modal-box.modal-sm {
    max-width: 100%;
  }

  .modal-header {
    padding: 12px 18px;
  }

  .modal-form {
    padding: 14px 18px calc(24px + env(safe-area-inset-bottom));
    gap: 14px;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form-summary-bar {
    padding: 10px 12px;
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-sub);
  margin-top: 2px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.modal-close-btn:hover {
  background: var(--bg-pill);
  color: var(--text-main);
}

.modal-form {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-legend {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.section-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.section-header-flex {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-preset-btns {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-preset {
  background: var(--bg-pill);
  border: 1px solid var(--border-subtle);
  color: var(--text-sub);
  font-size: 0.74rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-preset:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
}

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

@media (max-width: 520px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-sub);
}

.required {
  color: var(--rose);
}

.form-control {
  height: 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 0.92rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-unit-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-unit-wrap .form-control {
  width: 100%;
  padding-right: 36px;
}

.unit-text {
  position: absolute;
  right: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
}

.korean-price-hint {
  font-size: 0.75rem;
  color: var(--primary);
  margin-top: 2px;
}

/* 부대비용 행 편집기 */
.expense-items-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.editor-row {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 36px;
  gap: 8px;
  align-items: center;
}

.btn-remove-row {
  width: 36px;
  height: 38px;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: var(--rose);
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.btn-remove-row:hover {
  background: var(--rose);
  color: #ffffff;
}

.btn-dashed-add {
  height: 40px;
  border: 1px dashed var(--border-medium);
  background: transparent;
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-dashed-add:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: var(--primary);
}

/* 실시간 합산 프리뷰 바 */
.form-summary-bar {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-col {
  display: flex;
  flex-direction: column;
}

.sum-label {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.sum-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.sum-operator {
  color: var(--text-dim);
  font-weight: 700;
  font-size: 1.1rem;
}

.summary-highlight {
  text-align: right;
}

.sum-val-total {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1.1;
}

.sum-korean {
  font-size: 0.72rem;
  color: var(--text-sub);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* 14. 토스트 알림 */
.toast-container {
  position: fixed;
  bottom: 84px;
  right: 20px;
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

@media (min-width: 769px) {
  .toast-container {
    bottom: 24px;
  }
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 15. 인쇄 (Print) 전용 최적화 */
.print-only {
  display: none;
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .ambient-glow,
  .app-header,
  .toolbar-section,
  .mobile-bottom-bar,
  .modal-backdrop,
  .toast-container,
  .btn-card-action,
  .btn-quick-add-expense,
  .view-switch-group,
  .btn-text-muted {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  .print-header {
    border-bottom: 2px solid #000000;
    padding-bottom: 10px;
    margin-bottom: 20px;
  }

  .print-header h2 {
    font-size: 20pt;
    margin-bottom: 4px;
  }

  .print-date {
    font-size: 10pt;
    color: #555555;
  }

  .kpi-section {
    page-break-inside: avoid;
    margin-bottom: 24px;
  }

  .kpi-card {
    border: 1px solid #cccccc !important;
    background: #fdfdfd !important;
    box-shadow: none !important;
    color: #000000 !important;
  }

  .kpi-value, .card-total-val {
    color: #000000 !important;
    -webkit-text-fill-color: initial !important;
  }

  /* 인쇄 시 항상 테이블 뷰를 깔끔하게 표시 */
  #vehiclesCardContainer {
    display: none !important;
  }

  #vehiclesTableContainer {
    display: block !important;
    border: 1px solid #000000 !important;
    box-shadow: none !important;
  }

  .vehicles-table th, .vehicles-table td {
    color: #000000 !important;
    border-bottom: 1px solid #dddddd !important;
  }

  .vehicles-table th {
    background: #eeeeee !important;
  }
}
