/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
  background: #f0f4ff;
  color: #1e293b;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== CSS VARIABLES ===== */
:root {
  --blue-900: #1e3a8a;
  --blue-800: #1e40af;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --yellow-600: #ca8a04;
  --yellow-100: #fef9c3;
  --red-600: #dc2626;
  --red-100: #fee2e2;
  --gray-700: #374151;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,.12);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

/* ===== LAYOUT ===== */
#app { min-height: 100vh; }
.page { display: none; min-height: 100vh; }
.page.active { display: block; }

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== TOP NAV ===== */
.top-nav {
  background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.top-nav .nav-back {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.top-nav h1 { font-size: 18px; font-weight: 700; flex: 1; }
.top-nav .nav-actions { display: flex; gap: 8px; }
.top-nav .nav-btn {
  background: rgba(255,255,255,0.2);
  border: none; color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--gray-200);
  display: flex;
  z-index: 100;
  box-shadow: 0 -4px 12px rgba(0,0,0,.08);
}
.bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px 12px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--gray-500);
  font-size: 11px;
  gap: 4px;
  transition: color .2s;
}
.bottom-nav .nav-item.active { color: var(--blue-600); }
.bottom-nav .nav-item .icon { font-size: 22px; }

/* ===== HERO SECTION ===== */
.hero {
  background: linear-gradient(160deg, var(--blue-900) 0%, var(--blue-700) 60%, var(--blue-500) 100%);
  color: #fff;
  padding: 48px 20px 40px;
  text-align: center;
}
.hero-logo {
  font-size: 32px; font-weight: 900;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.hero-sub {
  font-size: 15px; opacity: .85; margin-bottom: 32px; line-height: 1.5;
}
.hero-btns { display: flex; flex-direction: column; gap: 12px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  border-radius: var(--radius);
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  width: 100%;
  text-align: center;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: #fff;
  color: var(--blue-800);
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.btn-secondary {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 2px solid rgba(255,255,255,.5);
}
.btn-blue {
  background: var(--blue-700);
  color: #fff;
  box-shadow: 0 4px 12px rgba(30,64,175,.3);
}
.btn-blue:hover { background: var(--blue-800); }
.btn-outline {
  background: #fff;
  color: var(--blue-700);
  border: 2px solid var(--blue-600);
}
.btn-green {
  background: var(--green-600);
  color: #fff;
}
.btn-red {
  background: var(--red-600);
  color: #fff;
}
.btn-gray {
  background: var(--gray-200);
  color: var(--gray-700);
}
.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}
.btn-xs {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* ===== CARD ===== */
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.card-title {
  font-size: 15px; font-weight: 700;
  color: var(--blue-800);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--blue-50);
}

/* ===== ACCOUNT BOX ===== */
.account-box {
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border: 2px solid #f59e0b;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
  text-align: center;
}
.account-box .label { font-size: 12px; color: var(--gray-500); margin-bottom: 4px; }
.account-box .bank { font-size: 18px; font-weight: 800; color: #92400e; }
.account-box .number { font-size: 22px; font-weight: 900; color: #1e3a8a; letter-spacing: 1px; }
.account-box .owner { font-size: 14px; color: var(--gray-700); margin-top: 4px; }

/* ===== INFO BOX ===== */
.info-box {
  background: var(--blue-50);
  border-left: 4px solid var(--blue-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--blue-900);
  margin: 12px 0;
  line-height: 1.6;
}

/* ===== FORM ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 14px; font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-label .required { color: var(--red-600); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--gray-700);
  background: #fff;
  transition: border-color .2s;
  appearance: none;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-error { color: var(--red-600); font-size: 13px; margin-top: 4px; }
.form-hint { color: var(--gray-500); font-size: 12px; margin-top: 4px; }

/* ===== CALENDAR ===== */
.calendar-wrapper {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  width: 100%;
  /* 캘린더가 절대로 부모 너비를 넘지 않도록 */
  box-sizing: border-box;
}
.calendar-header {
  background: var(--blue-800);
  color: #fff;
  padding: 12px 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.calendar-header h3 { font-size: 16px; font-weight: 700; }
.calendar-nav {
  background: rgba(255,255,255,.2);
  border: none; color: #fff;
  width: 32px; height: 32px;
  border-radius: 50%; font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
/* 요일 헤더 — 7열 균등 분할, 절대 넘치지 않음 */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--blue-50);
  width: 100%;
  box-sizing: border-box;
}
.calendar-weekday {
  padding: 7px 0;
  text-align: center;
  font-size: 11px; font-weight: 700;
  color: var(--gray-500);
  overflow: hidden;
}
.calendar-weekday:first-child { color: var(--red-600); }
.calendar-weekday:last-child { color: var(--blue-600); }
/* 날짜 그리드 — minmax(0,1fr) 로 7칸이 무조건 화면 안에 들어오게 */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 4px 2px;
  gap: 2px;
  width: 100%;
  box-sizing: border-box;
}
.calendar-day {
  /* aspect-ratio 대신 padding-bottom 트릭으로 정사각형 유지 */
  position: relative;
  width: 100%;
  padding-bottom: 100%;  /* 정사각형 */
  cursor: pointer;
  border-radius: 6px;
  transition: background .15s;
  min-width: 0;          /* 그리드 오버플로우 방지 */
  overflow: hidden;
}
/* 실제 내용은 absolute 로 채움 */
.calendar-day-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: clamp(11px, 3vw, 14px);  /* 화면 너비에 맞게 자동 조정 */
  font-weight: 500;
}
.calendar-day:hover:not(.disabled):not(.empty) { background: var(--blue-50); }
.calendar-day.today .calendar-day-inner { font-weight: 800; color: var(--blue-600); }
.calendar-day.selected { background: var(--blue-700) !important; border-radius: 6px; }
.calendar-day.selected .calendar-day-inner { color: #fff !important; }
.calendar-day.disabled .calendar-day-inner { color: var(--gray-300); cursor: not-allowed; }
.calendar-day.empty { cursor: default; pointer-events: none; }
.calendar-day .day-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-available { background: var(--green-600); }
.dot-partial { background: #f59e0b; }
.dot-full { background: var(--red-600); }

/* 캘린더가 카드/컨테이너 안에 들어갈 때 절대 넘치지 않도록 */
.card .calendar-wrapper,
.page-content .calendar-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* ===== TIME SLOTS ===== */
.time-slots {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.time-slot {
  padding: 12px 4px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200);
  background: #fff;
  text-align: center;
  cursor: pointer;
  font-size: 13px; font-weight: 600;
  color: var(--gray-700);
  transition: all .15s;
}
.time-slot:hover:not(.disabled) { border-color: var(--blue-500); color: var(--blue-600); }
.time-slot.selected { border-color: var(--blue-700); background: var(--blue-700); color: #fff; }
.time-slot.full { border-color: var(--red-600); background: var(--red-100); color: var(--red-600); cursor: not-allowed; }
.time-slot.partial { border-color: #f59e0b; }
.time-slot .slot-label { font-size: 10px; font-weight: 400; margin-top: 2px; }

/* ===== SERVICE CARDS ===== */
.service-options {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.service-option {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  background: #fff;
}
.service-option:hover { border-color: var(--blue-500); }
.service-option.selected { border-color: var(--blue-700); background: var(--blue-50); }
.service-option .svc-icon { font-size: 24px; margin-bottom: 4px; }
.service-option .svc-name { font-size: 13px; font-weight: 700; color: var(--gray-700); }
.service-option .svc-price { font-size: 15px; font-weight: 800; color: var(--blue-700); margin-top: 2px; }

/* ===== PRICE DISPLAY ===== */
.price-display {
  background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
  color: #fff;
  border-radius: var(--radius);
  padding: 16px 20px;
  text-align: center;
  margin: 16px 0;
}
.price-display .price-label { font-size: 13px; opacity: .8; }
.price-display .price-amount { font-size: 28px; font-weight: 900; }

/* ===== BOOKING CARD (Admin) ===== */
.booking-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
  border-left: 5px solid var(--blue-500);
}
.booking-card.status-접수 { border-left-color: #94a3b8; }
.booking-card.status-입금대기 { border-left-color: #f59e0b; }
.booking-card.status-입금확인 { border-left-color: #06b6d4; }
.booking-card.status-확정 { border-left-color: var(--blue-600); }
.booking-card.status-작업중 { border-left-color: #8b5cf6; }
.booking-card.status-완료 { border-left-color: var(--green-600); }
.booking-card.status-고객취소 { border-left-color: var(--gray-400); opacity: .7; }
.booking-card.status-관리자취소 { border-left-color: var(--gray-400); opacity: .7; }
.booking-card.status-노쇼 { border-left-color: var(--red-600); opacity: .8; }

.booking-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 10px;
}
.booking-time { font-size: 20px; font-weight: 800; color: var(--blue-800); }
.booking-name { font-size: 16px; font-weight: 700; }
.booking-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px; font-weight: 700;
  white-space: nowrap;
}
.badge-접수 { background: #e2e8f0; color: #475569; }
.badge-입금대기 { background: #fef3c7; color: #92400e; }
.badge-입금확인 { background: #cffafe; color: #0e7490; }
.badge-확정 { background: var(--blue-100); color: var(--blue-800); }
.badge-작업중 { background: #ede9fe; color: #5b21b6; }
.badge-완료 { background: var(--green-100); color: #166534; }
.badge-고객취소 { background: var(--gray-100); color: var(--gray-500); }
.badge-관리자취소 { background: var(--gray-100); color: var(--gray-500); }
.badge-노쇼 { background: var(--red-100); color: var(--red-600); }

.booking-detail-row {
  display: flex; align-items: flex-start;
  gap: 6px; font-size: 14px; color: var(--gray-700);
  margin-bottom: 6px;
}
.booking-detail-row .label { color: var(--gray-500); min-width: 64px; font-size: 13px; }
.booking-action-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px;
}

/* ===== PRICE TABLE ===== */
.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.price-table th {
  background: var(--blue-800);
  color: #fff;
  padding: 10px 8px;
  text-align: center;
  font-size: 12px;
}
.price-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--gray-200);
  text-align: center;
}
.price-table tr:nth-child(even) td { background: var(--blue-50); }
.price-table .car-type { font-weight: 700; text-align: left; color: var(--blue-900); }

/* ===== STATUS BADGES ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px; font-weight: 700;
}
.badge-green { background: var(--green-100); color: #166534; }
.badge-blue { background: var(--blue-100); color: var(--blue-800); }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: var(--red-100); color: var(--red-600); }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex; align-items: flex-end;
  padding: 0;
}
.modal-overlay.center { align-items: center; padding: 16px; }
.modal {
  background: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 0 0 calc(env(safe-area-inset-bottom) + 16px);
}
.modal.center-modal {
  border-radius: var(--radius-lg);
  max-width: 480px;
  margin: auto;
}
.modal-handle {
  width: 40px; height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  margin: 12px auto 0;
}
.modal-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none; background: var(--gray-100);
  cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.modal-body { padding: 16px 20px; }

/* ===== ADMIN TAB BAR ===== */
.admin-tabs {
  display: flex; overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 8px;
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
  flex-shrink: 0;
  padding: 12px 16px;
  font-size: 14px; font-weight: 600;
  color: var(--gray-500);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  border: none; background: none;
  white-space: nowrap;
}
.admin-tab.active {
  color: var(--blue-700);
  border-bottom-color: var(--blue-700);
}

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex; gap: 8px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
}
.search-input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 15px;
}
.search-btn {
  padding: 10px 16px;
  background: var(--blue-700);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}

/* ===== IMAGE LIGHTBOX ===== */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: var(--radius-sm); }
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,.2);
  border: none; color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + 80px);
  left: 50%; transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px; font-weight: 500;
  white-space: nowrap;
  z-index: 999;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease;
}
.toast.success { background: var(--green-600); }
.toast.error { background: var(--red-600); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== LOADING ===== */
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; color: var(--gray-400); font-size: 14px; gap: 10px;
}
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== EMPTY STATE ===== */
.empty {
  text-align: center; padding: 48px 20px;
  color: var(--gray-400);
}
.empty .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty h3 { font-size: 16px; color: var(--gray-500); margin-bottom: 6px; }
.empty p { font-size: 14px; }

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: 18px; font-weight: 800;
  color: var(--blue-900);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 4px; height: 20px;
  background: var(--blue-600);
  border-radius: 2px;
}

/* ===== MONTHLY MEMBER ===== */
.monthly-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
  border-top: 4px solid var(--blue-500);
}
.monthly-progress {
  display: flex; align-items: center; gap: 10px; margin-top: 8px;
}
.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--blue-500);
  border-radius: 4px;
  transition: width .3s;
}

