/* ── 기본 리셋 & 변수 ─────────────────────────────────────────── */
:root {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --primary: #3b82f6;
  --primary-d: #2563eb;
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --purple: #8b5cf6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --nav-h: 56px;
  --bottom-h: 64px;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;        /* body 스크롤 없음 - 각 패널이 개별 스크롤 */
}
#root { height: 100%; display: flex; flex-direction: column; }

/* ── 스크롤바 ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

/* ── 상단 네비게이션 ─────────────────────────────────────────── */
#topNav {
  height: var(--nav-h);
  background: #1e293b;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 40;
}
#topNav .logo {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
#topNav .logo span { color: var(--primary); }

/* 상단 검색바 */
#globalSearch {
  flex: 1;
  max-width: 480px;
  position: relative;
}
#globalSearch input {
  width: 100%;
  height: 38px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px;
  color: #fff;
  padding: 0 40px 0 16px;
  font-size: 14px;
  outline: none;
  transition: all .2s;
}
#globalSearch input::placeholder { color: rgba(255,255,255,.45); }
#globalSearch input:focus {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.3);
}
#globalSearch .search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.45);
  pointer-events: none;
}

/* ── 탭 바 (하단 or 상단 서브) ──────────────────────────────── */
#tabBar {
  height: 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#tabBar::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover:not(.active) { color: var(--text); background: var(--bg); }

/* ── 메인 콘텐츠 영역 ─────────────────────────────────────────── */
#mainContent {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.page { display: none; height: 100%; overflow-y: auto; }
.page.active { display: block; }
.page-inner { padding: 16px; max-width: 1200px; margin: 0 auto; }

/* ── 카드 & 패널 ─────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-body { padding: 12px 16px; }

/* ═══════════════════════════════════════════════════════════════
   주차 보드 — 엑셀 스타일 세로형 레이아웃
   ═══════════════════════════════════════════════════════════════ */
.parking-board {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 80px;
}

/* ── 층 섹션 ───────────────────────────────────────────────── */
.floor-section {
  margin-bottom: 16px;
}
.floor-label {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 7px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}
.floor-label .floor-toggle { margin-left: auto; opacity: .6; font-size: 12px; transition: transform .2s; }
.floor-label.collapsed .floor-toggle { transform: rotate(-90deg); }
.floor-label .floor-summary { font-size: 11px; color: rgba(255,255,255,.55); font-weight: 400; }

/* ── 주차위치 그리드 ────────────────────────────────────────── */
.spots-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 2px 4px;
}

/* ── 주차위치 카드 ──────────────────────────────────────────── */
.spot-card {
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  border: 1px solid var(--border);
  overflow: hidden;
  min-width: 230px;
  max-width: 270px;
  flex: 1 1 230px;
}
@media (max-width: 480px) {
  .spot-card { min-width: 180px; max-width: 220px; flex: 1 1 180px; }
}

/* 주차위치 헤더 */
.spot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
}
.spot-title {
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  letter-spacing: .02em;
}
.spot-occ {
  font-size: 11px;
  font-weight: 700;
  font-family: monospace;
}

/* 슬롯 목록 컨테이너 */
.spot-slots {
  display: flex;
  flex-direction: column;
}

/* ── 구역 가로 스크롤 컨테이너 ───────────────────────────── */
.zones-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  padding: 0 4px 8px 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.zones-scroll::-webkit-scrollbar { height: 5px; }
.zones-scroll::-webkit-scrollbar-track { background: transparent; }
.zones-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── 구역(열) 카드 ───────────────────────────────────────── */
.zone-card {
  flex-shrink: 0;
  width: 240px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s;
}
.zone-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.12); }
@media (max-width: 480px) { .zone-card { width: 210px; } }

