@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;900&display=swap');

:root {
  --primary: #1a56db;
  --primary-dark: #1543a8;
  --primary-light: #e8f0fe;
  --green: #0e9f6e;
  --red: #e02424;
  --orange: #d97706;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Noto Sans KR', -apple-system, 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

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

header.topbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 20;
}
header.topbar .topbar-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { font-weight: 900; font-size: 18px; color: var(--gray-900); display: flex; align-items: center; gap: 0; }
.brand-cascan { display: inline-flex; align-items: center; gap: 3px; color: var(--primary); margin-left: 1px; }
.brand-cascan .car-icon { flex-shrink: 0; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-link { padding: 6px 10px; border-radius: 8px; font-size: 14px; color: var(--gray-700); font-weight: 500; }
.nav-link.active { background: var(--primary-light); color: var(--primary); }

.bell-btn { position: relative; background: none; border: none; cursor: pointer; font-size: 20px; padding: 4px; }
.bell-badge {
  position: absolute; top: -2px; right: -2px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 999px; min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

h1 { font-size: 22px; font-weight: 900; margin: 4px 0 16px; }
h2 { font-size: 17px; font-weight: 700; margin: 24px 0 10px; }
p.sub { color: var(--gray-500); font-size: 14px; margin-top: -8px; margin-bottom: 16px; }

.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.card:hover { border-color: var(--gray-300); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--gray-700); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=tel], textarea, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--gray-900);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
textarea { resize: vertical; min-height: 80px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .row2 { grid-template-columns: 1fr; } }

.radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-pill {
  border: 1px solid var(--gray-300); border-radius: 999px; padding: 9px 16px; font-size: 14px;
  cursor: pointer; user-select: none;
}
.radio-pill.selected { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.checkbox-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--gray-700); }
.checkbox-row input { margin-top: 3px; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 10px; padding: 12px 18px; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: filter .1s;
}
button:active, .btn:active { filter: brightness(0.93); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: var(--gray-300); cursor: not-allowed; }
.btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-danger { background: #fff; color: var(--red); border: 1.5px solid var(--red); }
.btn-gray { background: var(--gray-100); color: var(--gray-700); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; }

.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-open { background: #fef3c7; color: #92400e; }
.badge-matched { background: #dbeafe; color: #1e40af; }
.badge-reported { background: #e0e7ff; color: #4338ca; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-resolved { background: #d1fae5; color: #065f46; }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }

.list-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--gray-100); }
.list-item:last-child { border-bottom: none; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray-500); font-size: 14px; }

.photo-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photo-thumb { width: 84px; height: 84px; border-radius: 8px; object-fit: cover; border: 1px solid var(--gray-200); cursor: pointer; }
.photo-input-btn { width: 84px; height: 84px; border-radius: 8px; border: 1.5px dashed var(--gray-300); display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--gray-500); cursor: pointer; background: var(--gray-50); }

.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--gray-900); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,.2); animation: toastIn .15s ease-out; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px);} to {opacity: 1; transform: translateY(0);} }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 100; }
@media (min-width: 520px) { .modal-backdrop { align-items: center; } }
.modal-box { background: #fff; border-radius: 16px 16px 0 0; padding: 20px; width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto; }
@media (min-width: 520px) { .modal-box { border-radius: 16px; } }
.modal-close { float: right; background: none; border: none; font-size: 20px; color: var(--gray-500); cursor: pointer; padding: 0; }

.notif-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--gray-100); font-size: 13px; }
.notif-item.unread { background: var(--primary-light); margin: 0 -16px; padding: 12px 16px; border-radius: 8px; }
.notif-time { color: var(--gray-500); font-size: 11px; margin-top: 3px; }

.rating-stars { color: #f59e0b; font-size: 16px; letter-spacing: 1px; }
.rating-input { display: flex; gap: 4px; font-size: 28px; cursor: pointer; }
.rating-input span { color: var(--gray-300); }
.rating-input span.active { color: #f59e0b; }

.notice-box { background: var(--primary-light); border: 1px solid #bfdbfe; border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--primary-dark); margin-bottom: 16px; }
.warn-box { background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 12px 14px; font-size: 13px; color: #991b1b; margin-bottom: 16px; }

.tabs { display: flex; border-bottom: 1px solid var(--gray-200); margin-bottom: 16px; gap: 4px; }
.tab-btn { padding: 10px 16px; font-size: 14px; font-weight: 700; color: var(--gray-500); border-bottom: 2px solid transparent; background: none; border-radius: 0; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.price-tag { font-weight: 900; color: var(--primary); }
.district-same { color: var(--green); font-weight: 700; }
.district-diff { color: var(--orange); font-weight: 700; }

.footer-note { text-align: center; color: var(--gray-500); font-size: 12px; padding: 24px 0; }
.footer-note a { text-decoration: underline; }

.loading-spinner { text-align: center; padding: 40px; color: var(--gray-500); }

.auth-gate {
  position: fixed; inset: 0; background: var(--gray-50); z-index: 300;
  overflow-y: auto; display: flex; align-items: flex-start; justify-content: center;
}
.auth-gate-inner { width: 100%; max-width: 420px; padding: 40px 16px 60px; }
.auth-switch { text-align: center; margin: 18px 0; font-size: 14px; color: var(--gray-500); }
.auth-switch a { color: var(--primary); font-weight: 700; cursor: pointer; }
.service-off-box { background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 16px; text-align: center; color: #991b1b; font-size: 14px; margin: 16px; }