/* ===== REALTIME INDICATOR ===== */
.realtime-bar {
  background: linear-gradient(90deg, #064e3b, #065f46);
  color: #fff;
  padding: 6px 16px;
  font-size: 12px;
  display: flex; align-items: center; gap: 6px;
}
.realtime-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #34d399;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ===== SUMMARY STATS ===== */
.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-number { font-size: 28px; font-weight: 900; color: var(--blue-700); }
.stat-label { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

/* ===== CONTENT PADDING ===== */
.page-content {
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 80px);
}
.page-content.no-bottom { padding-bottom: 16px; }

/* ===== INPUT GROUP ===== */
.input-group {
  display: flex; gap: 8px;
}
.input-group .form-input { flex: 1; }

/* ===== DIVIDER ===== */
.divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 16px 0;
}

/* ===== OPTION CHIP ===== */
.option-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.option-chip {
  padding: 8px 14px;
  border: 2px solid var(--gray-200);
  border-radius: 20px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  background: #fff;
  color: var(--gray-700);
  transition: all .15s;
}
.option-chip:hover { border-color: var(--blue-400); }
.option-chip.selected { border-color: var(--blue-700); background: var(--blue-700); color: #fff; }

/* ===== RESERVATION NUMBER ===== */
.booking-number {
  background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
  color: #fff;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
}
.booking-number .num-label { font-size: 13px; opacity: .8; }
.booking-number .num-value { font-size: 28px; font-weight: 900; letter-spacing: 2px; }

/* ===== PC RESPONSIVE ===== */
@media (min-width: 641px) {
  .container { padding: 0 24px; }
  .hero { padding: 64px 32px 56px; }
  .hero-logo { font-size: 40px; }
  .hero-btns { flex-direction: row; flex-wrap: wrap; max-width: 480px; margin: 0 auto; }
  .hero-btns .btn { width: auto; flex: 1; min-width: 140px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .bottom-nav { max-width: 640px; left: 50%; transform: translateX(-50%); right: auto; width: 100%; }
  .page-content { padding: 20px 24px 100px; }
  .price-table th, .price-table td { padding: 12px 10px; font-size: 14px; }
}

/* ===== SAFE AREA ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
}

/* ===== ADMIN SPECIFIC ===== */
.admin-login {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--blue-900), var(--blue-700));
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.admin-login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.admin-login-card h2 { font-size: 24px; font-weight: 900; color: var(--blue-800); margin: 12px 0 6px; }
.admin-login-card p { font-size: 14px; color: var(--gray-500); margin-bottom: 24px; }
.pin-input {
  width: 100%;
  padding: 18px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 24px; font-weight: 700;
  text-align: center;
  letter-spacing: 8px;
  margin-bottom: 16px;
}
.pin-input:focus { outline: none; border-color: var(--blue-500); }

/* ===== ADMIN CALENDAR (.admin-cal-*) ===== */
.admin-calendar-wrapper {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  width: 100%;
  box-sizing: border-box;
}
.admin-cal-header {
  background: var(--blue-800);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-cal-header h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.3px;
}
/* 요일 헤더 */
.admin-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--blue-50);
  width: 100%;
  box-sizing: border-box;
}
.admin-cal-wd {
  padding: 7px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  overflow: hidden;
}
.admin-cal-wd:first-child { color: var(--red-600); }
.admin-cal-wd:last-child  { color: var(--blue-600); }
/* 날짜 그리드 — 7열 균등, 넘침 방지 */
.admin-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--gray-200);
  width: 100%;
  box-sizing: border-box;
}
/* 날짜 셀 — 직사각형, 정보 여유 공간 확보 */
.admin-cal-day {
  background: #fff;
  min-height: 58px;
  padding: 5px 4px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: background .15s;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.admin-cal-day.empty {
  background: var(--gray-100);
  cursor: default;
  pointer-events: none;
}
.admin-cal-day:hover:not(.empty) {
  background: var(--blue-50) !important;
}
.admin-cal-day.today {
  outline: 2px solid var(--blue-600);
  outline-offset: -2px;
}
/* 날짜 숫자 */
.admin-cal-num {
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 700;
  line-height: 1;
  width: 100%;
  text-align: center;
}
/* 예약 건수 뱃지 */
.admin-cal-badge {
  font-size: 9px;
  font-weight: 700;
  background: var(--blue-700);
  color: #fff;
  border-radius: 20px;
  padding: 1px 5px;
  line-height: 1.4;
  white-space: nowrap;
}
/* 시간 목록 컨테이너 */
.admin-cal-times {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 100%;
}
/* 개별 예약 시간 태그 */
.admin-cal-time {
  font-size: 8px;
  color: var(--blue-800);
  background: var(--blue-50);
  border-radius: 3px;
  padding: 0 3px;
  line-height: 1.5;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  text-align: center;
}
/* 초과 건수 표시 (+N) */
.admin-cal-over {
  font-size: 8px;
  color: var(--gray-500);
  font-weight: 600;
}
/* 예약 밀도별 배경색 */
.admin-cal-some  { background: #dbeafe; } /* 1건 — 연파랑 */
.admin-cal-busy  { background: #93c5fd; } /* 2~3건 — 중간파랑 */
.admin-cal-full  { background: #fde68a; } /* 4건+ — 노랑 경고 */
/* 범례 */
.admin-cal-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--gray-700);
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.1);
}

/* ===== PRICE SIMULATOR ===== */
.price-sim-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 16px;
}
.price-sim-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
}
.price-sim-section:last-child { border-bottom: none; }
.price-sim-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
/* 차종 / 서비스 선택 버튼 그리드 */
.sim-car-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.sim-svc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.sim-btn {
  padding: 10px 8px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: #fff;
  text-align: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  transition: all .15s;
  line-height: 1.3;
}
.sim-btn:hover { border-color: var(--blue-400); color: var(--blue-600); }
.sim-btn.active {
  border-color: var(--blue-700);
  background: var(--blue-700);
  color: #fff;
}
.sim-btn .sim-price {
  display: block;
  font-size: 11px;
  font-weight: 400;
  margin-top: 3px;
  opacity: .8;
}
.sim-btn.active .sim-price { opacity: 1; }
/* 옵션 칩 */
.sim-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sim-opt-chip {
  padding: 8px 12px;
  border: 2px solid var(--gray-200);
  border-radius: 20px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.sim-opt-chip:hover { border-color: var(--blue-400); }
.sim-opt-chip.active {
  border-color: var(--blue-500);
  background: var(--blue-50);
  color: var(--blue-700);
}
/* 합산 금액 표시 영역 */
.sim-total-bar {
  background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius);
  margin-top: 4px;
}
.sim-total-label {
  font-size: 14px;
  font-weight: 600;
  opacity: .9;
}
.sim-total-amount {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
}
.sim-total-sub {
  font-size: 11px;
  opacity: .7;
  margin-top: 2px;
}
.sim-reset-btn {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .15s;
}
.sim-reset-btn:hover { background: rgba(255,255,255,.28); }
/* 선택 미완료 안내 */
.sim-hint {
  font-size: 12px;
  color: var(--gray-400);
  text-align: center;
  padding: 8px 0;
  font-style: italic;
}