/* 구역 헤더 — 엑셀의 주황/살구색 헤더와 유사 */
.zone-header {
  padding: 8px 12px;
  background: #fde8cc;            /* 살구/주황색 */
  color: #7c3520;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid #f9c89a;
}
.zone-header.zh-green  { background:#d1fae5; color:#065f46; border-bottom-color:#6ee7b7; }  /* 본관/외부 */
.zone-header.zh-blue   { background:#dbeafe; color:#1e40af; border-bottom-color:#93c5fd; }  /* 별관 */
.zone-header.zh-purple { background:#ede9fe; color:#5b21b6; border-bottom-color:#c4b5fd; }  /* 지하 */
.zone-header.zh-gray   { background:#f1f5f9; color:#475569; border-bottom-color:#e2e8f0; }  /* 일시/대기 */
.zone-header.zh-dark   { background:#1e293b; color:#f1f5f9; border-bottom-color:#334155; }  /* 특수 */

.zone-header h4 {
  font-size: 12px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.zone-stats {
  font-size: 10px;
  opacity: .75;
  flex-shrink: 0;
  font-weight: 600;
}
.zone-toggle { font-size: 10px; opacity: .5; flex-shrink: 0; transition: transform .2s; }
.zone-card.collapsed .zone-toggle { transform: rotate(-90deg); }

/* ── 슬롯 테이블 (엑셀 행 형태) ─────────────────────────── */
.slot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.slot-table-body {}

/* 각 슬롯 행 */
.slot-row {
  display: grid;
  grid-template-columns: 18px 72px 1fr auto;
  /* 순번 | 번호판(전체) | [차명+태그+차주] | [관리No+일수] */
  align-items: center;
  gap: 0;
  border-bottom: 1px solid #f1f5f9;
  min-height: 38px;
  cursor: pointer;
  transition: background .12s;
  padding: 3px 0;
  position: relative;
}
.slot-row:last-child { border-bottom: none; }
.slot-row:hover { background: #f0f9ff; }
.slot-row.occupied:hover { background: #f0fdf4; }

/* 빈 슬롯 행 */
.slot-row.empty-slot {
  background: #fafafa;
  cursor: pointer;
  opacity: .7;
}
.slot-row.empty-slot:hover { opacity: 1; background: #eff6ff; }

/* 상태별 왼쪽 테두리 */
.slot-row.s-parked  { border-left: 3px solid #4ade80; }
.slot-row.s-moving  { border-left: 3px solid #fbbf24; }
.slot-row.s-outside { border-left: 3px solid #f472b6; }
.slot-row.empty-slot { border-left: 3px solid transparent; }

/* 슬롯 셀들 */
.sc-seq {
  font-size: 9px;
  font-weight: 800;
  color: #94a3b8;
  text-align: center;
  padding: 0 2px;
  flex-shrink: 0;
  line-height: 1;
}
.sc-plate {
  font-family: 'SF Mono','Fira Code',monospace;
  font-size: 12px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: .3px;
  padding: 0 5px 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 차명+태그+차주를 담는 중간 셀 */
.sc-mid {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 2px 4px;
  overflow: hidden;
  min-width: 0;
}
.sc-name {
  font-size: 13px;
  color: #1e293b;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.3;
}
.sc-name-tag {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  line-height: 1.5;
}
.sc-owner {
  font-size: 12px;
  color: #4b5563;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* 우측 정보 영역 (관리번호 + 일수) */
.sc-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 2px 6px 2px 4px;
  flex-shrink: 0;
}
.sc-no {
  font-size: 9px;
  font-weight: 700;
  color: #6366f1;
  font-family: monospace;
  white-space: nowrap;
  line-height: 1.2;
}
.sc-days {
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1.4;
}
.sc-days.fresh { color: #059669; background: #d1fae5; }
.sc-days.warn  { color: #d97706; background: #fef3c7; }
.sc-days.old   { color: #dc2626; background: #fee2e2; }

/* 빈 슬롯 표시 */
.sc-empty {
  font-size: 10px;
  color: #cbd5e1;
  text-align: center;
  grid-column: 2 / 5;
  letter-spacing: .05em;
}

/* 상태 태그 색상 (sc-name-tag에 적용) */
.snt-red    { background: #fee2e2; color: #991b1b; }
.snt-orange { background: #ffedd5; color: #9a3412; }
.snt-blue   { background: #dbeafe; color: #1e40af; }
.snt-purple { background: #ede9fe; color: #5b21b6; }
.snt-green  { background: #dcfce7; color: #166534; }
.snt-gray   { background: #f1f5f9; color: #475569; }

/* 검색 하이라이트 */
.slot-row.search-hit {
  background: #fef9c3 !important;
  border-left: 3px solid #f59e0b !important;
  animation: hitPulse .6s ease;
}
@keyframes hitPulse {
  0%   { background: #fef08a; }
  100% { background: #fef9c3; }
}
.search-match-text { background: #fde047; border-radius: 2px; padding: 0 1px; }

/* 검색 결과 위치 깜빡임 */
.highlight-blink {
  animation: blinkHL 2.5s ease;
}
@keyframes blinkHL {
  0%,100% { background: transparent; }
  10%,30%,50% { background: #fef08a; box-shadow: 0 0 0 2px #f59e0b; }
  20%,40% { background: transparent; }
}

/* ── 드래그 앤 드롭 (슬롯 행) ───────────────────────────── */
.slot-row.occupied { cursor: grab; }
.slot-row.occupied:active { cursor: grabbing; }
.slot-row.drag-over {
  background: #dbeafe !important;
  border-left: 3px solid #3b82f6 !important;
  box-shadow: inset 0 0 0 2px #93c5fd;
}
.slot-row.dragging { opacity: .4; }

/* 일수 뱃지 */
.c-days.fresh { color: #059669; background: #d1fae5; }
.c-days.warn  { color: #d97706; background: #fef3c7; }
.c-days.old   { color: #dc2626; background: #fee2e2; }

/* ── 드래그 오버 효과 ────────────────────────────────────────── */
.slot.drag-over {
  border-color: var(--primary) !important;
  background: #dbeafe !important;
  transform: scale(1.04);
  box-shadow: 0 0 0 2px var(--primary);
}
.slot.dragging {
  opacity: .45;
  transform: scale(.97);
}

/* ── 상태 뱃지 ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-parked  { background: #dcfce7; color: #166534; }
.badge-moving  { background: #fef9c3; color: #854d0e; }
.badge-outside { background: #fce7f3; color: #9d174d; }
.badge-sold    { background: #e0e7ff; color: #3730a3; }

/* ── 검색 결과 오버레이 ──────────────────────────────────────── */
#searchDropdown {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: #1e293b;
  z-index: 100;
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  border-top: 1px solid rgba(255,255,255,.1);
  display: none;
}
#searchDropdown.open { display: block; }
.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  cursor: pointer;
  transition: background .15s;
}
.search-item:hover { background: rgba(255,255,255,.06); }
.search-item .si-plate {
  font-family: monospace;
  font-size: 18px;
  font-weight: 800;
  color: #93c5fd;
  min-width: 52px;
}
.search-item .si-info { flex: 1; min-width: 0; }
.search-item .si-name { font-size: 14px; font-weight: 600; color: #f1f5f9; }
.search-item .si-loc  { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.search-item .si-loc strong { color: #60a5fa; }
.search-item .si-days {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* ── 모달 ────────────────────────────────────────────────────── */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 640px) {
  .modal-bg { align-items: center; }
}
.modal-box {
  background: var(--surface);
  width: 100%;
  max-width: 480px;
  border-radius: 20px 20px 0 0;
  max-height: 92vh;
  overflow-y: auto;
  animation: slideUp .25s ease;
}
@media (min-width: 640px) {
  .modal-box { border-radius: 20px; max-height: 88vh; }
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-handle {
  width: 40px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin: 10px auto 0;
}
.modal-header {
  padding: 16px 20px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 17px; font-weight: 700; }
.modal-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: none;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.modal-body { padding: 16px 20px; }

/* ── 폼 요소 ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
}
.form-textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 72px; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}

/* ── 버튼 ────────────────────────────────────────────────────── */
.btn {
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #fef2f2; color: var(--danger); border: 1.5px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 6px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-full { width: 100%; }

/* ── 토스트 ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 70px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: #1e293b;
  color: #f1f5f9;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn .3s ease;
  pointer-events: all;
  max-width: 280px;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.warn    { border-left: 4px solid var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ── 차량 리스트 ─────────────────────────────────────────────── */
.car-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.car-list-item:last-child { border-bottom: none; }
.car-list-item:hover { background: #f8fafc; }
.cli-no-badge {
  font-family: monospace;
  font-size: 11px;
  font-weight: 800;
  color: #6366f1;
  background: #eef2ff;
  border-radius: 5px;
  padding: 2px 6px;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
  min-width: 36px;
  text-align: center;
}
.cli-plate {
  font-family: monospace;
  font-size: 19px;
  font-weight: 800;
  color: var(--primary);
  min-width: 46px;
  flex-shrink: 0;
}
.cli-info { flex: 1; min-width: 0; }
.cli-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.cli-sub  { font-size: 12px; color: var(--text-2); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cli-right { text-align: right; flex-shrink: 0; }
.cli-loc-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  background: #eff6ff;
  color: var(--primary);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: monospace;
  white-space: nowrap;
}
.cli-days { font-size: 11px; margin-top: 4px; font-weight: 600; }

/* ── 이동 중/외부 차량 섹션 ──────────────────────────────────── */
.floating-cars {
  background: #fffbeb;
  border: 1.5px dashed #fcd34d;
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 16px;
}
.floating-cars h4 {
  font-size: 12px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.floating-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: box-shadow .15s;
  border: 1px solid #fef3c7;
}
.floating-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.floating-item:last-child { margin-bottom: 0; }

/* ── 통계 카드 ───────────────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat-card .sc-val { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-card .sc-label { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* ── 로그인 화면 ──────────────────────────────────────────────── */
#loginPage {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}
.login-box {
  width: 100%;
  max-width: 360px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 32px 28px;
  backdrop-filter: blur(10px);
}

/* ── 구역 설정 화면 ───────────────────────────────────────────── */
.settings-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }

/* 설정 - 인라인 추가 폼 */
.settings-add-form {
  background: #f8fafc;
  border: 1.5px dashed #d1d5db;
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 8px;
}
.settings-add-form .form-group { margin-bottom: 8px; }
.settings-add-form .form-input,
.settings-add-form .form-select {
  height: 38px;
  font-size: 14px;
}

/* 주차열 구역 그루핑 */
.settings-zone-group {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.settings-zone-group-header {
  padding: 8px 12px;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ── 슬롯 비고 편집 (인라인) ─────────────────────────────────── */
.slot-note-edit {
  font-size: 10px;
  color: #7c3aed;
  text-align: center;
  font-style: italic;
  padding: 0 2px;
  line-height: 1.3;
  word-break: break-all;
  max-width: 100%;
}

/* ── 모바일 FAB (플로팅 추가 버튼) ──────────────────────────── */
#fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(59,130,246,.45);
  cursor: pointer;
  z-index: 30;
  transition: all .2s;
}
#fab:hover { transform: scale(1.08); background: var(--primary-d); }

/* ── 필터 칩 ────────────────────────────────────────────────── */
.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 16px;
  scrollbar-width: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: all .15s;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── 반응형 ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .page-inner { padding: 12px; }
  .slot { min-height: 66px; }
  .car-chip .c-plate { font-size: 11px; }
  .car-chip .c-name  { font-size: 9px; }
}
@media (min-width: 1024px) {
  .zones-grid { flex-wrap: nowrap; }
  .zone-card { min-width: 300px; }
}
