/* Chrome、Edge、Safari */
.reservation-list::-webkit-scrollbar {
  width: 1px;
}

.reservation-list::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 999px;
}

.reservation-list::-webkit-scrollbar-thumb {
  background: #b8c2cc;
  border-radius: 999px;
}

.reservation-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}


:root {
  --bg: #f5f4f1;
  --surface: #ffffff;
  --border: #e2e0da;
  --border-strong: #cfccc3;
  --text-primary: #24231f;
  --text-secondary: #6b6a63;
  --text-muted: #9c9a91;
  --accent: #2f6fed;
  --accent-bg: #e8f0fe;
  --danger: #c23b3b;
  --danger-bg: #fbe9e9;
  --success: #2f7d4f;
  --success-bg: #e6f4ea;
  --warning: #a16207;
  --warning-bg: #fdf3d8;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
}

.app {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  padding: 12px;
  max-width: 1080px;
  min-height: calc(100vh - 4rem);
  margin: 2rem auto;
  background: var(--bg);
  border-radius: 16px;
}


.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
}

.sidebar-header h1 { font-size: 16px; font-weight: 600; margin: 10 0 12px; }

.search-input, input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface);
  margin-bottom: 8px;
}

.search-input:focus, input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.vehicle-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}

.vehicle-item { display: flex; align-items: stretch; border-radius: var(--radius); cursor: pointer; overflow: hidden; }
.vehicle-item:hover { background: var(--bg); }
.vehicle-item.active { background: var(--accent-bg); }
.vehicle-stripe { width: 4px; flex-shrink: 0; }
.vehicle-item-body { padding: 10px 12px; flex: 1; min-width: 0; }
.vehicle-item .primary { font-size: 14px; font-weight: 600; margin: 0; }
.vehicle-item.active .primary { color: var(--accent); }
.vehicle-item .secondary { font-size: 12px; color: var(--text-secondary); margin: 0; }

.btn {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
}
.btn:hover { background: var(--bg); }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { opacity: 0.9; }
.icon-btn { width: 36px; padding: 0; display: flex; align-items: center; justify-content: center; }

/* .content { padding:0 0 0 24px; } */

.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.calendar-title { font-weight: 600; font-size: 16px; margin: 0; }
.calendar-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; font-size: 13px; color: var(--text-secondary); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.calendar-grid-wrapper { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.calendar-weekday-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); }
.calendar-weekday { background: var(--surface); padding: 6px; font-size: 12px; color: var(--text-muted); text-align: center; }
.calendar-week { position: relative; }
.calendar-week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border-bottom: 1px solid var(--border); }
.calendar-week-grid.last-week { border-bottom: none; }
.calendar-day { background: var(--surface); padding: 6px; min-height: 120px; }
.calendar-day.other-month { background: var(--bg); }
.calendar-day.today { background: var(--accent-bg); }
.calendar-day-number { font-size: 12px; margin: 0; }
.calendar-bar-lane {
  position: absolute;
  height: 18px;
  line-height: 18px;
  padding: 0 6px;
  font-size: 11px;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card-header-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.save-status {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity 0.3s;
}
.notes-hint {
  font-size: 12px;
  color: var(--text-muted);
}
.save-status.visible { opacity: 1; }

.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.card-header h2 { margin: 0; font-size: 18px; }
.card-header h3 { margin: 0; font-size: 15px; }
.muted { color: var(--text-secondary); font-size: 13px; margin: 2px 0 0; }

.location-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 12px;
}
.label { font-size: 12px; color: var(--text-muted); margin: 0 0 4px; }
.location-text { font-size: 14px; margin: 0; }

.reservation-section {
  display: flex;
  flex-wrap: wrap;
  /* gap: 24px; */
  gap: 16px;
  align-items: flex-start;
}

.reservation-card {
  flex: 1 1 260px;
  min-width: 260px;
  background: #fff;
  height: 500px;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.reservation-list { display: flex; flex-direction: column; max-height: 406px; overflow-y: auto; }
.reservation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}
.reservation-item:last-child { border-bottom: none; }
.reservation-time { font-size: 14px; margin: 0; }
.reservation-applicant { font-size: 12px; color: var(--text-secondary); margin: 2px 0 0; }

.badge { font-size: 12px; padding: 3px 10px; border-radius: 6px; white-space: nowrap; }
.badge-confirmed { background: var(--success-bg); color: var(--success); }
.badge-done { background: var(--bg); color: var(--text-secondary); }

.empty-hint { font-size: 13px; color: var(--text-muted); padding: 8px 4px; margin: 0; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--surface);
  border-radius: 12px;
  width: 100%;
  max-width: 380px;
  padding: 20px;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close { cursor: pointer; color: var(--text-secondary); font-size: 20px; line-height: 1; }

.modal-row { display: flex; flex-direction: column; gap: 12px; }
.modal-row > div { width: 100%; }

.modal-actions-split { display: flex; justify-content: space-between; align-items: center; }
.modal-actions-right { display: flex; gap: 8px; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bg); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.reservation-item.clickable { cursor: pointer; }
.reservation-item.clickable:hover { background: var(--bg); border-radius: 6px; }

.datetime-group { display: flex; gap: 6px; }
.datetime-group input { min-width: 0; flex: 1.4; margin-bottom: 0; }
.datetime-group select { min-width: 0; flex: 1; margin-bottom: 0; } 

select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 8px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface);
}
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.error-text {
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  margin: 6px 0 0;
}

textarea {
  width: 100%;
  border: none;
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface);
  resize: none;
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.inline-add-row { display: flex; gap: 8px; margin-top: -4px; margin-bottom: 8px; }
.inline-add-row input { flex: 1; margin-bottom: 0; }



.vehicle-item { flex-shrink: 0; }
/* 移動端 */
@media (max-width: 640px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    margin: 0;
    padding: 8px;
    /* gap: 8px; */
    border-radius: 0;
    border: none;
    min-height: 100vh;
  }
  .vehicle-list {
    flex: none;
    max-height: 230px;
    overflow-y: auto;
  }
  /* .content {
    padding: 16px;
  } */
  .card-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  .location-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .calendar-day {
    min-height: 96px;
    padding: 4px;
  }
  .calendar-day-number {
    font-size: 11px;
  }
  .modal {
    max-width: calc(100% - 32px);
  }
  .reservation-section {
  flex-direction: column;
  }
  .reservation-card{
    min-width: 100%;
  }

}


[hidden] { display: none !important; }