/* ===== PWA 설치 안내 카드 ===== */
.pwa-install-card {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1.5px solid #bae6fd;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.pwa-install-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.pwa-install-icon {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
}
.pwa-install-title {
  font-size: 16px;
  font-weight: 800;
  color: #0c4a6e;
  letter-spacing: -.3px;
}
.pwa-install-sub {
  font-size: 12px;
  color: #0369a1;
  margin-top: 2px;
  line-height: 1.4;
}

/* 안드로이드 설치 버튼 */
.pwa-install-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
  transition: opacity .15s;
}
.pwa-install-btn:active { opacity: .85; }

/* 설치 완료 메시지 */
.pwa-installed-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: var(--green-100);
  border-radius: var(--radius-sm);
  color: var(--green-600);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
}

/* OS 전환 탭 */
.pwa-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.pwa-tab {
  flex: 1;
  padding: 8px 6px;
  border: 1.5px solid #bae6fd;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #0369a1;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.pwa-tab.active {
  background: #0c4a6e;
  border-color: #0c4a6e;
  color: #fff;
}

/* 가이드 박스 */
.pwa-guide-box {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pwa-guide-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1e3a8a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.pwa-ios-note {
  font-size: 12px;
  color: #0369a1;
  background: #e0f2fe;
  border-radius: 6px;
  padding: 8px 10px;
  line-height: 1.5;
}

/* ===== PWA 업데이트 배너 ===== */
.pwa-update-banner {
  position: fixed;
  bottom: 76px;   /* 하단 내비 위 */
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 600px;
  background: #1e3a8a;
  color: #fff;
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  animation: slideUp .3s ease;
}
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);   opacity: 1; }
}
.pwa-update-banner span {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
}
.pwa-update-btn {
  background: #fff;
  color: #1e3a8a;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.pwa-update-dismiss {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.7);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}

/* ===== PWA standalone 모드 safe-area 패딩 ===== */
@media (display-mode: standalone) {
  /* 상단 노치/Dynamic Island 대응 */
  .top-nav, .hero {
    padding-top: max(env(safe-area-inset-top), 12px);
  }
  /* 하단 홈 바 대응 */
  .bottom-nav {
    padding-bottom: max(env(safe-area-inset-bottom), 8px);
  }
}

/* ===== 관리자 날짜 헤더 (기준일 선택) ===== */
.admin-date-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
}
.admin-date-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* 날짜 표시 + 📅 버튼 */
.admin-date-pick {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1.5px solid var(--blue-100);
  border-radius: 20px;
  padding: 5px 10px 5px 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  white-space: nowrap;
  max-width: 170px;
}
.admin-date-pick:hover {
  border-color: var(--blue-500);
  background: var(--blue-50);
}
.admin-date-pick .date-str {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-date-pick .date-icon {
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}

/* 초기화 버튼 */
.admin-date-reset {
  background: var(--yellow-100);
  border: 1.5px solid #fde68a;
  color: var(--yellow-600);
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.admin-date-reset:hover { background: #fef08a; }

/* 빠른 선택 버튼 (날짜 피커 모달 안) */
.date-quick-btn {
  flex: 1;
  min-width: 72px;
  padding: 9px 6px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--gray-700);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  line-height: 1.4;
  transition: all .15s;
}
.date-quick-btn:hover {
  border-color: var(--blue-400);
  color: var(--blue-700);
  background: var(--blue-50);
}
.date-quick-btn.active {
  border-color: var(--blue-700);
  background: var(--blue-700);
  color: #fff;
}
