/* ── 기본 ── */
:root {
  --primary: #0d6efd;
  --success: #198754;
  --danger: #dc3545;
  --bg-light: #f8f9fa;
}
body { background: var(--bg-light); font-size: 0.9rem; padding-bottom: 80px; }

/* ── 하단 탭 네비게이션 ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid #dee2e6;
  display: flex; z-index: 1000; height: 60px;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; color: #6c757d; cursor: pointer;
  text-decoration: none; font-size: 0.65rem;
  transition: color 0.15s;
}
.bottom-nav-item i { font-size: 1.3rem; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item:hover { color: var(--primary); }

/* ── 카드 ── */
.stat-card {
  background: #fff; border-radius: 12px;
  padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  text-align: center;
}
.stat-card .stat-number { font-size: 1.8rem; font-weight: 700; }
.stat-card .stat-label { font-size: 0.75rem; color: #6c757d; margin-top: 2px; }

/* ── 납품 목록 아이템 ── */
.delivery-card {
  background: #fff; border-radius: 10px;
  padding: 14px 16px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  cursor: pointer; transition: box-shadow 0.15s;
  border-left: 4px solid var(--primary);
}
.delivery-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.12); }
.delivery-card.submitted { border-left-color: var(--success); }
.delivery-card .date { font-weight: 600; color: #333; }
.delivery-card .amount { font-weight: 700; color: var(--primary); font-size: 1rem; }
.delivery-card .meta { font-size: 0.78rem; color: #6c757d; }

/* ── 배지 ── */
.badge-draft { background: #e9ecef; color: #495057; }
.badge-submitted { background: #d1e7dd; color: #0f5132; }

/* ── 폼 ── */
.form-section {
  background: #fff; border-radius: 10px;
  padding: 16px; margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}
.form-section-title {
  font-weight: 600; font-size: 0.85rem;
  color: #495057; margin-bottom: 12px;
  padding-bottom: 6px; border-bottom: 1px solid #e9ecef;
  display: flex; align-items: center; gap: 6px;
}
.form-label { font-size: 0.82rem; font-weight: 500; margin-bottom: 3px; }
.form-control, .form-select {
  font-size: 0.88rem;
  border-radius: 8px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(13,110,253,0.15);
}

/* ── 품목 행 ── */
.item-row {
  background: #f8f9fa; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 8px;
  position: relative;
}
.item-row .remove-btn {
  position: absolute; top: 8px; right: 8px;
  background: none; border: none; color: var(--danger);
  font-size: 1.1rem; cursor: pointer; padding: 0;
}

/* ── 사진 업로드 ── */
.photo-upload-area {
  border: 2px dashed #ced4da; border-radius: 10px;
  padding: 20px; text-align: center;
  cursor: pointer; color: #6c757d;
  transition: border-color 0.2s, background 0.2s;
}
.photo-upload-area:hover { border-color: var(--primary); background: #f0f4ff; }

.photo-btn {
  border: 2px dashed #ced4da; border-radius: 10px;
  padding: 14px 8px; text-align: center;
  cursor: pointer; color: #6c757d; background: #fff;
  font-size: 0.82rem; transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.photo-btn:hover { border-color: var(--primary); background: #f0f4ff; color: var(--primary); }
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.photo-thumb {
  position: relative; width: 80px; height: 80px;
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .del-photo {
  position: absolute; top: 2px; right: 2px;
  background: rgba(220,53,69,0.85); border: none;
  border-radius: 50%; width: 20px; height: 20px;
  color: #fff; font-size: 0.65rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ── 페이지 헤더 ── */
.page-header {
  display: flex; align-items: center;
  gap: 10px; margin-bottom: 16px;
}
.page-header h5 { margin: 0; font-weight: 700; }
.btn-back {
  background: none; border: none; color: #495057;
  font-size: 1.3rem; padding: 0; cursor: pointer;
}

/* ── 로그인 화면 ── */
.login-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1565c0 0%, #0d6efd 100%);
}
.login-card {
  background: #fff; border-radius: 16px;
  padding: 32px 28px; width: 100%; max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo i { font-size: 2.5rem; color: var(--primary); }
.login-logo h5 { font-weight: 700; margin-top: 8px; color: #333; }
.login-logo p { font-size: 0.78rem; color: #6c757d; margin: 0; }

/* ── 묶음 제출 ── */
.batch-card {
  background: #fff; border-radius: 10px;
  padding: 14px 16px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  border-left: 4px solid var(--success);
}
.batch-card.opacity-75 { border-left-color: #ffc107; }
.batch-card .period { font-weight: 600; color: #333; }
.batch-card .count { font-size: 0.8rem; color: #6c757d; }

/* ── 데스크탑 메뉴 활성 ── */
.desktop-nav-item.active {
  background: rgba(255,255,255,0.25) !important;
  border-color: rgba(255,255,255,0.6) !important;
}

/* ── 반응형: 데스크탑 ── */
@media (min-width: 768px) {
  body { padding-bottom: 20px; }
  .bottom-nav { display: none !important; }
  #main-nav .desktop-nav { display: flex !important; }
  main { max-width: 900px; margin: 0 auto; padding-top: 20px !important; }
  .photo-thumb { width: 100px; height: 100px; }
}

/* ── 체크박스 선택 목록 ── */
.select-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: #fff;
  border-radius: 8px; margin-bottom: 6px;
  border: 1.5px solid #dee2e6; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.select-item.selected { border-color: var(--primary); background: #f0f4ff; }
.select-item input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; }

/* ── 로딩 오버레이 ── */
#loading-overlay { display: none !important; }
#loading-overlay.show { display: flex !important; }

/* ── 탭 ── */
.nav-tabs .nav-link { font-size: 0.85rem; }
.nav-tabs .nav-link.active { font-weight: 600; }

/* ── 가로 스크롤 탭 (통계) ── */
.nav-scroller {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-scroller::-webkit-scrollbar { display: none; }

/* ── 금액 ── */
.amount-text { color: var(--primary); font-weight: 700; }

/* ── 빈 상태 ── */
.empty-state {
  text-align: center; padding: 40px 20px; color: #adb5bd;
}
.empty-state i { font-size: 3rem; display: block; margin-bottom: 10px; }
