* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --planned: #3b82f6;
  --ongoing: #f59e0b;
  --done: #22c55e;
  --cancelled: #94a3b8;
}
body {
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", -apple-system, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
}
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }

/* 로그인 */
#login-view {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
}
.login-card {
  background: var(--card); padding: 36px; border-radius: 12px; width: 340px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
.login-card h1 { font-size: 20px; margin-bottom: 24px; text-align: center; }
.login-card .field { margin-bottom: 14px; }
.login-card label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.login-card input { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.btn-primary {
  background: var(--primary); color: #fff; border: none; padding: 11px; border-radius: 8px;
  width: 100%; font-size: 15px; font-weight: 600;
}
.btn-primary:hover { background: var(--primary-dark); }
.login-error { color: #dc2626; font-size: 13px; margin-top: 10px; text-align: center; }

/* 헤더 */
.app-header {
  background: linear-gradient(135deg, #0B2458 0%, #1a3a7a 100%);
  color: #fff;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 4px 6px rgba(0,0,0,.07);
  position: sticky; top: 0; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.header-icon { font-size: 28px; }
.app-header h1 { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.header-sub { font-size: 11px; opacity: .7; display: block; }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-date { font-size: 12px; opacity: .75; }
.lang-switcher { display: flex; gap: 4px; align-items: center; }
.lang-switcher button {
  padding: 3px 10px; border: 1.5px solid rgba(255,255,255,.35);
  background: transparent; color: rgba(255,255,255,.65); border-radius: 20px;
  font-size: 11px; cursor: pointer; transition: all .2s; white-space: nowrap;
}
.lang-switcher button:hover,
.lang-switcher button.active {
  background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.8);
}
.btn-logout {
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.3); border-radius: 6px;
  padding: 5px 12px; font-size: 12px; transition: background .2s;
}
.btn-logout:hover { background: rgba(255,255,255,.2); }

/* 탭 내비게이션 */
.tab-nav {
  display: flex; gap: 4px; background: #fff;
  padding: 6px 24px; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.tab-btn {
  padding: 9px 18px; border: none; background: transparent; border-radius: 6px;
  cursor: pointer; font-size: 13px; font-weight: 500; color: #4b5563;
  transition: all .2s; font-family: inherit;
}
.tab-btn:hover { background: #f3f4f6; color: #1e293b; }
.tab-btn.active { background: #0B2458; color: #fff; }

/* 로그인 lang-switch (로그인 카드 전용) */
.lang-switch { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.lang-switch button { background: #fff; border: none; padding: 6px 10px; font-size: 13px; color: var(--muted); }
.lang-switch button.active { background: var(--primary); color: #fff; }

/* 본문 */
main { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }
.view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.view-header h2 { font-size: 18px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
}
.btn {
  border: 1px solid var(--border); background: #fff; border-radius: 8px;
  padding: 8px 14px; font-size: 14px; font-weight: 500;
}
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { color: #dc2626; }
.btn.sm { padding: 5px 10px; font-size: 13px; }

/* 카드 리스트 (배차) */
.dispatch-list { display: grid; gap: 10px; }
.dispatch-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px;
}
.dispatch-card .card-top {
  display: flex; align-items: center; gap: 0; margin-bottom: 10px;
}
/* 3노드 경로 */
.route-nodes {
  display: flex; align-items: stretch; flex: 1; gap: 0;
}
.route-node {
  flex: 1; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; min-width: 0;
}
.route-node.pickup {
  background: #fffbeb; border-color: #fbbf24; position: relative;
}
.route-node .node-label {
  font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase;
  letter-spacing: .4px; margin-bottom: 3px;
}
.route-node.pickup .node-label { color: #d97706; }
.route-node .node-time {
  font-size: 16px; font-weight: 700; color: var(--primary); line-height: 1;
}
.route-node.pickup .node-time { color: #b45309; font-size: 18px; }
.route-node .node-place {
  font-size: 13px; font-weight: 500; color: var(--text); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pickup-star {
  position: absolute; top: 6px; right: 8px; font-size: 13px;
}
.route-arrow {
  color: var(--muted); font-size: 16px; padding: 0 6px; flex-shrink: 0;
  align-self: center;
}
.dispatch-card .card-meta {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.dispatch-card .meta-left { font-size: 13px; color: var(--muted); }
.dispatch-card .actions { display: flex; gap: 6px; align-items: center; }
.card-notify {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 12px; border-top: 1px solid var(--border);
  background: #f8fafc; border-radius: 0 0 10px 10px; font-size: 12px;
}
.notify-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.notify-tag.pending { background: #f1f5f9; color: #94a3b8; }
.notify-tag.sent    { background: #dbeafe; color: #1d4ed8; }
.notify-tag.pickup  { background: #fef3c7; color: #d97706; }
.notify-tag.dropoff { background: #dcfce7; color: #16a34a; }

/* 3칸 폼 (배차 등록/수정) */
.route-editor {
  display: grid; grid-template-columns: 1fr 28px 1fr 28px 1fr;
  align-items: center; gap: 0; margin-bottom: 14px;
}
.route-editor .route-arrow-big {
  text-align: center; font-size: 18px; color: var(--muted); padding-top: 18px;
}
.route-box {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  background: #f8fafc;
}
.route-box.pickup-box {
  border-color: #fbbf24; background: #fffbeb;
}
.route-box .box-title {
  font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .4px; margin-bottom: 8px;
}
.route-box.pickup-box .box-title { color: #d97706; }
.route-box label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 3px; margin-top: 8px; }
.route-box label:first-of-type { margin-top: 0; }
.route-box input {
  width: 100%; padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px;
}
.route-box.pickup-box input { border-color: #fcd34d; }
.extra-waypoints { margin-bottom: 14px; }
.extra-waypoints .section-label {
  font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600;
}
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px;
  font-weight: 600; color: #fff;
}
.badge.PLANNED { background: var(--planned); }
.badge.ONGOING { background: var(--ongoing); }
.badge.DONE { background: var(--done); }
.badge.CANCELLED { background: var(--cancelled); }
.empty { text-align: center; color: var(--muted); padding: 40px; }

/* 차량 사진 */
.vehicle-thumb {
  width: 56px; height: 40px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--border); background: #f1f5f9; display: block;
}
.vehicle-thumb-placeholder {
  width: 56px; height: 40px; border-radius: 6px; border: 1px solid var(--border);
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
  color: #cbd5e1; font-size: 20px;
}
/* 기사 사진 (원형) */
.driver-thumb {
  width: 40px; height: 40px; object-fit: cover; border-radius: 50%;
  border: 2px solid var(--border); background: #f1f5f9; display: block;
}
.driver-thumb-placeholder {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border);
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
  color: #cbd5e1; font-size: 18px;
}
.photo-preview-circle {
  width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
  display: block; margin: 0 auto; border: 3px solid var(--border);
}
.photo-upload-area {
  border: 2px dashed var(--border); border-radius: 10px; padding: 16px;
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
  position: relative;
}
.photo-upload-area:hover { border-color: var(--primary); background: #f0f7ff; }
.photo-upload-area input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.photo-preview {
  width: 100%; max-height: 180px; object-fit: contain; border-radius: 8px;
  display: block; margin: 0 auto;
}
.photo-upload-hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.photo-remove {
  display: inline-block; margin-top: 8px; font-size: 12px; color: #dc2626;
  cursor: pointer; background: none; border: none; text-decoration: underline;
}

/* 테이블 */
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: #f8fafc; color: var(--muted); font-weight: 600; font-size: 13px; }
tr:last-child td { border-bottom: none; }

/* 모달 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex;
  align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow-y: auto;
}
.modal {
  background: var(--card); border-radius: 12px; width: 100%; max-width: 560px;
  padding: 24px; box-shadow: 0 20px 50px rgba(0,0,0,.2);
}
.modal h3 { font-size: 17px; margin-bottom: 18px; }
.modal .field { margin-bottom: 14px; }
.modal .row { display: flex; gap: 12px; }
.modal .row .field { flex: 1; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.modal label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.modal input, .modal select, .modal textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px;
}
.modal textarea { resize: vertical; min-height: 50px; }
.modal input[type="checkbox"] { width: auto; padding: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.waypoint-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.waypoint-row input { flex: 1; }
.waypoint-row .btn { padding: 6px 10px; }
.conflict-warn {
  background: #fef3c7; border: 1px solid #fcd34d; color: #92400e;
  padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px;
}
.checklist { border: 1px solid var(--border); border-radius: 8px; max-height: 160px; overflow-y: auto; padding: 6px; }
.checklist label { display: flex; align-items: center; gap: 8px; padding: 5px; font-size: 14px; color: var(--text); cursor: pointer; }
.checklist input { width: auto; }

/* 뷰 토글 (리스트 / 캘린더) */
.view-toggle { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.view-toggle button { background: #fff; border: none; padding: 7px 14px; font-size: 13px; color: var(--muted); font-weight: 500; }
.view-toggle button.active { background: var(--primary); color: #fff; }

/* 월간 캘린더 */
.calendar-wrap { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.cal-header .cal-title { font-size: 17px; font-weight: 700; }
.cal-header button { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: 14px; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
}
.cal-dow {
  text-align: center; padding: 10px 4px; font-size: 12px; font-weight: 600;
  color: var(--muted); background: #f8fafc; border-bottom: 1px solid var(--border);
}
.cal-dow:first-child { color: #ef4444; }
.cal-dow:last-child  { color: #3b82f6; }
.cal-cell {
  min-height: 82px; padding: 8px; border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s;
  position: relative;
}
.cal-cell:hover { background: #f0f7ff; }
.cal-cell.today { background: #eff6ff; }
.cal-cell.selected { background: #dbeafe; }
.cal-cell.other-month .cal-day { color: #c7d2e3; }
.cal-cell:nth-child(7n+1) .cal-day { color: #ef4444; }
.cal-cell:nth-child(7n)   .cal-day { color: #3b82f6; }
.cal-cell.other-month:nth-child(7n+1) .cal-day,
.cal-cell.other-month:nth-child(7n)   .cal-day { color: #dde2ea; }
.cal-day { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cal-cell.today .cal-day {
  background: var(--primary); color: #fff !important;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; margin-bottom: 4px;
}
.cal-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.cal-count {
  font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 10px;
  color: #fff; background: var(--primary);
}
.cal-count.done { background: var(--done); }
.cal-count.ongoing { background: var(--ongoing); }
/* 빈 셀(이전/다음달 패딩) */
.cal-cell.empty { background: #fafbfc; cursor: default; }
.cal-cell.empty:hover { background: #fafbfc; }
.cal-grid-last { border-bottom: none; }

/* 통계 */
.stat-cards { display: flex; gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 18px 22px; flex: 1; }
.stat-card .label { font-size: 13px; color: var(--muted); }
.stat-card .value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* 인쇄 */
@media print {
  header, .toolbar, .actions, .btn { display: none !important; }
  body { background: #fff; }
}
@media (max-width: 640px) {
  .route-nodes { flex-direction: column; gap: 4px; }
  .route-arrow { transform: rotate(90deg); align-self: center; padding: 2px 0; }
  .route-editor { grid-template-columns: 1fr; }
  .route-editor .route-arrow-big { padding: 0; }
  .stat-cards, .stat-grid { flex-direction: column; grid-template-columns: 1fr; }
  header nav { overflow-x: auto; }
}

/* 구글맵 링크 */
.map-link-row {
  display: flex; align-items: center; gap: 4px; margin: 4px 0 6px;
}
.map-link-icon { font-size: 14px; flex-shrink: 0; }
.map-url-input {
  flex: 1; font-size: 11px; padding: 3px 6px;
  border: 1px dashed var(--border); border-radius: 4px;
  color: var(--muted); background: #f8fafc;
}
.map-url-input:focus { outline: none; border-color: var(--primary); color: var(--text); }
.map-btn {
  font-size: 13px; text-decoration: none; margin-left: 4px;
  opacity: 0.7; transition: opacity .15s;
}
.map-btn:hover { opacity: 1; }
.waypoint-row .wp-map { width: 120px; }

/* 당일 배치 패널 */
.roster-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 16px;
}
.roster-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.roster-title { font-weight: 700; font-size: 14px; color: var(--text); }
.roster-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.roster-empty { font-size: 13px; color: var(--muted); padding: 4px 0; }
.roster-card {
  position: relative; background: #f8fafc; border: 1.5px solid var(--border);
  border-radius: 8px; padding: 10px 12px; min-width: 130px; cursor: default;
  transition: border-color .15s;
}
.roster-card:hover { border-color: var(--primary); }
.roster-vehicle { font-weight: 700; font-size: 13px; color: var(--text); margin-bottom: 4px; }
.roster-vtype { font-weight: 400; font-size: 11px; color: var(--muted); }
.roster-driver {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
}
.roster-driver-photo {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
}
.roster-driver-icon { font-size: 16px; }
.roster-note { font-size: 11px; color: var(--muted); margin-top: 4px; }
.roster-actions {
  position: absolute; top: 6px; right: 6px;
  display: flex; gap: 2px; opacity: 0; transition: opacity .15s;
}
.roster-card:hover .roster-actions { opacity: 1; }
.roster-edit-btn, .roster-del-btn {
  background: none; border: none; font-size: 12px; cursor: pointer;
  padding: 2px 4px; border-radius: 4px; line-height: 1;
}
.roster-edit-btn:hover { background: #e2e8f0; }
.roster-del-btn:hover { background: #fee2e2; }

/* 배차 모달 — 빠른 선택 */
.roster-quick { margin-bottom: 12px; }
.roster-quick-label {
  font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600;
}
.roster-quick-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.roster-quick-card {
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 7px 12px; cursor: pointer; transition: all .15s;
  background: #f8fafc; min-width: 100px; text-align: center;
}
.roster-quick-card:hover { border-color: var(--primary); background: #eff6ff; }
.roster-quick-card.active {
  border-color: var(--primary); background: #eff6ff;
  box-shadow: 0 0 0 2px #bfdbfe;
}
.rqc-plate { font-weight: 700; font-size: 13px; color: var(--text); }
.rqc-driver { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* 당일/익일 2열 레이아웃 */
.two-col-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.day-col {
  min-width: 0;
}
.day-col-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.day-col-title {
  font-size: 15px; font-weight: 700; flex: 1;
}
.col-today-badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  background: var(--primary); color: #fff;
  padding: 1px 7px; border-radius: 20px; margin-left: 4px;
}
.col-today-badge.tomorrow {
  background: var(--ongoing);
}
@media (max-width: 780px) {
  .two-col-wrap { grid-template-columns: 1fr; }
}

/* 장소 입력 + 지도 버튼 */
.place-input-row {
  display: flex; align-items: center; gap: 4px; margin-bottom: 4px;
}
.place-input-row input { flex: 1; margin-bottom: 0; }
.map-search-btn {
  flex-shrink: 0; background: #f1f5f9; border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 7px; font-size: 15px; line-height: 1;
  cursor: pointer; transition: background .15s;
}
.map-search-btn:hover { background: #dbeafe; border-color: var(--primary); }
.map-link-row { margin-bottom: 6px; }
.map-link-row .map-url-input { width: 100%; }

/* ============================================
   차량 정비 모듈
   ============================================ */
.maint-alert-bar {
  background: #fef2f2; border: 1px solid #fca5a5; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 14px; font-size: 13px; color: #991b1b;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.maint-alert-tag {
  background: #fee2e2; border: 1px solid #fca5a5; border-radius: 20px;
  padding: 2px 10px; font-size: 12px; font-weight: 600; color: #b91c1c;
}
.maint-km-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 18px; margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.maint-km-info { display: flex; align-items: center; gap: 12px; }
.maint-km-label { font-size: 13px; color: var(--muted); }
.maint-km-value { font-size: 22px; font-weight: 700; color: var(--primary); }
.maint-section { margin-bottom: 28px; }
.maint-section-title {
  font-size: 15px; font-weight: 600; margin-bottom: 10px;
  color: var(--text); padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
.maint-table-wrap { overflow-x: auto; }
.maint-table {
  width: 100%; border-collapse: collapse;
  background: #fff; border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.maint-table th {
  background: #f8fafc; padding: 10px 14px; text-align: left;
  font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.maint-table td {
  padding: 10px 14px; font-size: 13px;
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
.maint-table tr:last-child td { border-bottom: none; }
.maint-item-name { font-weight: 600; white-space: nowrap; }
.maint-note-cell { max-width: 160px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maint-row-warn td { background: #fffbeb; }
.maint-row-danger td { background: #fff5f5; }
.maint-ok    { color: #16a34a; font-weight: 600; white-space: nowrap; }
.maint-warn  { color: #d97706; font-weight: 700; white-space: nowrap; }
.maint-danger{ color: #dc2626; font-weight: 700; white-space: nowrap; }
.maint-none  { color: var(--muted); white-space: nowrap; }
.maint-status-cell { white-space: nowrap; }

/* ── 정비 서브탭 ─────────────────────────────────────────── */
.maint-subtab-nav {
  display: flex; gap: 3px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 4px; margin-bottom: 20px;
}
.maint-stab {
  flex: 1; padding: 9px 12px; border: none; background: transparent;
  border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--muted); transition: all .18s; font-family: inherit;
  text-align: center; white-space: nowrap;
}
.maint-stab:hover { background: var(--bg); color: var(--text); }
.maint-stab.active { background: var(--primary); color: #fff; }

/* ── 서브 헤더 (월 선택 + 등록 버튼) ────────────────────── */
.maint-sub-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 10px;
}
.maint-month-sel {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: #fff; cursor: pointer;
}

/* ── 연료비 테이블 ───────────────────────────────────────── */
.fuel-total-row td { background: #f8fafc; font-weight: 700; border-top: 2px solid var(--border); }
.fuel-cost-cell  { font-weight: 700; color: var(--primary); }
.fuel-eff-cell   { color: #16a34a; font-weight: 700; }

/* ── 도로비용 배지 ───────────────────────────────────────── */
.exp-type-badge {
  display: inline-block; padding: 2px 9px;
  border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.exp-TOLL    { background: #dbeafe; color: #1d4ed8; }
.exp-PARKING { background: #dcfce7; color: #15803d; }
.exp-WASH    { background: #e0f2fe; color: #0369a1; }
.exp-REPAIR  { background: #fef3c7; color: #b45309; }
.exp-OTHER   { background: #f3f4f6; color: #4b5563; }

.exp-amount-cell { font-weight: 700; color: var(--primary); }
.exp-type-summary {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
}

/* ── 비용 리포트 ─────────────────────────────────────────── */
.report-summary-cards {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 28px;
}
@media (max-width: 700px) { .report-summary-cards { grid-template-columns: repeat(2,1fr); } }
.report-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 14px; text-align: center;
}
.report-card-icon  { font-size: 26px; margin-bottom: 6px; }
.report-card-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.report-card-val   { font-size: 15px; font-weight: 700; color: var(--text); }
.report-card-pct   { font-size: 13px; color: var(--muted); margin-top: 3px; }
.report-card-total { border-color: var(--primary); background: #eff6ff; }
.report-card-total .report-card-val { color: var(--primary); font-size: 18px; }

.report-bars { display: flex; flex-direction: column; gap: 10px; }
.report-bar-row { display: flex; align-items: center; gap: 10px; }
.report-bar-label {
  width: 110px; font-size: 12px; color: var(--muted);
  text-align: right; flex-shrink: 0;
}
.report-bar-track {
  flex: 1; background: #f1f5f9; border-radius: 4px; height: 22px;
  display: flex; overflow: hidden;
}
.report-bar-seg { height: 100%; min-width: 0; transition: width .4s; }
.report-bar-fuel  { background: #3b82f6; }
.report-bar-maint { background: #f59e0b; }
.report-bar-exp   { background: #10b981; }
.report-bar-val {
  width: 130px; font-size: 12px; text-align: right;
  font-weight: 700; flex-shrink: 0; white-space: nowrap;
}
.report-bar-legend {
  display: flex; gap: 16px; margin-bottom: 14px; flex-wrap: wrap;
}
.report-bar-legend span { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.report-legend-dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px;
}

/* ── 드래그 앤 드롭 배정 ─────────────────────────────────── */
.roster-draggable { cursor: grab; user-select: none; }
.roster-draggable:active { cursor: grabbing; }
.roster-dragging { opacity: .5; box-shadow: 0 0 0 2px var(--primary); }

/* 드래그 중일 때 드롭 가능한 카드에 힌트 표시 */
.is-roster-dragging .dispatch-drop-zone { display: flex; }

.dispatch-drop-zone {
  display: none;
  align-items: center; justify-content: center;
  margin-top: 8px; padding: 8px 14px;
  border: 2px dashed #93c5fd; border-radius: 8px;
  background: #eff6ff; color: #2563eb;
  font-size: 12px; font-weight: 500;
  transition: all .15s;
}

.dispatch-card.dispatch-drag-over { border-color: #2563eb; box-shadow: 0 0 0 2px #93c5fd; }
.dispatch-card.dispatch-drag-over .dispatch-drop-zone {
  background: #dbeafe; border-color: #2563eb;
  font-weight: 700;
}

/* 재배정 드롭 존 (이미 배정된 카드) */
.dispatch-drop-zone.drop-zone-reassign {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #b45309;
}
.dispatch-card.dispatch-drag-over .dispatch-drop-zone.drop-zone-reassign {
  background: #fef3c7;
  border-color: #f59e0b;
}

/* 배차카드 썸네일 */
.card-thumb-circle, .card-thumb-rect {
  display: inline-block; vertical-align: middle;
  object-fit: cover; cursor: zoom-in;
  border: 1.5px solid #e2e8f0;
  transition: transform .15s, box-shadow .15s;
  margin-right: 4px;
}
.card-thumb-circle { width: 30px; height: 30px; border-radius: 50%; }
.card-thumb-rect   { width: 42px; height: 30px; border-radius: 4px; }
.card-thumb-circle:hover, .card-thumb-rect:hover {
  transform: scale(1.12); box-shadow: 0 2px 8px rgba(0,0,0,.25); z-index: 1;
}

/* 라이트박스 */
#lb-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.82); z-index: 9999;
  align-items: center; justify-content: center;
  cursor: zoom-out;
}
#lb-overlay.active { display: flex; }
#lb-box { text-align: center; }
#lb-img  { max-width: 90vw; max-height: 82vh; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,.5); }
#lb-title { color: #fff; margin-top: 12px; font-size: 15px; font-weight: 600; }
